fa6a6fec54a584783095832a87f29b8c8455a5ac
[reactos.git] / reactos / drivers / directx / dxapi / dxapi_driver.h
1
2 /* DDK/NDK/SDK Headers */
3 #include <ddk/ntddk.h>
4 #include <ddk/ntddmou.h>
5 #include <ddk/ntifs.h>
6 #include <ddk/tvout.h>
7 #include <ndk/ntndk.h>
8
9 #include <stdarg.h>
10 #include <windef.h>
11 #include <winerror.h>
12 #include <wingdi.h>
13 #include <winddi.h>
14 #include <prntfont.h>
15 #include <dde.h>
16
17
18 #include <ddk/ddkmapi.h>
19
20 /* Prototypes */
21 VOID DxGetVersionNumber(PVOID lpvInBuffer, LPDDGETVERSIONNUMBER lpvOutBuffer);
22 VOID DxCloseHandle(PVOID lpvInBuffer, PVOID lpvOutBuffer);
23 VOID DxOpenDirectDraw(PVOID lpvInBuffer, PVOID lpvOutBuffer);
24 VOID DxOpenSurface(PVOID lpvInBuffer, PVOID lpvOutBuffer);
25 VOID DxOpenVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer);
26 VOID DxGetKernelCaps(PVOID lpvInBuffer, PVOID lpvOutBuffer);
27 VOID DxGetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer);
28 VOID DxSetFieldNumber(PVOID lpvInBuffer, PVOID lpvOutBuffer);
29 VOID DxSetSkipPattern(PVOID lpvInBuffer, PVOID lpvOutBuffer);
30 VOID DxGetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer);
31 VOID DxSetSurfaceState(PVOID lpvInBuffer, PVOID lpvOutBuffer);
32 VOID DxLock(PVOID lpvInBuffer, PVOID lpvOutBuffer);
33 VOID DxFlipOverlay(PVOID lpvInBuffer, PVOID lpvOutBuffer);
34 VOID DxFlipVideoPort(PVOID lpvInBuffer, PVOID lpvOutBuffer);
35 VOID DxGetCurrentAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer);
36 VOID DxGetPreviousAutoflip(PVOID lpvInBuffer, PVOID lpvOutBuffer);
37 VOID DxRegisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer);
38 VOID DxUnregisterEvent(PVOID lpvInBuffer, PVOID lpvOutBuffer);
39 VOID DxGetPolarity(PVOID lpvInBuffer, PVOID lpvOutBuffer);
40 VOID DxOpenVpCatureDevice(PVOID lpvInBuffer, PVOID lpvOutBuffer);
41 VOID DxAddVpCaptureBuffer(PVOID lpvInBuffer, PVOID lpvOutBuffer);
42 VOID DxFlushVpCaptureBuffs(PVOID lpvInBuffer, PVOID lpvOutBuffer);
43
44 /* Internal driver table being use as looking up table for correct size of structs */
45 DWORD tblCheckInBuffer [] =
46 {
47 /* DD_DXAPI_GETVERSIONNUMBER */
48 0,
49 /* DD_DXAPI_CLOSEHANDLE */
50 sizeof(DDCLOSEHANDLE),
51 0, // DD_DXAPI_OPENDIRECTDRAW
52 0, // DD_DXAPI_OPENSURFACE
53 0, // DD_DXAPI_OPENVIDEOPORT
54 /* DD_DXAPI_GETKERNELCAPS */
55 sizeof(HANDLE),
56 /* DD_DXAPI_GET_VP_FIELD_NUMBER */
57 sizeof(DDGETFIELDNUMIN),
58 0, // DD_DXAPI_SET_VP_FIELD_NUMBER
59 0, // DD_DXAPI_SET_VP_SKIP_FIELD
60 0, // DD_DXAPI_GET_SURFACE_STATE
61 0, // DD_DXAPI_SET_SURFACE_STATE
62 0, // DD_DXAPI_LOCK
63 /* DD_DXAPI_FLIP_OVERLAY */
64 sizeof(DDFLIPOVERLAY),
65 /* DD_DXAPI_FLIP_VP */
66 sizeof(DDFLIPVIDEOPORT),
67 /* DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE */
68 sizeof(DDGETAUTOFLIPIN),
69 /* DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE */
70 sizeof(DDGETAUTOFLIPIN),
71 /* DD_DXAPI_REGISTER_CALLBACK */
72 sizeof(DDREGISTERCALLBACK),
73 /* DD_DXAPI_UNREGISTER_CALLBACK */
74 sizeof(DDREGISTERCALLBACK),
75 /* DD_DXAPI_GET_POLARITY */
76 sizeof(DDGETPOLARITYIN),
77 /* DD_DXAPI_OPENVPCAPTUREDEVICE */
78 sizeof(DDOPENVPCAPTUREDEVICEIN),
79 /* DD_DXAPI_ADDVPCAPTUREBUFFER */
80 sizeof(DDADDVPCAPTUREBUFF),
81 /* DD_DXAPI_FLUSHVPCAPTUREBUFFERS */
82 sizeof(HANDLE)
83 };
84
85 DWORD tblCheckOutBuffer [] =
86 {
87 /* DD_DXAPI_GETVERSIONNUMBER */
88 sizeof(DDGETVERSIONNUMBER),
89 /* DD_DXAPI_CLOSEHANDLE */
90 sizeof(DWORD),
91 0, // DD_DXAPI_OPENDIRECTDRAW
92 0, // DD_DXAPI_OPENSURFACE
93 0, // DD_DXAPI_OPENVIDEOPORT
94 /* DD_DXAPI_GETKERNELCAPS */
95 sizeof(DDGETKERNELCAPSOUT),
96 /* DD_DXAPI_GET_VP_FIELD_NUMBER */
97 sizeof(DDGETFIELDNUMOUT),
98 0, // DD_DXAPI_SET_VP_FIELD_NUMBER
99 0, // DD_DXAPI_SET_VP_SKIP_FIELD
100 0, // DD_DXAPI_GET_SURFACE_STATE
101 0, // DD_DXAPI_SET_SURFACE_STATE
102 0, // DD_DXAPI_LOCK
103 /* DD_DXAPI_FLIP_OVERLAY */
104 sizeof(DWORD),
105 /* DD_DXAPI_FLIP_VP */
106 sizeof(DWORD),
107 /* DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE */
108 sizeof(DDGETAUTOFLIPOUT),
109 /* DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE */
110 sizeof(DDGETAUTOFLIPOUT),
111 /* DD_DXAPI_REGISTER_CALLBACK */
112 sizeof(DWORD),
113 /* DD_DXAPI_UNREGISTER_CALLBACK */
114 sizeof(DWORD),
115 /* DD_DXAPI_GET_POLARITY */
116 sizeof(DDGETPOLARITYOUT),
117 /* DD_DXAPI_OPENVPCAPTUREDEVICE */
118 sizeof(DDOPENVPCAPTUREDEVICEOUT),
119 /* DD_DXAPI_ADDVPCAPTUREBUFFER */
120 sizeof(DWORD),
121 /* DD_DXAPI_FLUSHVPCAPTUREBUFFERS */
122 sizeof(DWORD)
123 };
124
125
126 /* Internal driver function */
127 DRVFN gDxApiEntryPoint [] =
128 {
129 {DD_DXAPI_GETVERSIONNUMBER - DD_FIRST_DXAPI, (PFN) DxGetVersionNumber},
130 {DD_DXAPI_CLOSEHANDLE - DD_FIRST_DXAPI, (PFN) DxCloseHandle},
131 {DD_DXAPI_OPENDIRECTDRAW - DD_FIRST_DXAPI, (PFN) DxOpenDirectDraw},
132 {DD_DXAPI_OPENSURFACE - DD_FIRST_DXAPI, (PFN) DxOpenSurface},
133 {DD_DXAPI_OPENVIDEOPORT - DD_FIRST_DXAPI, (PFN) DxOpenVideoPort},
134 {DD_DXAPI_GETKERNELCAPS - DD_FIRST_DXAPI, (PFN) DxGetKernelCaps},
135 {DD_DXAPI_GET_VP_FIELD_NUMBER - DD_FIRST_DXAPI, (PFN) DxGetFieldNumber},
136 {DD_DXAPI_SET_VP_FIELD_NUMBER - DD_FIRST_DXAPI, (PFN) DxSetFieldNumber},
137 {DD_DXAPI_SET_VP_SKIP_FIELD - DD_FIRST_DXAPI, (PFN) DxSetSkipPattern},
138 {DD_DXAPI_GET_SURFACE_STATE - DD_FIRST_DXAPI, (PFN) DxGetSurfaceState},
139 {DD_DXAPI_SET_SURFACE_STATE - DD_FIRST_DXAPI, (PFN) DxSetSurfaceState},
140 {DD_DXAPI_LOCK - DD_FIRST_DXAPI, (PFN) DxLock},
141 {DD_DXAPI_FLIP_OVERLAY - DD_FIRST_DXAPI, (PFN) DxFlipOverlay},
142 {DD_DXAPI_FLIP_VP - DD_FIRST_DXAPI, (PFN) DxFlipVideoPort},
143 {DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE - DD_FIRST_DXAPI, (PFN) DxGetCurrentAutoflip},
144 {DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE - DD_FIRST_DXAPI, (PFN) DxGetPreviousAutoflip},
145 {DD_DXAPI_REGISTER_CALLBACK - DD_FIRST_DXAPI, (PFN) DxRegisterEvent},
146 {DD_DXAPI_UNREGISTER_CALLBACK - DD_FIRST_DXAPI, (PFN) DxUnregisterEvent},
147 {DD_DXAPI_GET_POLARITY - DD_FIRST_DXAPI, (PFN) DxGetPolarity},
148 {DD_DXAPI_OPENVPCAPTUREDEVICE - DD_FIRST_DXAPI, (PFN) DxOpenVpCatureDevice},
149 {DD_DXAPI_ADDVPCAPTUREBUFFER - DD_FIRST_DXAPI, (PFN) DxAddVpCaptureBuffer},
150 {DD_DXAPI_FLUSHVPCAPTUREBUFFERS - DD_FIRST_DXAPI, (PFN) DxFlushVpCaptureBuffs}
151 };
152
153
154