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