3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: Native driver for dxg implementation
6 * FILE: win32ss/reactx/dxapi/main.c
7 * PROGRAMER: Magnus olsen (magnus@greatlord.com)
9 * 15/10-2007 Magnus Olsen
13 #include "dxapi_driver.h"
15 #define NDEBU /* debug prints are enabled, add a G at the end to disable it ;-) */
19 DriverEntry(IN PVOID Context1
,
23 * NOTE this driver will never be load, it only contain export list
24 * to win32k eng functions
26 return STATUS_SUCCESS
;
30 * @name DxApiGetVersion
33 * The function DxApiGetVersion return the dsound version, and it always return 4.02
46 /* MSDN say this always return Direct Sound version 4.02 */
56 * The function DxApi calls to diffent functions, follow functions
58 * DxGetVersionNumber, DxCloseHandle, DxOpenDirectDraw, DxOpenSurface,
59 * DxOpenVideoPort, DxGetKernelCaps, DxGetFieldNumber, DxSetFieldNumber,
60 * DxSetSkipPattern, DxGetSurfaceState, DxSetSurfaceState, DxLock,
61 * DxFlipOverlay, DxFlipVideoPort, DxGetCurrentAutoflip, DxGetPreviousAutoflip,
62 * DxRegisterEvent, DxUnregisterEvent, DxGetPolarity, DxOpenVpCatureDevice,
63 * DxAddVpCaptureBuffer, DxFlushVpCaptureBuffs
65 * See ddkmapi.h as well
68 * @param ULONG dwFunctionNum
69 * The function id we want call on in the dxapi.sys see ddkmapi.h for the id
71 * @param PVOID lpvInBuffer
72 * Our input buffer to the functions we call to, This param can be NULL
74 * @param ULONG cbInBuffer
75 * Our size in bytes of the input buffer, rember wrong size will result in the function
76 * does not being call.
78 * @param PVOID lpvOutBuffer
79 * Our Output buffer, there the function fill in the info, this param can not
80 * be null. if it null the functions we trying call on will not be call
82 * @param ULONG cbOutBuffer
83 * Our size in bytes of the output buffer, rember wrong size will result in the function
84 * does not being call.
90 * before call to any of this functions, do not forget set lpvOutBuffer->ddRVal = DDERR_GEN*,
91 * if that member exists in the outbuffer ;
97 DxApi(IN DWORD dwFunctionNum
,
98 IN LPVOID lpvInBuffer
,
100 OUT LPVOID lpvOutBuffer
,
101 OUT DWORD cbOutBuffer
)
104 dwFunctionNum
-= DD_FIRST_DXAPI
;
106 if ((lpvOutBuffer
== NULL
) ||
107 /*(dwFunctionNum < (DD_FIRST_DXAPI - DD_FIRST_DXAPI)) ||*/
108 (dwFunctionNum
> (DD_DXAPI_FLUSHVPCAPTUREBUFFERS
- DD_FIRST_DXAPI
)) ||
109 (gDxApiEntryPoint
[dwFunctionNum
].pfn
== NULL
) ||
110 (cbInBuffer
!= tblCheckInBuffer
[dwFunctionNum
]) ||
111 (cbOutBuffer
!= tblCheckOutBuffer
[dwFunctionNum
]))
117 gDxApiEntryPoint
[dwFunctionNum
].pfn(lpvInBuffer
, lpvOutBuffer
);
178 * @name DxGetVersionNumber
181 * The function DxGetVersionNumber return dxapi interface version, that is 1.0
191 DxGetVersionNumber(PVOID lpvInBuffer
, LPDDGETVERSIONNUMBER lpvOutBuffer
)
193 lpvOutBuffer
->ddRVal
= DD_OK
;
194 lpvOutBuffer
->dwMajorVersion
= 1;
195 lpvOutBuffer
->dwMinorVersion
= 0;
199 DxCloseHandle(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
201 /* FIXME Unimplement */
205 DxOpenDirectDraw(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
207 /* FIXME Unimplement */
211 DxOpenSurface(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
213 /* FIXME Unimplement */
217 DxOpenVideoPort(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
219 /* FIXME Unimplement */
223 DxGetKernelCaps(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
225 /* FIXME Unimplement */
229 DxGetFieldNumber(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
231 /* FIXME Unimplement */
235 DxSetFieldNumber(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
237 /* FIXME Unimplement */
241 DxSetSkipPattern(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
243 /* FIXME Unimplement */
247 DxGetSurfaceState(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
249 /* FIXME Unimplement */
253 DxSetSurfaceState(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
255 /* FIXME Unimplement */
259 DxLock(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
261 /* FIXME Unimplement */
265 DxFlipOverlay(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
267 /* FIXME Unimplement */
271 DxFlipVideoPort(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
273 /* FIXME Unimplement */
277 DxGetCurrentAutoflip(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
279 /* FIXME Unimplement */
283 DxGetPreviousAutoflip(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
285 /* FIXME Unimplement */
289 DxRegisterEvent(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
291 /* FIXME Unimplement */
295 DxUnregisterEvent(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
297 /* FIXME Unimplement */
301 DxGetPolarity(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
303 /* FIXME Unimplement */
307 DxOpenVpCatureDevice(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
309 /* FIXME Unimplement */
313 DxAddVpCaptureBuffer(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
315 /* FIXME Unimplement */
319 DxFlushVpCaptureBuffs(PVOID lpvInBuffer
, PVOID lpvOutBuffer
)
321 /* FIXME Unimplement */