5bf9ec3d1bd2241d76be8321ab2c3fc364baba76
[reactos.git] / reactos / win32ss / reactx / dxapi / main.c
1
2 /*
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: Native driver for dxg implementation
6 * FILE: drivers/directx/dxg/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 NTSTATUS NTAPI
16 DriverEntry(IN PVOID Context1,
17 IN PVOID Context2)
18 {
19 /*
20 * NOTE this driver will never be load, it only contain export list
21 * to win32k eng functions
22 */
23 return STATUS_SUCCESS;
24 }
25
26 NTSTATUS NTAPI
27 GsDriverEntry(IN PVOID Context1,
28 IN PVOID Context2)
29 {
30 return DriverEntry(Context1, Context2);
31 }
32
33
34
35 /*++
36 * @name DxApiGetVersion
37 * @implemented
38 *
39 * The function DxApiGetVersion return the dsound version, and it always return 4.02
40 *
41 * @return
42 * Always return 4.02
43 *
44 * @remarks.
45 * none
46 *
47 *--*/
48 ULONG
49 PASCAL
50 DxApiGetVersion()
51 {
52 /* MSDN say this always return Direct Sound version 4.02 */
53 return 0x402;
54 }
55
56
57
58 /*++
59 * @name DxApi
60 * @implemented
61 *
62 * The function DxApi calls to diffent functions, follow functions
63 * are supported
64 * DxGetVersionNumber, DxCloseHandle, DxOpenDirectDraw, DxOpenSurface,
65 * DxOpenVideoPort, DxGetKernelCaps, DxGetFieldNumber, DxSetFieldNumber,
66 * DxSetSkipPattern, DxGetSurfaceState, DxSetSurfaceState, DxLock,
67 * DxFlipOverlay, DxFlipVideoPort, DxGetCurrentAutoflip, DxGetPreviousAutoflip,
68 * DxRegisterEvent, DxUnregisterEvent, DxGetPolarity, DxOpenVpCatureDevice,
69 * DxAddVpCaptureBuffer, DxFlushVpCaptureBuffs
70 *
71 * See ddkmapi.h as well
72
73 *
74 * @param ULONG dwFunctionNum
75 * The function id we want call on in the dxapi.sys see ddkmapi.h for the id
76 *
77 * @param PVOID lpvInBuffer
78 * Our input buffer to the functions we call to, This param can be NULL
79 *
80 * @param ULONG cbInBuffer
81 * Our size in bytes of the input buffer, rember wrong size will result in the function
82 * does not being call.
83 *
84 * @param PVOID lpvOutBuffer
85 * Our Output buffer, there the function fill in the info, this param can not
86 * be null. if it null the functions we trying call on will not be call
87 *
88 * @param ULONG cbOutBuffer
89 * Our size in bytes of the output buffer, rember wrong size will result in the function
90 * does not being call.
91 *
92 * @return
93 * Return Always 0.
94 *
95 * @remarks.
96 * before call to any of this functions, do not forget set lpvOutBuffer->ddRVal = DDERR_GEN*,
97 * if that member exists in the outbuffer ;
98 *
99 *--*/
100
101 DWORD
102 PASCAL
103 DxApi(IN DWORD dwFunctionNum,
104 IN LPVOID lpvInBuffer,
105 IN DWORD cbInBuffer,
106 OUT LPVOID lpvOutBuffer,
107 OUT DWORD cbOutBuffer)
108 {
109
110 dwFunctionNum -= DD_FIRST_DXAPI;
111
112 if ((lpvOutBuffer == NULL) ||
113 /*(dwFunctionNum < (DD_FIRST_DXAPI - DD_FIRST_DXAPI)) ||*/
114 (dwFunctionNum > (DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI)) ||
115 (gDxApiEntryPoint[dwFunctionNum].pfn == NULL) ||
116 (cbInBuffer != tblCheckInBuffer[dwFunctionNum]) ||
117 (cbOutBuffer != tblCheckOutBuffer[dwFunctionNum]))
118
119 {
120 return 0;
121 }
122
123 gDxApiEntryPoint[dwFunctionNum].pfn(lpvInBuffer, lpvOutBuffer);
124 return 0;
125 }
126
127 /*++
128 * @name DxGetVersionNumber
129 * @implemented
130 *
131 * The function DxGetVersionNumber return dxapi interface version, that is 1.0
132 *
133 * @return
134 * Always return 1.0
135 *
136 * @remarks.
137 * none
138 *
139 *--*/
140 VOID
141 DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer)
142 {
143 lpvOutBuffer->ddRVal = DD_OK;
144 lpvOutBuffer->dwMajorVersion = 1;
145 lpvOutBuffer->dwMinorVersion = 0;
146 }
147
148 VOID
149 DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
150 {
151 /* FIXME Unimplement */
152 }
153
154 VOID
155 DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
156 {
157 /* FIXME Unimplement */
158 }
159
160 VOID
161 DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
162 {
163 /* FIXME Unimplement */
164 }
165
166 VOID
167 DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
168 {
169 /* FIXME Unimplement */
170 }
171
172 VOID
173 DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
174 {
175 /* FIXME Unimplement */
176 }
177
178 VOID
179 DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
180 {
181 /* FIXME Unimplement */
182 }
183
184 VOID
185 DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
186 {
187 /* FIXME Unimplement */
188 }
189
190 VOID
191 DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
192 {
193 /* FIXME Unimplement */
194 }
195
196 VOID
197 DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
198 {
199 /* FIXME Unimplement */
200 }
201
202 VOID
203 DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
204 {
205 /* FIXME Unimplement */
206 }
207
208 VOID
209 DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
210 {
211 /* FIXME Unimplement */
212 }
213
214 VOID
215 DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
216 {
217 /* FIXME Unimplement */
218 }
219
220 VOID
221 DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
222 {
223 /* FIXME Unimplement */
224 }
225
226 VOID
227 DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
228 {
229 /* FIXME Unimplement */
230 }
231
232 VOID
233 DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
234 {
235 /* FIXME Unimplement */
236 }
237
238 VOID
239 DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
240 {
241 /* FIXME Unimplement */
242 }
243
244 VOID
245 DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
246 {
247 /* FIXME Unimplement */
248 }
249
250 VOID
251 DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
252 {
253 /* FIXME Unimplement */
254 }
255
256 VOID
257 DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
258 {
259 /* FIXME Unimplement */
260 }
261
262 VOID
263 DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
264 {
265 /* FIXME Unimplement */
266 }
267
268 VOID
269 DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
270 {
271 /* FIXME Unimplement */
272 }
273
274
275