ReactOS 0.4.16-dev-340-g0540c21
main.c
Go to the documentation of this file.
1
2/*
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)
8 * REVISION HISTORY:
9 * 15/10-2007 Magnus Olsen
10 */
11
12
13#include "dxapi_driver.h"
14
15#define NDEBU /* debug prints are enabled, add a G at the end to disable it ;-) */
16#include <debug.h>
17
21{
22 /*
23 * NOTE this driver will never be load, it only contain export list
24 * to win32k eng functions
25 */
26 return STATUS_SUCCESS;
27}
28
29/*++
30* @name DxApiGetVersion
31* @implemented
32*
33* The function DxApiGetVersion return the dsound version, and it always return 4.02
34*
35* @return
36* Always return 4.02
37*
38* @remarks.
39* none
40*
41*--*/
45{
46 /* MSDN say this always return Direct Sound version 4.02 */
47 return 0x402;
48}
49
50
51
52/*++
53* @name DxApi
54* @implemented
55*
56* The function DxApi calls to diffent functions, follow functions
57* are supported
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
64*
65* See ddkmapi.h as well
66
67*
68* @param ULONG dwFunctionNum
69* The function id we want call on in the dxapi.sys see ddkmapi.h for the id
70*
71* @param PVOID lpvInBuffer
72* Our input buffer to the functions we call to, This param can be NULL
73*
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.
77*
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
81*
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.
85*
86* @return
87* Return Always 0.
88*
89* @remarks.
90* before call to any of this functions, do not forget set lpvOutBuffer->ddRVal = DDERR_GEN*,
91* if that member exists in the outbuffer ;
92*
93*--*/
94
97DxApi(IN DWORD dwFunctionNum,
98 IN LPVOID lpvInBuffer,
99 IN DWORD cbInBuffer,
100 OUT LPVOID lpvOutBuffer,
101 OUT DWORD cbOutBuffer)
102{
103
104 dwFunctionNum -= DD_FIRST_DXAPI;
105
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]))
112
113 {
114 return 0;
115 }
116
117 gDxApiEntryPoint[dwFunctionNum].pfn(lpvInBuffer, lpvOutBuffer);
118 return 0;
119}
120
121VOID
122NTAPI
124 PVOID p1,
125 PVOID p2,
126 PVOID p3,
127 PVOID p4,
128 PVOID p5,
129 PVOID p6,
130 PVOID p7,
131 PVOID p8)
132{
134}
135
136VOID
137NTAPI
139 PVOID p1,
140 PVOID p2,
141 PVOID p3,
142 PVOID p4,
143 PVOID p5)
144{
146}
147
148VOID
149NTAPI
151 PVOID p1,
152 PVOID p2)
153{
155}
156
157VOID
158NTAPI
160 PVOID p1,
161 PVOID p2)
162{
164}
165
166VOID
167NTAPI
169 PVOID p1,
170 PVOID p2,
171 PVOID p3)
172{
174}
175
176
177/*++
178* @name DxGetVersionNumber
179* @implemented
180*
181* The function DxGetVersionNumber return dxapi interface version, that is 1.0
182*
183* @return
184* Always return 1.0
185*
186* @remarks.
187* none
188*
189*--*/
190VOID
192{
193 lpvOutBuffer->ddRVal = DD_OK;
194 lpvOutBuffer->dwMajorVersion = 1;
195 lpvOutBuffer->dwMinorVersion = 0;
196}
197
198VOID
199DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
200{
201 /* FIXME Unimplement */
202}
203
204VOID
205DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
206{
207 /* FIXME Unimplement */
208}
209
210VOID
211DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
212{
213 /* FIXME Unimplement */
214}
215
216VOID
217DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
218{
219 /* FIXME Unimplement */
220}
221
222VOID
223DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
224{
225 /* FIXME Unimplement */
226}
227
228VOID
229DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
230{
231 /* FIXME Unimplement */
232}
233
234VOID
235DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
236{
237 /* FIXME Unimplement */
238}
239
240VOID
241DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
242{
243 /* FIXME Unimplement */
244}
245
246VOID
247DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
248{
249 /* FIXME Unimplement */
250}
251
252VOID
253DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
254{
255 /* FIXME Unimplement */
256}
257
258VOID
259DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
260{
261 /* FIXME Unimplement */
262}
263
264VOID
265DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
266{
267 /* FIXME Unimplement */
268}
269
270VOID
271DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
272{
273 /* FIXME Unimplement */
274}
275
276VOID
277DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
278{
279 /* FIXME Unimplement */
280}
281
282VOID
283DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
284{
285 /* FIXME Unimplement */
286}
287
288VOID
289DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
290{
291 /* FIXME Unimplement */
292}
293
294VOID
295DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
296{
297 /* FIXME Unimplement */
298}
299
300VOID
301DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
302{
303 /* FIXME Unimplement */
304}
305
306VOID
307DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
308{
309 /* FIXME Unimplement */
310}
311
312VOID
313DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
314{
315 /* FIXME Unimplement */
316}
317
318VOID
319DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
320{
321 /* FIXME Unimplement */
322}
323
324
325
LONG NTSTATUS
Definition: precomp.h:26
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define DD_DXAPI_FLUSHVPCAPTUREBUFFERS
Definition: ddkmapi.h:55
#define DD_FIRST_DXAPI
Definition: ddkmapi.h:33
#define NULL
Definition: types.h:112
DRIVER_INITIALIZE DriverEntry
Definition: main.c:9
ULONG DxApiGetVersion(void)
Definition: main.c:44
DWORD tblCheckOutBuffer[]
Definition: dxapi_driver.h:75
DWORD tblCheckInBuffer[]
Definition: dxapi_driver.h:35
DRVFN gDxApiEntryPoint[]
Definition: dxapi_driver.h:116
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DD_OK
Definition: ddraw.h:186
#define STATUS_SUCCESS
Definition: shellext.h:65
DWORD dwMajorVersion
Definition: ddkmapi.h:183
DWORD dwMinorVersion
Definition: ddkmapi.h:184
PFN pfn
Definition: winddi.h:531
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1095
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1096
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
VOID DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:247
VOID NTAPI DxApiInitialize(PVOID p1, PVOID p2, PVOID p3, PVOID p4, PVOID p5, PVOID p6, PVOID p7, PVOID p8)
Definition: main.c:123
VOID NTAPI DxLoseObject(PVOID p1, PVOID p2)
Definition: main.c:159
VOID DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:319
VOID DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:265
VOID DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer)
Definition: main.c:191
VOID DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:229
VOID DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:289
VOID DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:211
VOID DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:271
VOID DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:307
VOID DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:259
VOID DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:199
VOID DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:235
VOID DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:277
VOID NTAPI DxEnableIRQ(PVOID p1, PVOID p2)
Definition: main.c:150
VOID DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:253
VOID DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:241
VOID DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:223
DWORD NTAPI DxApi(IN DWORD dwFunctionNum, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, OUT DWORD cbOutBuffer)
Definition: main.c:97
VOID NTAPI DxUpdateCapture(PVOID p1, PVOID p2, PVOID p3)
Definition: main.c:168
VOID DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:301
VOID DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:205
VOID NTAPI DxAutoflipUpdate(PVOID p1, PVOID p2, PVOID p3, PVOID p4, PVOID p5)
Definition: main.c:138
VOID DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:217
VOID DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:283
VOID DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:295
VOID DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:313