1 | /*
|
---|
2 | * ddkmapi.h
|
---|
3 | *
|
---|
4 | * DirectDraw support for DxApi function
|
---|
5 | *
|
---|
6 | * This file is part of the w32api package.
|
---|
7 | *
|
---|
8 | * Contributors:
|
---|
9 | * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
|
---|
10 | *
|
---|
11 | * THIS SOFTWARE IS NOT COPYRIGHTED
|
---|
12 | *
|
---|
13 | * This source code is offered for use in the public domain. You may
|
---|
14 | * use, modify or distribute it freely.
|
---|
15 | *
|
---|
16 | * This code is distributed in the hope that it will be useful but
|
---|
17 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
|
---|
18 | * DISCLAIMED. This includes but is not limited to warranties of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
---|
20 | *
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __DDKMAPI_H
|
---|
24 | #define __DDKMAPI_H
|
---|
25 |
|
---|
26 | #if __GNUC__ >=3
|
---|
27 | #pragma GCC system_header
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | #ifdef __cplusplus
|
---|
31 | extern "C" {
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #include "ntddk.h"
|
---|
35 |
|
---|
36 | #if defined(_DXAPI_)
|
---|
37 | #define DXAPI DECLSPEC_EXPORT
|
---|
38 | #else
|
---|
39 | #define DXAPI DECLSPEC_IMPORT
|
---|
40 | #endif
|
---|
41 |
|
---|
42 | DXAPI
|
---|
43 | DWORD
|
---|
44 | FAR PASCAL
|
---|
45 | DxApi(
|
---|
46 | /*IN*/ DWORD dwFunctionNum,
|
---|
47 | /*IN*/ LPVOID lpvInBuffer,
|
---|
48 | /*IN*/ DWORD cbInBuffer,
|
---|
49 | /*OUT*/ LPVOID lpvOutBuffer,
|
---|
50 | /*OUT*/ DWORD cbOutBuffer);
|
---|
51 |
|
---|
52 | typedef DWORD (FAR PASCAL *LPDXAPI)(
|
---|
53 | DWORD dwFunctionNum,
|
---|
54 | LPVOID lpvInBuffer,
|
---|
55 | DWORD cbInBuffer,
|
---|
56 | LPVOID lpvOutBuffer,
|
---|
57 | DWORD cbOutBuffer);
|
---|
58 |
|
---|
59 |
|
---|
60 | #define DXAPI_MAJORVERSION 1
|
---|
61 | #define DXAPI_MINORVERSION 0
|
---|
62 |
|
---|
63 | #define DD_FIRST_DXAPI 0x500
|
---|
64 |
|
---|
65 | #define DD_DXAPI_GETVERSIONNUMBER (DD_FIRST_DXAPI)
|
---|
66 | #define DD_DXAPI_CLOSEHANDLE (DD_FIRST_DXAPI+1)
|
---|
67 | #define DD_DXAPI_OPENDIRECTDRAW (DD_FIRST_DXAPI+2)
|
---|
68 | #define DD_DXAPI_OPENSURFACE (DD_FIRST_DXAPI+3)
|
---|
69 | #define DD_DXAPI_OPENVIDEOPORT (DD_FIRST_DXAPI+4)
|
---|
70 | #define DD_DXAPI_GETKERNELCAPS (DD_FIRST_DXAPI+5)
|
---|
71 | #define DD_DXAPI_GET_VP_FIELD_NUMBER (DD_FIRST_DXAPI+6)
|
---|
72 | #define DD_DXAPI_SET_VP_FIELD_NUMBER (DD_FIRST_DXAPI+7)
|
---|
73 | #define DD_DXAPI_SET_VP_SKIP_FIELD (DD_FIRST_DXAPI+8)
|
---|
74 | #define DD_DXAPI_GET_SURFACE_STATE (DD_FIRST_DXAPI+9)
|
---|
75 | #define DD_DXAPI_SET_SURFACE_STATE (DD_FIRST_DXAPI+10)
|
---|
76 | #define DD_DXAPI_LOCK (DD_FIRST_DXAPI+11)
|
---|
77 | #define DD_DXAPI_FLIP_OVERLAY (DD_FIRST_DXAPI+12)
|
---|
78 | #define DD_DXAPI_FLIP_VP (DD_FIRST_DXAPI+13)
|
---|
79 | #define DD_DXAPI_GET_CURRENT_VP_AUTOFLIP_SURFACE (DD_FIRST_DXAPI+14)
|
---|
80 | #define DD_DXAPI_GET_LAST_VP_AUTOFLIP_SURFACE (DD_FIRST_DXAPI+15)
|
---|
81 | #define DD_DXAPI_REGISTER_CALLBACK (DD_FIRST_DXAPI+16)
|
---|
82 | #define DD_DXAPI_UNREGISTER_CALLBACK (DD_FIRST_DXAPI+17)
|
---|
83 | #define DD_DXAPI_GET_POLARITY (DD_FIRST_DXAPI+18)
|
---|
84 | #define DD_DXAPI_OPENVPCAPTUREDEVICE (DD_FIRST_DXAPI+19)
|
---|
85 | #define DD_DXAPI_ADDVPCAPTUREBUFFER (DD_FIRST_DXAPI+20)
|
---|
86 | #define DD_DXAPI_FLUSHVPCAPTUREBUFFERS (DD_FIRST_DXAPI+21)
|
---|
87 |
|
---|
88 |
|
---|
89 | typedef struct _DDCAPBUFFINFO {
|
---|
90 | DWORD dwFieldNumber;
|
---|
91 | DWORD bPolarity;
|
---|
92 | LARGE_INTEGER liTimeStamp;
|
---|
93 | DWORD ddRVal;
|
---|
94 | } DDCAPBUFFINFO, FAR * LPDDCAPBUFFINFO;
|
---|
95 |
|
---|
96 | /* DDADDVPCAPTUREBUFF.dwFlags constants */
|
---|
97 | #define DDADDBUFF_SYSTEMMEMORY 0x0001
|
---|
98 | #define DDADDBUFF_NONLOCALVIDMEM 0x0002
|
---|
99 | #define DDADDBUFF_INVERT 0x0004
|
---|
100 |
|
---|
101 | typedef struct _DDADDVPCAPTUREBUFF {
|
---|
102 | HANDLE hCapture;
|
---|
103 | DWORD dwFlags;
|
---|
104 | PMDL pMDL;
|
---|
105 | PKEVENT pKEvent;
|
---|
106 | LPDDCAPBUFFINFO lpBuffInfo;
|
---|
107 | } DDADDVPCAPTUREBUFF, FAR * LPDDADDVPCAPTUREBUFF;
|
---|
108 |
|
---|
109 | typedef struct _DDCLOSEHANDLE {
|
---|
110 | HANDLE hHandle;
|
---|
111 | } DDCLOSEHANDLE, FAR *LPDDCLOSEHANDLE;
|
---|
112 |
|
---|
113 | typedef struct _DDFLIPOVERLAY {
|
---|
114 | HANDLE hDirectDraw;
|
---|
115 | HANDLE hCurrentSurface;
|
---|
116 | HANDLE hTargetSurface;
|
---|
117 | DWORD dwFlags;
|
---|
118 | } DDFLIPOVERLAY, FAR *LPDDFLIPOVERLAY;
|
---|
119 |
|
---|
120 | typedef struct _DDFLIPVIDEOPORT {
|
---|
121 | HANDLE hDirectDraw;
|
---|
122 | HANDLE hVideoPort;
|
---|
123 | HANDLE hCurrentSurface;
|
---|
124 | HANDLE hTargetSurface;
|
---|
125 | DWORD dwFlags;
|
---|
126 | } DDFLIPVIDEOPORT, FAR *LPDDFLIPVIDEOPORT;
|
---|
127 |
|
---|
128 | typedef struct _DDGETAUTOFLIPIN {
|
---|
129 | HANDLE hDirectDraw;
|
---|
130 | HANDLE hVideoPort;
|
---|
131 | } DDGETAUTOFLIPIN, FAR *LPDDGETAUTOFLIPIN;
|
---|
132 |
|
---|
133 | typedef struct _DDGETAUTOFLIPOUT {
|
---|
134 | DWORD ddRVal;
|
---|
135 | HANDLE hVideoSurface;
|
---|
136 | HANDLE hVBISurface;
|
---|
137 | BOOL bPolarity;
|
---|
138 | } DDGETAUTOFLIPOUT, FAR *LPDDGETAUTOFLIPOUT;
|
---|
139 |
|
---|
140 | typedef struct _DDGETPOLARITYIN {
|
---|
141 | HANDLE hDirectDraw;
|
---|
142 | HANDLE hVideoPort;
|
---|
143 | } DDGETPOLARITYIN, FAR *LPDDGETPOLARITYIN;
|
---|
144 |
|
---|
145 | typedef struct _DDGETPOLARITYOUT {
|
---|
146 | DWORD ddRVal;
|
---|
147 | BOOL bPolarity;
|
---|
148 | } DDGETPOLARITYOUT, FAR *LPDDGETPOLARITYOUT;
|
---|
149 |
|
---|
150 | typedef struct _DDGETSURFACESTATEIN {
|
---|
151 | HANDLE hDirectDraw;
|
---|
152 | HANDLE hSurface;
|
---|
153 | } DDGETSURFACESTATEIN, FAR *LPDDGETSURFACESTATEIN;
|
---|
154 |
|
---|
155 | /* DDGETSURFACESTATEOUT.dwStateCaps/dwStateStatus constants */
|
---|
156 | #define DDSTATE_BOB 0x0001
|
---|
157 | #define DDSTATE_WEAVE 0x0002
|
---|
158 | #define DDSTATE_EXPLICITLY_SET 0x0004
|
---|
159 | #define DDSTATE_SOFTWARE_AUTOFLIP 0x0008
|
---|
160 | #define DDSTATE_SKIPEVENFIELDS 0x0010
|
---|
161 |
|
---|
162 | typedef struct _DDGETSURFACESTATEOUT {
|
---|
163 | DWORD ddRVal;
|
---|
164 | DWORD dwStateCaps;
|
---|
165 | DWORD dwStateStatus;
|
---|
166 | } DDGETSURFACESTATEOUT, FAR *LPDDGETSURFACESTATEOUT;
|
---|
167 |
|
---|
168 | typedef struct _DDGETFIELDNUMIN {
|
---|
169 | HANDLE hDirectDraw;
|
---|
170 | HANDLE hVideoPort;
|
---|
171 | } DDGETFIELDNUMIN, FAR *LPDDGETFIELDNUMIN;
|
---|
172 |
|
---|
173 | typedef struct _DDGETFIELDNUMOUT {
|
---|
174 | DWORD ddRVal;
|
---|
175 | DWORD dwFieldNum;
|
---|
176 | } DDGETFIELDNUMOUT, FAR *LPDDGETFIELDNUMOUT;
|
---|
177 |
|
---|
178 | typedef struct _DDGETKERNELCAPSOUT {
|
---|
179 | DWORD ddRVal;
|
---|
180 | DWORD dwCaps;
|
---|
181 | DWORD dwIRQCaps;
|
---|
182 | } DDGETKERNELCAPSOUT, FAR *LPDDGETKERNELCAPSOUT;
|
---|
183 |
|
---|
184 | typedef struct _DDGETVERSIONNUMBER {
|
---|
185 | DWORD ddRVal;
|
---|
186 | DWORD dwMajorVersion;
|
---|
187 | DWORD dwMinorVersion;
|
---|
188 | } DDGETVERSIONNUMBER, FAR *LPDDGETVERSIONNUMBER;
|
---|
189 |
|
---|
190 | typedef struct _DDLOCKIN {
|
---|
191 | HANDLE hDirectDraw;
|
---|
192 | HANDLE hSurface;
|
---|
193 | } DDLOCKIN, FAR *LPDDLOCKIN;
|
---|
194 |
|
---|
195 | typedef struct _DDLOCKOUT {
|
---|
196 | DWORD ddRVal;
|
---|
197 | DWORD dwSurfHeight;
|
---|
198 | DWORD dwSurfWidth;
|
---|
199 | LONG lSurfPitch;
|
---|
200 | PVOID lpSurface;
|
---|
201 | DWORD SurfaceCaps;
|
---|
202 | DWORD dwFormatFlags;
|
---|
203 | DWORD dwFormatFourCC;
|
---|
204 | DWORD dwFormatBitCount;
|
---|
205 | _ANONYMOUS_UNION union {
|
---|
206 | DWORD dwRBitMask;
|
---|
207 | DWORD dwYBitMask;
|
---|
208 | } DUMMYUNIONNAME;
|
---|
209 | _ANONYMOUS_UNION union {
|
---|
210 | DWORD dwGBitMask;
|
---|
211 | DWORD dwUBitMask;
|
---|
212 | } DUMMYUNIONNAME2;
|
---|
213 | _ANONYMOUS_UNION union {
|
---|
214 | DWORD dwBBitMask;
|
---|
215 | DWORD dwVBitMask;
|
---|
216 | } DUMMYUNIONNAME3;
|
---|
217 | } DDLOCKOUT, FAR *LPDDLOCKOUT;
|
---|
218 |
|
---|
219 | /* LPDD_NOTIFYCALLBACK.dwFlags constants */
|
---|
220 | #define DDNOTIFY_DISPLAY_VSYNC 0x0001
|
---|
221 | #define DDNOTIFY_VP_VSYNC 0x0002
|
---|
222 | #define DDNOTIFY_VP_LINE 0x0004
|
---|
223 | #define DDNOTIFY_PRERESCHANGE 0x0008
|
---|
224 | #define DDNOTIFY_POSTRESCHANGE 0x0010
|
---|
225 | #define DDNOTIFY_PREDOSBOX 0x0020
|
---|
226 | #define DDNOTIFY_POSTDOSBOX 0x0040
|
---|
227 | #define DDNOTIFY_CLOSEDIRECTDRAW 0x0080
|
---|
228 | #define DDNOTIFY_CLOSESURFACE 0x0100
|
---|
229 | #define DDNOTIFY_CLOSEVIDEOPORT 0x0200
|
---|
230 | #define DDNOTIFY_CLOSECAPTURE 0x0400
|
---|
231 |
|
---|
232 | typedef ULONG (FAR PASCAL *LPDD_NOTIFYCALLBACK)(
|
---|
233 | DWORD dwFlags,
|
---|
234 | PVOID pContext,
|
---|
235 | DWORD dwParam1,
|
---|
236 | DWORD dwParam2);
|
---|
237 |
|
---|
238 | typedef struct _DDOPENDIRECTDRAWIN {
|
---|
239 | ULONG_PTR dwDirectDrawHandle;
|
---|
240 | LPDD_NOTIFYCALLBACK pfnDirectDrawClose;
|
---|
241 | PVOID pContext;
|
---|
242 | } DDOPENDIRECTDRAWIN, FAR *LPDDOPENDIRECTDRAWIN;
|
---|
243 |
|
---|
244 | typedef struct _DDOPENDIRECTDRAWOUT {
|
---|
245 | DWORD ddRVal;
|
---|
246 | HANDLE hDirectDraw;
|
---|
247 | } DDOPENDIRECTDRAWOUT, FAR *LPDDOPENDIRECTDRAWOUT;
|
---|
248 |
|
---|
249 | typedef struct _DDOPENSURFACEIN {
|
---|
250 | HANDLE hDirectDraw;
|
---|
251 | ULONG_PTR dwSurfaceHandle;
|
---|
252 | LPDD_NOTIFYCALLBACK pfnSurfaceClose;
|
---|
253 | PVOID pContext;
|
---|
254 | } DDOPENSURFACEIN, FAR *LPDDOPENSURFACEIN;
|
---|
255 |
|
---|
256 | typedef struct _DDOPENSURFACEOUT {
|
---|
257 | DWORD ddRVal;
|
---|
258 | HANDLE hSurface;
|
---|
259 | } DDOPENSURFACEOUT, FAR *LPDDOPENSURFACEOUT;
|
---|
260 |
|
---|
261 | typedef struct _DDOPENVIDEOPORTIN {
|
---|
262 | HANDLE hDirectDraw;
|
---|
263 | ULONG dwVideoPortHandle;
|
---|
264 | LPDD_NOTIFYCALLBACK pfnVideoPortClose;
|
---|
265 | PVOID pContext;
|
---|
266 | } DDOPENVIDEOPORTIN, FAR *LPDDOPENVIDEOPORTIN;
|
---|
267 |
|
---|
268 | typedef struct _DDOPENVIDEOPORTOUT {
|
---|
269 | DWORD ddRVal;
|
---|
270 | HANDLE hVideoPort;
|
---|
271 | } DDOPENVIDEOPORTOUT, FAR *LPDDOPENVIDEOPORTOUT;
|
---|
272 |
|
---|
273 | /* DDOPENVPCAPTUREDEVICEIN.dwFlags constants */
|
---|
274 | #define DDOPENCAPTURE_VIDEO 0x0001
|
---|
275 | #define DDOPENCAPTURE_VBI 0x0002
|
---|
276 |
|
---|
277 | typedef struct _DDOPENVPCAPTUREDEVICEIN {
|
---|
278 | HANDLE hDirectDraw;
|
---|
279 | HANDLE hVideoPort;
|
---|
280 | DWORD dwStartLine;
|
---|
281 | DWORD dwEndLine;
|
---|
282 | DWORD dwCaptureEveryNFields;
|
---|
283 | LPDD_NOTIFYCALLBACK pfnCaptureClose;
|
---|
284 | PVOID pContext;
|
---|
285 | DWORD dwFlags;
|
---|
286 | } DDOPENVPCAPTUREDEVICEIN, FAR * LPDDOPENVPCAPTUREDEVICEIN;
|
---|
287 |
|
---|
288 | typedef struct _DDOPENVPCAPTUREDEVICEOUT {
|
---|
289 | DWORD ddRVal;
|
---|
290 | HANDLE hCapture;
|
---|
291 | } DDOPENVPCAPTUREDEVICEOUT, FAR * LPDDOPENVPCAPTUREDEVICEOUT;
|
---|
292 |
|
---|
293 | /* DDREGISTERCALLBACK.dwEvents constants */
|
---|
294 | #define DDEVENT_DISPLAY_VSYNC 0x0001
|
---|
295 | #define DDEVENT_VP_VSYNC 0x0002
|
---|
296 | #define DDEVENT_VP_LINE 0x0004
|
---|
297 | #define DDEVENT_PRERESCHANGE 0x0008
|
---|
298 | #define DDEVENT_POSTRESCHANGE 0x0010
|
---|
299 | #define DDEVENT_PREDOSBOX 0x0020
|
---|
300 | #define DDEVENT_POSTDOSBOX 0x0040
|
---|
301 |
|
---|
302 | typedef struct _DDREGISTERCALLBACK {
|
---|
303 | HANDLE hDirectDraw;
|
---|
304 | ULONG dwEvents;
|
---|
305 | LPDD_NOTIFYCALLBACK pfnCallback;
|
---|
306 | ULONG_PTR dwParam1;
|
---|
307 | ULONG_PTR dwParam2;
|
---|
308 | PVOID pContext;
|
---|
309 | } DDREGISTERCALLBACK, FAR *LPDDREGISTERCALLBACK;
|
---|
310 |
|
---|
311 | typedef struct _DDSETSURFACETATE {
|
---|
312 | HANDLE hDirectDraw;
|
---|
313 | HANDLE hSurface;
|
---|
314 | DWORD dwState;
|
---|
315 | DWORD dwStartField;
|
---|
316 | } DDSETSURFACESTATE, FAR *LPDDSETSURFACESTATE;
|
---|
317 |
|
---|
318 | typedef struct _DDSETFIELDNUM {
|
---|
319 | HANDLE hDirectDraw;
|
---|
320 | HANDLE hVideoPort;
|
---|
321 | DWORD dwFieldNum;
|
---|
322 | } DDSETFIELDNUM, FAR *LPDDSETFIELDNUM;
|
---|
323 |
|
---|
324 | typedef struct _DDSETSKIPFIELD {
|
---|
325 | HANDLE hDirectDraw;
|
---|
326 | HANDLE hVideoPort;
|
---|
327 | DWORD dwStartField;
|
---|
328 | } DDSETSKIPFIELD, FAR *LPDDSETSKIPFIELD;
|
---|
329 |
|
---|
330 | #ifdef __cplusplus
|
---|
331 | }
|
---|
332 | #endif
|
---|
333 |
|
---|
334 | #endif /* __DDKMAPI_H */
|
---|