- Implement ProtocolResetComplete
[reactos.git] / 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
100 DXAPI
101 DWORD
102 DxApi(IN DWORD dwFunctionNum,
103 IN LPVOID lpvInBuffer,
104 IN DWORD cbInBuffer,
105 OUT LPVOID lpvOutBuffer,
106 OUT DWORD cbOutBuffer)
107 {
108
109 dwFunctionNum -= DD_FIRST_DXAPI;
110
111 if ((lpvOutBuffer == NULL) ||
112 (dwFunctionNum < (DD_FIRST_DXAPI - DD_FIRST_DXAPI)) ||
113 (dwFunctionNum > (DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI)) ||
114 (gDxApiEntryPoint[dwFunctionNum].pfn == NULL) ||
115 (cbInBuffer != tblCheckInBuffer[dwFunctionNum]) ||
116 (cbOutBuffer != tblCheckOutBuffer[dwFunctionNum]))
117
118 {
119 return 0;
120 }
121
122 gDxApiEntryPoint[dwFunctionNum].pfn(lpvInBuffer, lpvOutBuffer);
123 return 0;
124 }
125
126 /*++
127 * @name DxGetVersionNumber
128 * @implemented
129 *
130 * The function DxGetVersionNumber return dxapi interface version, that is 1.0
131 *
132 * @return
133 * Always return 1.0
134 *
135 * @remarks.
136 * none
137 *
138 *--*/
139 VOID
140 DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer)
141 {
142 lpvOutBuffer->ddRVal = DD_OK;
143 lpvOutBuffer->dwMajorVersion = 1;
144 lpvOutBuffer->dwMinorVersion = 0;
145 }
146
147 VOID
148 DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer)
149 {
150 /* FIXME Unimplement */
151 }
152
153 VOID
154 DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer)
155 {
156 /* FIXME Unimplement */
157 }
158
159 VOID
160 DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer)
161 {
162 /* FIXME Unimplement */
163 }
164
165 VOID
166 DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
167 {
168 /* FIXME Unimplement */
169 }
170
171 VOID
172 DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer)
173 {
174 /* FIXME Unimplement */
175 }
176
177 VOID
178 DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
179 {
180 /* FIXME Unimplement */
181 }
182
183 VOID
184 DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer)
185 {
186 /* FIXME Unimplement */
187 }
188
189 VOID
190 DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer)
191 {
192 /* FIXME Unimplement */
193 }
194
195 VOID
196 DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
197 {
198 /* FIXME Unimplement */
199 }
200
201 VOID
202 DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer)
203 {
204 /* FIXME Unimplement */
205 }
206
207 VOID
208 DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer)
209 {
210 /* FIXME Unimplement */
211 }
212
213 VOID
214 DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer)
215 {
216 /* FIXME Unimplement */
217 }
218
219 VOID
220 DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer)
221 {
222 /* FIXME Unimplement */
223 }
224
225 VOID
226 DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
227 {
228 /* FIXME Unimplement */
229 }
230
231 VOID
232 DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer)
233 {
234 /* FIXME Unimplement */
235 }
236
237 VOID
238 DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
239 {
240 /* FIXME Unimplement */
241 }
242
243 VOID
244 DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer)
245 {
246 /* FIXME Unimplement */
247 }
248
249 VOID
250 DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer)
251 {
252 /* FIXME Unimplement */
253 }
254
255 VOID
256 DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer)
257 {
258 /* FIXME Unimplement */
259 }
260
261 VOID
262 DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer)
263 {
264 /* FIXME Unimplement */
265 }
266
267 VOID
268 DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer)
269 {
270 /* FIXME Unimplement */
271 }
272
273
274