xref: /reactos/win32ss/reactx/dxapi/main.c (revision d6eebaa4)
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 
18 NTSTATUS NTAPI
19 DriverEntry(IN PVOID Context1,
20             IN PVOID Context2)
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
44 DxApiGetVersion(VOID)
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
123 DxApiInitialize (
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 {
133     UNIMPLEMENTED;
134 }
135 
136 VOID
137 NTAPI
138 DxAutoflipUpdate (
139     PVOID p1,
140     PVOID p2,
141     PVOID p3,
142     PVOID p4,
143     PVOID p5)
144 {
145     UNIMPLEMENTED;
146 }
147 
148 VOID
149 NTAPI
150 DxEnableIRQ (
151     PVOID p1,
152     PVOID p2)
153 {
154     UNIMPLEMENTED;
155 }
156 
157 VOID
158 NTAPI
159 DxLoseObject (
160     PVOID p1,
161     PVOID p2)
162 {
163     UNIMPLEMENTED;
164 }
165 
166 VOID
167 NTAPI
168 DxUpdateCapture (
169     PVOID p1,
170     PVOID p2,
171     PVOID p3)
172 {
173     UNIMPLEMENTED;
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
191 DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer)
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 
326