ReactOS  0.4.15-dev-494-g1d8c567
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 *--*/
42 ULONG
43 NTAPI
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 
95 DWORD
96 NTAPI
97 DxApi(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 
121 VOID
122 NTAPI
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 
136 VOID
137 NTAPI
139  PVOID p1,
140  PVOID p2,
141  PVOID p3,
142  PVOID p4,
143  PVOID p5)
144 {
146 }
147 
148 VOID
149 NTAPI
151  PVOID p1,
152  PVOID p2)
153 {
155 }
156 
157 VOID
158 NTAPI
160  PVOID p1,
161  PVOID p2)
162 {
164 }
165 
166 VOID
167 NTAPI
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 *--*/
190 VOID
192 {
193  lpvOutBuffer->ddRVal = DD_OK;
194  lpvOutBuffer->dwMajorVersion = 1;
195  lpvOutBuffer->dwMinorVersion = 0;
196 }
197 
198 VOID
199 DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
200 {
201  /* FIXME Unimplement */
202 }
203 
204 VOID
205 DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
206 {
207  /* FIXME Unimplement */
208 }
209 
210 VOID
211 DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
212 {
213  /* FIXME Unimplement */
214 }
215 
216 VOID
217 DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
218 {
219  /* FIXME Unimplement */
220 }
221 
222 VOID
223 DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
224 {
225  /* FIXME Unimplement */
226 }
227 
228 VOID
229 DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
230 {
231  /* FIXME Unimplement */
232 }
233 
234 VOID
235 DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
236 {
237  /* FIXME Unimplement */
238 }
239 
240 VOID
241 DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
242 {
243  /* FIXME Unimplement */
244 }
245 
246 VOID
247 DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
248 {
249  /* FIXME Unimplement */
250 }
251 
252 VOID
253 DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
254 {
255  /* FIXME Unimplement */
256 }
257 
258 VOID
259 DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
260 {
261  /* FIXME Unimplement */
262 }
263 
264 VOID
265 DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
266 {
267  /* FIXME Unimplement */
268 }
269 
270 VOID
271 DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
272 {
273  /* FIXME Unimplement */
274 }
275 
276 VOID
277 DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
278 {
279  /* FIXME Unimplement */
280 }
281 
282 VOID
283 DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
284 {
285  /* FIXME Unimplement */
286 }
287 
288 VOID
289 DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
290 {
291  /* FIXME Unimplement */
292 }
293 
294 VOID
295 DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
296 {
297  /* FIXME Unimplement */
298 }
299 
300 VOID
301 DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
302 {
303  /* FIXME Unimplement */
304 }
305 
306 VOID
307 DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
308 {
309  /* FIXME Unimplement */
310 }
311 
312 VOID
313 DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
314 {
315  /* FIXME Unimplement */
316 }
317 
318 VOID
319 DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
320 {
321  /* FIXME Unimplement */
322 }
323 
324 
325 
#define IN
Definition: typedefs.h:39
VOID NTAPI DxUpdateCapture(PVOID p1, PVOID p2, PVOID p3)
Definition: main.c:168
VOID DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:199
DWORD NTAPI DxApi(IN DWORD dwFunctionNum, IN LPVOID lpvInBuffer, IN DWORD cbInBuffer, OUT LPVOID lpvOutBuffer, OUT DWORD cbOutBuffer)
Definition: main.c:97
VOID DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:283
VOID DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:217
LONG NTSTATUS
Definition: precomp.h:26
VOID DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:313
VOID DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:277
DWORD tblCheckOutBuffer[]
Definition: dxapi_driver.h:76
VOID DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:295
PFN pfn
Definition: winddi.h:531
VOID DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:247
#define DD_OK
Definition: ddraw.h:186
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
DWORD dwMinorVersion
Definition: ddkmapi.h:184
DRVFN gDxApiEntryPoint[]
Definition: dxapi_driver.h:117
VOID NTAPI DxLoseObject(PVOID p1, PVOID p2)
Definition: main.c:159
smooth NULL
Definition: ftsmooth.c:416
VOID DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:319
VOID DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:223
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:253
VOID DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:265
DWORD dwMajorVersion
Definition: ddkmapi.h:183
VOID DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer)
Definition: main.c:191
VOID NTAPI DxAutoflipUpdate(PVOID p1, PVOID p2, PVOID p3, PVOID p4, PVOID p5)
Definition: main.c:138
VOID DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:271
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT _In_ PTDI_PNP_CONTEXT Context2
Definition: tdikrnl.h:1094
VOID DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:259
VOID DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:241
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
Definition: main.c:690
VOID DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:205
_In_ PNET_PNP_EVENT _In_ PTDI_PNP_CONTEXT Context1
Definition: tdikrnl.h:1094
DWORD tblCheckInBuffer[]
Definition: dxapi_driver.h:36
VOID NTAPI DxApiInitialize(PVOID p1, PVOID p2, PVOID p3, PVOID p4, PVOID p5, PVOID p6, PVOID p7, PVOID p8)
Definition: main.c:123
VOID DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:235
#define DD_DXAPI_FLUSHVPCAPTUREBUFFERS
Definition: ddkmapi.h:55
#define OUT
Definition: typedefs.h:40
VOID DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:289
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:115
VOID DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:229
VOID NTAPI DxEnableIRQ(PVOID p1, PVOID p2)
Definition: main.c:150
VOID DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:301
#define DD_FIRST_DXAPI
Definition: ddkmapi.h:33
return STATUS_SUCCESS
Definition: btrfs.c:3014
ULONG NTAPI DxApiGetVersion(VOID)
Definition: main.c:44
VOID DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:211
VOID DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
Definition: main.c:307