ab8f5654d6cd3689ef470a35957b00a9cfeacd5e
[reactos.git] / reactos / include / ddk / ddrawi.h
1 /*
2 * DirectDraw driver interface
3 * (DirectX 7 version)
4 *
5 * Copyright (C) 2001 Ove Kaaven
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #ifndef __DDRAWI_INCLUDED__
23 #define __DDRAWI_INCLUDED__
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #define OBJECT_ISROOT 0x80000000
30
31 #include <ddraw.h>
32 #include <dvp.h>
33 #include <ddkernel.h>
34 #include <dmemmgr.h>
35
36 #define DDAPI WINAPI
37
38 #define VALID_ALIGNMENT(align) \
39 (!((align==0)||(align%2)!= 0 ))
40
41 /* the DirectDraw versions */
42 #define DD_VERSION 0x0200 /* compatibility version */
43 #define DD_RUNTIME_VERSION 0x0902 /* actual version */
44
45 /* the HAL version returned from QUERYESCSUPPORT - DCICOMMAND */
46 #define DD_HAL_VERSION 0x0100
47
48 /* more DCICOMMAND escapes */
49 #ifndef DCICOMMAND
50 #define DCICOMMAND 3075
51 #endif
52
53 #define DDCREATEDRIVEROBJECT 10
54 #define DDGET32BITDRIVERNAME 11
55 #define DDNEWCALLBACKFNS 12
56 #define DDVERSIONINFO 13
57
58
59
60 #define DDUNSUPPORTEDMODE ((DWORD) -1)
61
62 #include "dciddi.h"
63
64 #ifndef CCHDEVICENAME
65 #define CCHDEVICENAME 32
66 #endif
67 #define MAX_DRIVER_NAME CCHDEVICENAME
68
69 #define DDHAL_DRIVER_DLLNAME "DDRAW16.DLL"
70 #define DDHAL_APP_DLLNAME "DDRAW.DLL"
71
72
73
74 /* GUID */
75 #ifdef _WIN32
76 DEFINE_GUID(GUID_MiscellaneousCallbacks, 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
77 DEFINE_GUID(GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
78 DEFINE_GUID(GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
79 DEFINE_GUID(GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
80 DEFINE_GUID(GUID_D3DCallbacks2, 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
81 DEFINE_GUID(GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
82 DEFINE_GUID(GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37);
83 DEFINE_GUID(GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
84 DEFINE_GUID(GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
85 DEFINE_GUID(GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
86 DEFINE_GUID(GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae);
87 DEFINE_GUID(GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
88 DEFINE_GUID(GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
89 DEFINE_GUID(GUID_OptSurfaceKmodeInfo, 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
90 DEFINE_GUID(GUID_OptSurfaceUmodeInfo, 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
91 DEFINE_GUID(GUID_UserModeDriverInfo, 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
92 DEFINE_GUID(GUID_UserModeDriverPassword, 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
93 DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
94 DEFINE_GUID(GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e);
95 DEFINE_GUID(GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A);
96 #endif
97
98 #ifndef _WIN32
99 #undef E_NOTIMPL
100 #undef E_OUTOFMEMORY
101 #undef E_INVALIDARG
102 #undef E_FAIL
103 #define E_NOTIMPL 0x80004001L
104 #define E_OUTOFMEMORY 0x8007000EL
105 #define E_INVALIDARG 0x80070057L
106 #define E_FAIL 0x80004005L
107 #endif
108
109
110 /*****************************************************************************
111 * Initialization stuff
112 */
113 typedef struct {
114 char szName[260];
115 char szEntryPoint[64];
116 DWORD dwContext;
117 } DD32BITDRIVERDATA,*LPDD32BITDRIVERDATA;
118
119 typedef struct {
120 DWORD dwHALVersion;
121 ULONG_PTR dwReserved1;
122 ULONG_PTR dwReserved2;
123 } DDVERSIONDATA,*LPDDVERSIONDATA;
124
125 typedef DWORD (PASCAL *LPDD32BITDRIVERINIT)(DWORD dwContext);
126
127
128
129 /* predeclare some structures */
130 typedef struct _DDHALINFO *LPDDHALINFO;
131 typedef struct _DDRAWI_DIRECTDRAW_INT *LPDDRAWI_DIRECTDRAW_INT;
132 typedef struct _DDRAWI_DIRECTDRAW_LCL *LPDDRAWI_DIRECTDRAW_LCL;
133 typedef struct _DDRAWI_DIRECTDRAW_GBL *LPDDRAWI_DIRECTDRAW_GBL;
134 typedef struct _DDRAWI_DDRAWSURFACE_INT *LPDDRAWI_DDRAWSURFACE_INT;
135 typedef struct _DDRAWI_DDRAWSURFACE_LCL *LPDDRAWI_DDRAWSURFACE_LCL;
136 typedef struct _DDRAWI_DDRAWSURFACE_GBL *LPDDRAWI_DDRAWSURFACE_GBL;
137 typedef struct _DDRAWI_DDRAWSURFACE_MORE *LPDDRAWI_DDRAWSURFACE_MORE;
138 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE *LPDDRAWI_DDRAWSURFACE_GBL_MORE;
139 typedef struct _DDRAWI_DDRAWPALETTE_INT *LPDDRAWI_DDRAWPALETTE_INT;
140 typedef struct _DDRAWI_DDRAWPALETTE_LCL *LPDDRAWI_DDRAWPALETTE_LCL;
141 typedef struct _DDRAWI_DDRAWPALETTE_GBL *LPDDRAWI_DDRAWPALETTE_GBL;
142 typedef struct _DDRAWI_DDRAWCLIPPER_INT *LPDDRAWI_DDRAWCLIPPER_INT;
143 typedef struct _DDRAWI_DDRAWCLIPPER_LCL *LPDDRAWI_DDRAWCLIPPER_LCL;
144 typedef struct _DDRAWI_DDRAWCLIPPER_GBL *LPDDRAWI_DDRAWCLIPPER_GBL;
145 typedef struct _DDRAWI_DDVIDEOPORT_INT *LPDDRAWI_DDVIDEOPORT_INT;
146 typedef struct _DDRAWI_DDVIDEOPORT_LCL *LPDDRAWI_DDVIDEOPORT_LCL;
147 typedef struct _DDRAWI_DDMOTIONCOMP_INT *LPDDRAWI_DDMOTIONCOMP_INT;
148 typedef struct _DDRAWI_DDMOTIONCOMP_LCL *LPDDRAWI_DDMOTIONCOMP_LCL;
149
150 /*****************************************************************************
151 * driver->ddraw callbacks
152 */
153 typedef BOOL (DDAPI *LPDDHAL_SETINFO)(LPDDHALINFO lpDDHalInfo, BOOL reset);
154 typedef FLATPTR (DDAPI *LPDDHAL_VIDMEMALLOC)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, DWORD dwWidth, DWORD dwHeight);
155 typedef void (DDAPI *LPDDHAL_VIDMEMFREE)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, FLATPTR fpMem);
156
157 typedef struct {
158 DWORD dwSize;
159 LPDDHAL_SETINFO lpSetInfo;
160 LPDDHAL_VIDMEMALLOC lpVidMemAlloc;
161 LPDDHAL_VIDMEMFREE lpVidMemFree;
162 } DDHALDDRAWFNS,*LPDDHALDDRAWFNS;
163
164 /*****************************************************************************
165 * mode info structure
166 */
167 typedef struct _DDHALMODEINFO {
168 DWORD dwWidth;
169 DWORD dwHeight;
170 LONG lPitch;
171 DWORD dwBPP;
172 WORD wFlags;
173 WORD wRefreshRate;
174 DWORD dwRBitMask;
175 DWORD dwGBitMask;
176 DWORD dwBBitMask;
177 DWORD dwAlphaBitMask;
178 } DDHALMODEINFO,*LPDDHALMODEINFO;
179
180
181
182
183 #define DDMODEINFO_PALETTIZED 0x0001
184 #define DDMODEINFO_MODEX 0x0002
185 #define DDMODEINFO_UNSUPPORTED 0x0004
186 #define DDMODEINFO_STANDARDVGA 0x0008
187 #define DDMODEINFO_MAXREFRESH 0x0010
188 #define DDMODEINFO_STEREO 0x0020
189
190 /*****************************************************************************
191 * video memory info structure
192 */
193 typedef struct _VIDMEM {
194 DWORD dwFlags;
195 FLATPTR fpStart;
196 union {
197 FLATPTR fpEnd;
198 DWORD dwWidth;
199 };
200 DDSCAPS ddsCaps;
201 DDSCAPS ddsCapsAlt;
202 union {
203 LPVMEMHEAP lpHeap;
204 DWORD dwHeight;
205 };
206 } VIDMEM;
207
208
209
210 #ifndef __DD_INCLUDED__
211 #define VIDMEM_ISLINEAR 0x00000001
212 #define VIDMEM_ISRECTANGULAR 0x00000002
213 #define VIDMEM_ISHEAP 0x00000004
214 #define VIDMEM_ISNONLOCAL 0x00000008
215 #define VIDMEM_ISWC 0x00000010
216 #define VIDMEM_ISDISABLED 0x00000020
217 #endif
218
219 typedef struct _VIDMEMINFO {
220 FLATPTR fpPrimary;
221 DWORD dwFlags;
222 DWORD dwDisplayWidth;
223 DWORD dwDisplayHeight;
224 LONG lDisplayPitch;
225 DDPIXELFORMAT ddpfDisplay;
226 DWORD dwOffscreenAlign;
227 DWORD dwOverlayAlign;
228 DWORD dwTextureAlign;
229 DWORD dwZBufferAlign;
230 DWORD dwAlphaAlign;
231 DWORD dwNumHeaps;
232 LPVIDMEM pvmList;
233 } VIDMEMINFO,*LPVIDMEMINFO;
234
235
236
237 typedef struct _HEAPALIAS {
238 FLATPTR fpVidMem;
239 LPVOID lpAlias;
240 DWORD dwAliasSize;
241 } HEAPALIAS,*LPHEAPALIAS;
242
243 typedef struct _HEAPALIASINFO {
244 DWORD dwRefCnt;
245 DWORD dwFlags;
246 DWORD dwNumHeaps;
247 LPHEAPALIAS lpAliases;
248 } HEAPALIASINFO,*LPHEAPALIASINFO;
249
250 #define HEAPALIASINFO_MAPPEDREAL 0x00000001
251 #define HEAPALIASINFO_MAPPEDDUMMY 0x00000002
252
253 /*****************************************************************************
254 * capabilities structures
255 */
256 typedef struct _DDCORECAPS {
257 DWORD dwSize;
258 DWORD dwCaps;
259 DWORD dwCaps2;
260 DWORD dwCKeyCaps;
261 DWORD dwFXCaps;
262 DWORD dwFXAlphaCaps;
263 DWORD dwPalCaps;
264 DWORD dwSVCaps;
265 DWORD dwAlphaBltConstBitDepths;
266 DWORD dwAlphaBltPixelBitDepths;
267 DWORD dwAlphaBltSurfaceBitDepths;
268 DWORD dwAlphaOverlayConstBitDepths;
269 DWORD dwAlphaOverlayPixelBitDepths;
270 DWORD dwAlphaOverlaySurfaceBitDepths;
271 DWORD dwZBufferBitDepths;
272 DWORD dwVidMemTotal;
273 DWORD dwVidMemFree;
274 DWORD dwMaxVisibleOverlays;
275 DWORD dwCurrVisibleOverlays;
276 DWORD dwNumFourCCCodes;
277 DWORD dwAlignBoundarySrc;
278 DWORD dwAlignSizeSrc;
279 DWORD dwAlignBoundaryDest;
280 DWORD dwAlignSizeDest;
281 DWORD dwAlignStrideAlign;
282 DWORD dwRops[DD_ROP_SPACE];
283 DDSCAPS ddsCaps;
284 DWORD dwMinOverlayStretch;
285 DWORD dwMaxOverlayStretch;
286 DWORD dwMinLiveVideoStretch;
287 DWORD dwMaxLiveVideoStretch;
288 DWORD dwMinHwCodecStretch;
289 DWORD dwMaxHwCodecStretch;
290 DWORD dwReserved1;
291 DWORD dwReserved2;
292 DWORD dwReserved3;
293 DWORD dwSVBCaps;
294 DWORD dwSVBCKeyCaps;
295 DWORD dwSVBFXCaps;
296 DWORD dwSVBRops[DD_ROP_SPACE];
297 DWORD dwVSBCaps;
298 DWORD dwVSBCKeyCaps;
299 DWORD dwVSBFXCaps;
300 DWORD dwVSBRops[DD_ROP_SPACE];
301 DWORD dwSSBCaps;
302 DWORD dwSSBCKeyCaps;
303 DWORD dwSSBFXCaps;
304 DWORD dwSSBRops[DD_ROP_SPACE];
305 DWORD dwMaxVideoPorts;
306 DWORD dwCurrVideoPorts;
307 DWORD dwSVBCaps2;
308 } DDCORECAPS,*LPDDCORECAPS;
309
310 typedef struct _DDNONLOCALVIDMEMCAPS {
311 DWORD dwSize;
312 DWORD dwNLVBCaps;
313 DWORD dwNLVBCaps2;
314 DWORD dwNLVBCKeyCaps;
315 DWORD dwNLVBFXCaps;
316 DWORD dwNLVBRops[DD_ROP_SPACE];
317 } DDNONLOCALVIDMEMCAPS,*LPDDNONLOCALVIDMEMCAPS;
318
319
320
321 #define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2
322 #define DDSCAPS2_VERTEXBUFFER DDSCAPS2_RESERVED1
323 #define DDSCAPS2_COMMANDBUFFER DDSCAPS2_RESERVED2
324
325
326
327
328 /*****************************************************************************
329 * ddraw->driver callbacks
330 */
331 #ifndef __DD_INCLUDED__
332 #define DDHAL_DRIVER_NOTHANDLED 0
333 #define DDHAL_DRIVER_HANDLED 1
334 #define DDHAL_DRIVER_NOCKEYHW 2
335 #endif
336
337 typedef struct _DDHAL_DESTROYDRIVERDATA *LPDDHAL_DESTROYDRIVERDATA;
338 typedef struct _DDHAL_CREATESURFACEDATA *LPDDHAL_CREATESURFACEDATA;
339 typedef struct _DDHAL_DRVSETCOLORKEYDATA *LPDDHAL_DRVSETCOLORKEYDATA;
340 typedef struct _DDHAL_SETMODEDATA *LPDDHAL_SETMODEDATA;
341 typedef struct _DDHAL_WAITFORVERTICALBLANKDATA *LPDDHAL_WAITFORVERTICALBLANKDATA;
342 typedef struct _DDHAL_CANCREATESURFACEDATA *LPDDHAL_CANCREATESURFACEDATA;
343 typedef struct _DDHAL_CREATEPALETTEDATA *LPDDHAL_CREATEPALETTEDATA;
344 typedef struct _DDHAL_GETSCANLINEDATA *LPDDHAL_GETSCANLINEDATA;
345 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA *LPDDHAL_SETEXCLUSIVEMODEDATA;
346 typedef struct _DDHAL_FLIPTOGDISURFACEDATA *LPDDHAL_FLIPTOGDISURFACEDATA;
347
348 typedef DWORD (PASCAL *LPDDHAL_DESTROYDRIVER) (LPDDHAL_DESTROYDRIVERDATA);
349 typedef DWORD (PASCAL *LPDDHAL_CREATESURFACE) (LPDDHAL_CREATESURFACEDATA);
350 typedef DWORD (PASCAL *LPDDHAL_SETCOLORKEY) (LPDDHAL_DRVSETCOLORKEYDATA);
351 typedef DWORD (PASCAL *LPDDHAL_SETMODE) (LPDDHAL_SETMODEDATA);
352 typedef DWORD (PASCAL *LPDDHAL_WAITFORVERTICALBLANK)(LPDDHAL_WAITFORVERTICALBLANKDATA);
353 typedef DWORD (PASCAL *LPDDHAL_CANCREATESURFACE) (LPDDHAL_CANCREATESURFACEDATA );
354 typedef DWORD (PASCAL *LPDDHAL_CREATEPALETTE) (LPDDHAL_CREATEPALETTEDATA);
355 typedef DWORD (PASCAL *LPDDHAL_GETSCANLINE) (LPDDHAL_GETSCANLINEDATA);
356 typedef DWORD (PASCAL *LPDDHAL_SETEXCLUSIVEMODE) (LPDDHAL_SETEXCLUSIVEMODEDATA);
357 typedef DWORD (PASCAL *LPDDHAL_FLIPTOGDISURFACE) (LPDDHAL_FLIPTOGDISURFACEDATA);
358
359
360
361 typedef struct _DDHAL_DDCALLBACKS {
362 DWORD dwSize;
363 DWORD dwFlags;
364 LPDDHAL_DESTROYDRIVER DestroyDriver;
365 LPDDHAL_CREATESURFACE CreateSurface;
366 LPDDHAL_SETCOLORKEY SetColorKey;
367 LPDDHAL_SETMODE SetMode;
368 LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank;
369 LPDDHAL_CANCREATESURFACE CanCreateSurface;
370 LPDDHAL_CREATEPALETTE CreatePalette;
371 LPDDHAL_GETSCANLINE GetScanLine;
372 /* DirectX 2 */
373 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
374 LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
375 } DDHAL_DDCALLBACKS,*LPDDHAL_DDCALLBACKS;
376
377
378
379 typedef struct _DDHAL_DESTROYSURFACEDATA *LPDDHAL_DESTROYSURFACEDATA;
380 typedef struct _DDHAL_FLIPDATA *LPDDHAL_FLIPDATA;
381 typedef struct _DDHAL_SETCLIPLISTDATA *LPDDHAL_SETCLIPLISTDATA;
382 typedef struct _DDHAL_LOCKDATA *LPDDHAL_LOCKDATA;
383 typedef struct _DDHAL_UNLOCKDATA *LPDDHAL_UNLOCKDATA;
384 typedef struct _DDHAL_BLTDATA *LPDDHAL_BLTDATA;
385 typedef struct _DDHAL_SETCOLORKEYDATA *LPDDHAL_SETCOLORKEYDATA;
386 typedef struct _DDHAL_ADDATTACHEDSURFACEDATA *LPDDHAL_ADDATTACHEDSURFACEDATA;
387 typedef struct _DDHAL_GETBLTSTATUSDATA *LPDDHAL_GETBLTSTATUSDATA;
388 typedef struct _DDHAL_GETFLIPSTATUSDATA *LPDDHAL_GETFLIPSTATUSDATA;
389 typedef struct _DDHAL_UPDATEOVERLAYDATA *LPDDHAL_UPDATEOVERLAYDATA;
390 typedef struct _DDHAL_SETOVERLAYPOSITIONDATA *LPDDHAL_SETOVERLAYPOSITIONDATA;
391 typedef struct _DDHAL_SETPALETTEDATA *LPDDHAL_SETPALETTEDATA;
392
393 typedef DWORD (PASCAL *LPDDHALSURFCB_DESTROYSURFACE) (LPDDHAL_DESTROYSURFACEDATA);
394 typedef DWORD (PASCAL *LPDDHALSURFCB_FLIP) (LPDDHAL_FLIPDATA);
395 typedef DWORD (PASCAL *LPDDHALSURFCB_SETCLIPLIST) (LPDDHAL_SETCLIPLISTDATA);
396 typedef DWORD (PASCAL *LPDDHALSURFCB_LOCK) (LPDDHAL_LOCKDATA);
397 typedef DWORD (PASCAL *LPDDHALSURFCB_UNLOCK) (LPDDHAL_UNLOCKDATA);
398 typedef DWORD (PASCAL *LPDDHALSURFCB_BLT) (LPDDHAL_BLTDATA);
399 typedef DWORD (PASCAL *LPDDHALSURFCB_SETCOLORKEY) (LPDDHAL_SETCOLORKEYDATA);
400 typedef DWORD (PASCAL *LPDDHALSURFCB_ADDATTACHEDSURFACE)(LPDDHAL_ADDATTACHEDSURFACEDATA);
401 typedef DWORD (PASCAL *LPDDHALSURFCB_GETBLTSTATUS) (LPDDHAL_GETBLTSTATUSDATA);
402 typedef DWORD (PASCAL *LPDDHALSURFCB_GETFLIPSTATUS) (LPDDHAL_GETFLIPSTATUSDATA);
403 typedef DWORD (PASCAL *LPDDHALSURFCB_UPDATEOVERLAY) (LPDDHAL_UPDATEOVERLAYDATA);
404 typedef DWORD (PASCAL *LPDDHALSURFCB_SETOVERLAYPOSITION)(LPDDHAL_SETOVERLAYPOSITIONDATA);
405 typedef DWORD (PASCAL *LPDDHALSURFCB_SETPALETTE) (LPDDHAL_SETPALETTEDATA);
406
407 typedef struct _DDHAL_DDSURFACECALLBACKS {
408 DWORD dwSize;
409 DWORD dwFlags;
410 LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
411 LPDDHALSURFCB_FLIP Flip;
412 LPDDHALSURFCB_SETCLIPLIST SetClipList;
413 LPDDHALSURFCB_LOCK Lock;
414 LPDDHALSURFCB_UNLOCK Unlock;
415 LPDDHALSURFCB_BLT Blt;
416 LPDDHALSURFCB_SETCOLORKEY SetColorKey;
417 LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
418 LPDDHALSURFCB_GETBLTSTATUS GetBltStatus;
419 LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus;
420 LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay;
421 LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition;
422 LPVOID reserved4;
423 LPDDHALSURFCB_SETPALETTE SetPalette;
424 } DDHAL_DDSURFACECALLBACKS,*LPDDHAL_DDSURFACECALLBACKS;
425
426
427
428 typedef struct _DDHAL_DESTROYPALETTEDATA *LPDDHAL_DESTROYPALETTEDATA;
429 typedef struct _DDHAL_SETENTRIESDATA *LPDDHAL_SETENTRIESDATA;
430
431 typedef DWORD (PASCAL *LPDDHALPALCB_DESTROYPALETTE)(LPDDHAL_DESTROYPALETTEDATA);
432 typedef DWORD (PASCAL *LPDDHALPALCB_SETENTRIES) (LPDDHAL_SETENTRIESDATA);
433
434 typedef struct _DDHAL_DDPALETTECALLBACKS {
435 DWORD dwSize;
436 DWORD dwFlags;
437 LPDDHALPALCB_DESTROYPALETTE DestroyPalette;
438 LPDDHALPALCB_SETENTRIES SetEntries;
439 } DDHAL_DDPALETTECALLBACKS,*LPDDHAL_DDPALETTECALLBACKS;
440
441 typedef DWORD (PASCAL *LPDDHALEXEBUFCB_CANCREATEEXEBUF)(LPDDHAL_CANCREATESURFACEDATA);
442 typedef DWORD (PASCAL *LPDDHALEXEBUFCB_CREATEEXEBUF) (LPDDHAL_CREATESURFACEDATA);
443 typedef DWORD (PASCAL *LPDDHALEXEBUFCB_DESTROYEXEBUF) (LPDDHAL_DESTROYSURFACEDATA);
444 typedef DWORD (PASCAL *LPDDHALEXEBUFCB_LOCKEXEBUF) (LPDDHAL_LOCKDATA);
445 typedef DWORD (PASCAL *LPDDHALEXEBUFCB_UNLOCKEXEBUF) (LPDDHAL_UNLOCKDATA);
446
447 typedef struct _DDHAL_DDEXEBUFCALLBACKS {
448 DWORD dwSize;
449 DWORD dwFlags;
450 LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer;
451 LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer;
452 LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer;
453 LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer;
454 LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer;
455 } DDHAL_DDEXEBUFCALLBACKS,*LPDDHAL_DDEXEBUFCALLBACKS;
456
457 typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA *LPDDHAL_GETAVAILDRIVERMEMORYDATA;
458 typedef struct _DDHAL_UPDATENONLOCALHEAPDATA *LPDDHAL_UPDATENONLOCALHEAPDATA;
459 typedef struct _DDHAL_GETHEAPALIGNMENTDATA *LPDDHAL_GETHEAPALIGNMENTDATA;
460
461 typedef DWORD (PASCAL *LPDDHAL_GETAVAILDRIVERMEMORY)(LPDDHAL_GETAVAILDRIVERMEMORYDATA);
462 typedef DWORD (PASCAL *LPDDHAL_UPDATENONLOCALHEAP) (LPDDHAL_UPDATENONLOCALHEAPDATA);
463 typedef DWORD (PASCAL *LPDDHAL_GETHEAPALIGNMENT) (LPDDHAL_GETHEAPALIGNMENTDATA);
464
465 typedef struct _DDHAL_DDMISCELLANEOUSCALLBACKS {
466 DWORD dwSize;
467 DWORD dwFlags;
468 LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory;
469 LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap;
470 LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment;
471 LPDDHALSURFCB_GETBLTSTATUS GetSysmemBltStatus;
472 } DDHAL_DDMISCELLANEOUSCALLBACKS,*LPDDHAL_DDMISCELLANEOUSCALLBACKS;
473
474 typedef struct _DDHAL_CREATESURFACEEXDATA *LPDDHAL_CREATESURFACEEXDATA;
475 typedef struct _DDHAL_GETDRIVERSTATEDATA *LPDDHAL_GETDRIVERSTATEDATA;
476 typedef struct _DDHAL_DESTROYDDLOCALDATA *LPDDHAL_DESTROYDDLOCALDATA;
477
478 typedef DWORD (PASCAL *LPDDHAL_CREATESURFACEEX)(LPDDHAL_CREATESURFACEEXDATA);
479 typedef DWORD (PASCAL *LPDDHAL_GETDRIVERSTATE) (LPDDHAL_GETDRIVERSTATEDATA);
480 typedef DWORD (PASCAL *LPDDHAL_DESTROYDDLOCAL) (LPDDHAL_DESTROYDDLOCALDATA);
481
482 typedef struct _DDHAL_DDMISCELLANEOUS2CALLBACKS {
483 DWORD dwSize;
484 DWORD dwFlags;
485 LPVOID Reserved;
486 LPDDHAL_CREATESURFACEEX CreateSurfaceEx;
487 LPDDHAL_GETDRIVERSTATE GetDriverState;
488 LPDDHAL_DESTROYDDLOCAL DestroyDDLocal;
489 } DDHAL_DDMISCELLANEOUS2CALLBACKS,*LPDDHAL_DDMISCELLANEOUS2CALLBACKS;
490
491
492 typedef struct _DDHAL_CANCREATEVPORTDATA *LPDDHAL_CANCREATEVPORTDATA;
493 typedef struct _DDHAL_CREATEVPORTDATA *LPDDHAL_CREATEVPORTDATA;
494 typedef struct _DDHAL_FLIPVPORTDATA *LPDDHAL_FLIPVPORTDATA;
495 typedef struct _DDHAL_GETVPORTCONNECTDATA *LPDDHAL_GETVPORTCONNECTDATA;
496 typedef struct _DDHAL_GETVPORTBANDWIDTHDATA *LPDDHAL_GETVPORTBANDWIDTHDATA;
497 typedef struct _DDHAL_GETVPORTINPUTFORMATDATA *LPDDHAL_GETVPORTINPUTFORMATDATA;
498 typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA *LPDDHAL_GETVPORTOUTPUTFORMATDATA;
499 typedef struct _DDHAL_GETVPORTFIELDDATA *LPDDHAL_GETVPORTFIELDDATA;
500 typedef struct _DDHAL_GETVPORTLINEDATA *LPDDHAL_GETVPORTLINEDATA;
501 typedef struct _DDHAL_DESTROYVPORTDATA *LPDDHAL_DESTROYVPORTDATA;
502 typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA *LPDDHAL_GETVPORTFLIPSTATUSDATA;
503 typedef struct _DDHAL_UPDATEVPORTDATA *LPDDHAL_UPDATEVPORTDATA;
504 typedef struct _DDHAL_WAITFORVPORTSYNCDATA *LPDDHAL_WAITFORVPORTSYNCDATA;
505 typedef struct _DDHAL_GETVPORTSIGNALDATA *LPDDHAL_GETVPORTSIGNALDATA;
506 typedef struct _DDHAL_VPORTCOLORDATA *LPDDHAL_VPORTCOLORDATA;
507
508 typedef DWORD (PASCAL *LPDDHALVPORTCB_CANCREATEVIDEOPORT)(LPDDHAL_CANCREATEVPORTDATA);
509 typedef DWORD (PASCAL *LPDDHALVPORTCB_CREATEVIDEOPORT)(LPDDHAL_CREATEVPORTDATA);
510 typedef DWORD (PASCAL *LPDDHALVPORTCB_FLIP)(LPDDHAL_FLIPVPORTDATA);
511 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETBANDWIDTH)(LPDDHAL_GETVPORTBANDWIDTHDATA);
512 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETINPUTFORMATS)(LPDDHAL_GETVPORTINPUTFORMATDATA);
513 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETOUTPUTFORMATS)(LPDDHAL_GETVPORTOUTPUTFORMATDATA);
514 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETFIELD)(LPDDHAL_GETVPORTFIELDDATA);
515 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETLINE)(LPDDHAL_GETVPORTLINEDATA);
516 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETVPORTCONNECT)(LPDDHAL_GETVPORTCONNECTDATA);
517 typedef DWORD (PASCAL *LPDDHALVPORTCB_DESTROYVPORT)(LPDDHAL_DESTROYVPORTDATA);
518 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETFLIPSTATUS)(LPDDHAL_GETVPORTFLIPSTATUSDATA);
519 typedef DWORD (PASCAL *LPDDHALVPORTCB_UPDATE)(LPDDHAL_UPDATEVPORTDATA);
520 typedef DWORD (PASCAL *LPDDHALVPORTCB_WAITFORSYNC)(LPDDHAL_WAITFORVPORTSYNCDATA);
521 typedef DWORD (PASCAL *LPDDHALVPORTCB_GETSIGNALSTATUS)(LPDDHAL_GETVPORTSIGNALDATA);
522 typedef DWORD (PASCAL *LPDDHALVPORTCB_COLORCONTROL)(LPDDHAL_VPORTCOLORDATA);
523
524 typedef struct _DDHAL_DDVIDEOPORTCALLBACKS
525 {
526 DWORD dwSize;
527 DWORD dwFlags;
528 LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort;
529 LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort;
530 LPDDHALVPORTCB_FLIP FlipVideoPort;
531 LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth;
532 LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats;
533 LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats;
534 LPVOID lpReserved1;
535 LPDDHALVPORTCB_GETFIELD GetVideoPortField;
536 LPDDHALVPORTCB_GETLINE GetVideoPortLine;
537 LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo;
538 LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort;
539 LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus;
540 LPDDHALVPORTCB_UPDATE UpdateVideoPort;
541 LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync;
542 LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus;
543 LPDDHALVPORTCB_COLORCONTROL ColorControl;
544 } DDHAL_DDVIDEOPORTCALLBACKS;
545
546
547 typedef struct _DDHAL_COLORCONTROLDATA *LPDDHAL_COLORCONTROLDATA;
548
549 typedef DWORD (PASCAL *LPDDHALCOLORCB_COLORCONTROL)(LPDDHAL_COLORCONTROLDATA);
550
551
552 typedef struct _DDHAL_DDCOLORCONTROLCALLBACKS
553 {
554 DWORD dwSize;
555 DWORD dwFlags;
556 LPDDHALCOLORCB_COLORCONTROL ColorControl;
557 } DDHAL_DDCOLORCONTROLCALLBACKS;
558
559 typedef struct _DDHAL_SYNCSURFACEDATA *LPDDHAL_SYNCSURFACEDATA;
560 typedef struct _DDHAL_SYNCVIDEOPORTDATA *LPDDHAL_SYNCVIDEOPORTDATA;
561
562 typedef DWORD (PASCAL *LPDDHALKERNELCB_SYNCSURFACE)(LPDDHAL_SYNCSURFACEDATA);
563 typedef DWORD (PASCAL *LPDDHALKERNELCB_SYNCVIDEOPORT)(LPDDHAL_SYNCVIDEOPORTDATA);
564
565 typedef struct _DDHAL_DDKERNELCALLBACKS
566 {
567 DWORD dwSize;
568 DWORD dwFlags;
569 LPDDHALKERNELCB_SYNCSURFACE SyncSurfaceData;
570 LPDDHALKERNELCB_SYNCVIDEOPORT SyncVideoPortData;
571 } DDHAL_DDKERNELCALLBACKS, *LPDDHAL_DDKERNELCALLBACKS;
572
573 typedef struct _DDHAL_GETMOCOMPGUIDSDATA *LPDDHAL_GETMOCOMPGUIDSDATA;
574 typedef struct _DDHAL_GETMOCOMPFORMATSDATA *LPDDHAL_GETMOCOMPFORMATSDATA;
575 typedef struct _DDHAL_CREATEMOCOMPDATA *LPDDHAL_CREATEMOCOMPDATA;
576 typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA *LPDDHAL_GETMOCOMPCOMPBUFFDATA;
577 typedef struct _DDHAL_GETINTERNALMOCOMPDATA *LPDDHAL_GETINTERNALMOCOMPDATA;
578 typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA *LPDDHAL_BEGINMOCOMPFRAMEDATA;
579 typedef struct _DDHAL_ENDMOCOMPFRAMEDATA *LPDDHAL_ENDMOCOMPFRAMEDATA;
580 typedef struct _DDHAL_RENDERMOCOMPDATA *LPDDHAL_RENDERMOCOMPDATA;
581 typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA *LPDDHAL_QUERYMOCOMPSTATUSDATA;
582 typedef struct _DDHAL_DESTROYMOCOMPDATA *LPDDHAL_DESTROYMOCOMPDATA;
583
584 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETGUIDS)( LPDDHAL_GETMOCOMPGUIDSDATA);
585 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETFORMATS)( LPDDHAL_GETMOCOMPFORMATSDATA);
586 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_CREATE)( LPDDHAL_CREATEMOCOMPDATA);
587 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETCOMPBUFFINFO)( LPDDHAL_GETMOCOMPCOMPBUFFDATA);
588 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_GETINTERNALINFO)( LPDDHAL_GETINTERNALMOCOMPDATA);
589 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_BEGINFRAME)( LPDDHAL_BEGINMOCOMPFRAMEDATA);
590 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_ENDFRAME)( LPDDHAL_ENDMOCOMPFRAMEDATA);
591 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_RENDER)( LPDDHAL_RENDERMOCOMPDATA);
592 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_QUERYSTATUS)( LPDDHAL_QUERYMOCOMPSTATUSDATA);
593 typedef DWORD (PASCAL *LPDDHALMOCOMPCB_DESTROY)( LPDDHAL_DESTROYMOCOMPDATA);
594
595 typedef struct _DDHAL_DDMOTIONCOMPCALLBACKS
596 {
597 DWORD dwSize;
598 DWORD dwFlags;
599 LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids;
600 LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats;
601 LPDDHALMOCOMPCB_CREATE CreateMoComp;
602 LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
603 LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
604 LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame;
605 LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame;
606 LPDDHALMOCOMPCB_RENDER RenderMoComp;
607 LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus;
608 LPDDHALMOCOMPCB_DESTROY DestroyMoComp;
609 } DDHAL_DDMOTIONCOMPCALLBACKS, *LPDDHAL_DDMOTIONCOMPCALLBACKS;
610
611
612
613 typedef HRESULT (WINAPI *LPDDGAMMACALIBRATORPROC)(LPDDGAMMARAMP, LPBYTE);
614
615
616
617 /*****************************************************************************
618 * driver info structure
619 *
620 * The HAL is queried for additional callbacks via the GetDriverInfo callback.
621 */
622 typedef struct _DDHAL_GETDRIVERINFODATA *LPDDHAL_GETDRIVERINFODATA;
623 typedef DWORD (PASCAL *LPDDHAL_GETDRIVERINFO)(LPDDHAL_GETDRIVERINFODATA);
624
625
626 typedef struct _DDHAL_GETDRIVERINFODATA {
627 DWORD dwSize;
628 DWORD dwFlags;
629 GUID guidInfo;
630 DWORD dwExpectedSize;
631 LPVOID lpvData;
632 DWORD dwActualSize;
633 HRESULT ddRVal;
634 ULONG_PTR dwContext;
635
636 } DDHAL_GETDRIVERINFODATA;
637
638 typedef struct _DDHALINFO {
639 DWORD dwSize;
640 LPDDHAL_DDCALLBACKS lpDDCallbacks;
641 LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks;
642 LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks;
643 VIDMEMINFO vmiData;
644 DDCORECAPS ddCaps;
645 DWORD dwMonitorFrequency;
646 LPDDHAL_GETDRIVERINFO GetDriverInfo;
647 DWORD dwModeIndex;
648 LPDWORD lpdwFourCC;
649 DWORD dwNumModes;
650 LPDDHALMODEINFO lpModeInfo;
651 DWORD dwFlags;
652 LPVOID lpPDevice;
653 DWORD hInstance;
654 /* DirectX 2 */
655 ULONG_PTR lpD3DGlobalDriverData;
656 ULONG_PTR lpD3DHALCallbacks;
657 LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks;
658 } DDHALINFO;
659
660
661
662 #define DDPALETTECALLBACKSSIZE sizeof( DDHAL_DDPALETTECALLBACKS )
663 #define DDSURFACECALLBACKSSIZE sizeof( DDHAL_DDSURFACECALLBACKS )
664 #define DDMISCELLANEOUSCALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS)
665 #define DDMISCELLANEOUS2CALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUS2CALLBACKS)
666 #define DDEXEBUFCALLBACKSSIZE sizeof( DDHAL_DDEXEBUFCALLBACKS )
667 #define DDVIDEOPORTCALLBACKSSIZE sizeof( DDHAL_DDVIDEOPORTCALLBACKS )
668 #define DDCOLORCONTROLCALLBACKSSIZE sizeof( DDHAL_DDCOLORCONTROLCALLBACKS )
669 #define DDKERNELCALLBACKSSIZE sizeof(DDHAL_DDKERNELCALLBACKS)
670 #define DDMOTIONCOMPCALLBACKSSIZE sizeof( DDHAL_DDMOTIONCOMPCALLBACKS )
671
672 #define MAX_PALETTE_SIZE 256
673
674 #define MAX_AUTOFLIP_BUFFERS 10
675 #define DDSCAPS2_INDEXBUFFER DDSCAPS2_RESERVED3
676 #define DDSCAPS3_VIDEO DDSCAPS3_RESERVED2
677 #define D3DFMT_INTERNAL_D32 71
678 #define D3DFMT_INTERNAL_S1D15 72
679 #define D3DFMT_INTERNAL_D15S1 73
680 #define D3DFMT_INTERNAL_S8D24 74
681 #define D3DFMT_INTERNAL_D24S8 75
682 #define D3DFMT_INTERNAL_X8D24 76
683 #define D3DFMT_INTERNAL_D24X8 77
684 #define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l
685 #define DDHAL_PLEASEALLOC_LINEARSIZE 0x00000003l
686
687 #define DDHAL_CB32_DESTROYDRIVER 0x00000001l
688 #define DDHAL_CB32_CREATESURFACE 0x00000002l
689 #define DDHAL_CB32_SETCOLORKEY 0x00000004l
690 #define DDHAL_CB32_SETMODE 0x00000008l
691 #define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l
692 #define DDHAL_CB32_CANCREATESURFACE 0x00000020l
693 #define DDHAL_CB32_CREATEPALETTE 0x00000040l
694 #define DDHAL_CB32_GETSCANLINE 0x00000080l
695 #define DDHAL_CB32_SETEXCLUSIVEMODE 0x00000100l
696 #define DDHAL_CB32_FLIPTOGDISURFACE 0x00000200l
697 #define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l
698 #define DDHAL_PALCB32_SETENTRIES 0x00000002l
699 #ifndef __DD_INCLUDED__
700 #define DDHALINFO_ISPRIMARYDISPLAY 0x00000001
701 #define DDHALINFO_MODEXILLEGAL 0x00000002
702 #define DDHALINFO_GETDRIVERINFOSET 0x00000004
703 #define DDHALINFO_GETDRIVERINFO2 0x00000008
704 #endif
705 #define DDRAWI_VPORTSTART 0x0001
706 #define DDRAWI_VPORTSTOP 0x0002
707 #define DDRAWI_VPORTUPDATE 0x0003
708 #define DDRAWI_VPORTGETCOLOR 0x0001
709 #define DDRAWI_VPORTSETCOLOR 0x0002
710 #define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001
711 #define DDHAL_SURFCB32_FLIP 0x00000002
712 #define DDHAL_SURFCB32_SETCLIPLIST 0x00000004
713 #define DDHAL_SURFCB32_LOCK 0x00000008
714 #define DDHAL_SURFCB32_UNLOCK 0x00000010
715 #define DDHAL_SURFCB32_BLT 0x00000020
716 #define DDHAL_SURFCB32_SETCOLORKEY 0x00000040
717 #define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080
718 #define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100
719 #define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200
720 #define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400
721 #define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800
722 #define DDHAL_SURFCB32_RESERVED4 0x00001000
723 #define DDHAL_SURFCB32_SETPALETTE 0x00002000
724 #define DDHAL_MISCCB32_GETAVAILDRIVERMEMORY 0x00000001
725 #define DDHAL_MISCCB32_UPDATENONLOCALHEAP 0x00000002
726 #define DDHAL_MISCCB32_GETHEAPALIGNMENT 0x00000004
727 #define DDHAL_MISCCB32_GETSYSMEMBLTSTATUS 0x00000008
728 #define DDHAL_MISC2CB32_ALPHABLT 0x00000001
729 #define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002
730 #define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004
731 #define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008
732 #ifndef __DD_INCLUDED__
733 #define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001
734 #define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002
735 #define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004
736 #define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008
737 #define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010
738 #endif
739 #define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001
740 #define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002
741 #define DDHAL_VPORT32_FLIP 0x00000004
742 #define DDHAL_VPORT32_GETBANDWIDTH 0x00000008
743 #define DDHAL_VPORT32_GETINPUTFORMATS 0x00000010
744 #define DDHAL_VPORT32_GETOUTPUTFORMATS 0x00000020
745 #define DDHAL_VPORT32_GETFIELD 0x00000080
746 #define DDHAL_VPORT32_GETLINE 0x00000100
747 #define DDHAL_VPORT32_GETCONNECT 0x00000200
748 #define DDHAL_VPORT32_DESTROY 0x00000400
749 #define DDHAL_VPORT32_GETFLIPSTATUS 0x00000800
750 #define DDHAL_VPORT32_UPDATE 0x00001000
751 #define DDHAL_VPORT32_WAITFORSYNC 0x00002000
752 #define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000
753 #define DDHAL_VPORT32_COLORCONTROL 0x00008000
754 #define DDHAL_COLOR_COLORCONTROL 0x00000001
755 #ifndef __DD_INCLUDED__
756 #define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001
757 #define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002
758 #endif
759 #define DDHAL_MOCOMP32_GETGUIDS 0x00000001
760 #define DDHAL_MOCOMP32_GETFORMATS 0x00000002
761 #define DDHAL_MOCOMP32_CREATE 0x00000004
762 #define DDHAL_MOCOMP32_GETCOMPBUFFINFO 0x00000008
763 #define DDHAL_MOCOMP32_GETINTERNALINFO 0x00000010
764 #define DDHAL_MOCOMP32_BEGINFRAME 0x00000020
765 #define DDHAL_MOCOMP32_ENDFRAME 0x00000040
766 #define DDHAL_MOCOMP32_RENDER 0x00000080
767 #define DDHAL_MOCOMP32_QUERYSTATUS 0x00000100
768 #define DDHAL_MOCOMP32_DESTROY 0x00000200
769
770
771 /* where the high-level ddraw implementation stores the callbacks */
772 typedef struct _DDHAL_CALLBACKS {
773 DDHAL_DDCALLBACKS cbDDCallbacks;
774 DDHAL_DDSURFACECALLBACKS cbDDSurfaceCallbacks;
775 DDHAL_DDPALETTECALLBACKS cbDDPaletteCallbacks;
776 DDHAL_DDCALLBACKS HALDD;
777 DDHAL_DDSURFACECALLBACKS HALDDSurface;
778 DDHAL_DDPALETTECALLBACKS HALDDPalette;
779 DDHAL_DDCALLBACKS HELDD;
780 DDHAL_DDSURFACECALLBACKS HELDDSurface;
781 DDHAL_DDPALETTECALLBACKS HELDDPalette;
782 DDHAL_DDEXEBUFCALLBACKS cbDDExeBufCallbacks;
783 DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf;
784 DDHAL_DDEXEBUFCALLBACKS HELDDExeBuf;
785 DDHAL_DDVIDEOPORTCALLBACKS cbDDVideoPortCallbacks;
786 DDHAL_DDVIDEOPORTCALLBACKS HALDDVideoPort;
787 DDHAL_DDCOLORCONTROLCALLBACKS cbDDColorControlCallbacks;
788 DDHAL_DDCOLORCONTROLCALLBACKS HALDDColorControl;
789 DDHAL_DDMISCELLANEOUSCALLBACKS cbDDMiscellaneousCallbacks;
790 DDHAL_DDMISCELLANEOUSCALLBACKS HALDDMiscellaneous;
791 DDHAL_DDKERNELCALLBACKS cbDDKernelCallbacks;
792 DDHAL_DDKERNELCALLBACKS HALDDKernel;
793 DDHAL_DDMOTIONCOMPCALLBACKS cbDDMotionCompCallbacks;
794 DDHAL_DDMOTIONCOMPCALLBACKS HALDDMotionComp;
795 } DDHAL_CALLBACKS,*LPDDHAL_CALLBACKS;
796
797 /*****************************************************************************
798 * parameter structures
799 */
800 typedef struct _DDHAL_DESTROYDRIVERDATA {
801 LPDDRAWI_DIRECTDRAW_GBL lpDD;
802 HRESULT ddRVal;
803 LPDDHAL_DESTROYDRIVER DestroyDriver;
804 } DDHAL_DESTROYDRIVERDATA;
805
806 typedef struct _DDHAL_SETMODEDATA {
807 LPDDRAWI_DIRECTDRAW_GBL lpDD;
808 DWORD dwModeIndex;
809 HRESULT ddRVal;
810 LPDDHAL_SETMODE SetMode;
811 BOOL inexcl;
812 BOOL useRefreshRate;
813 } DDHAL_SETMODEDATA;
814
815 typedef struct _DDHAL_CREATESURFACEDATA {
816 LPDDRAWI_DIRECTDRAW_GBL lpDD;
817 LPDDSURFACEDESC lpDDSurfaceDesc;
818 LPDDRAWI_DDRAWSURFACE_LCL * lplpSList;
819 DWORD dwSCnt;
820 HRESULT ddRVal;
821 LPDDHAL_CREATESURFACE CreateSurface;
822 } DDHAL_CREATESURFACEDATA;
823
824 typedef struct _DDHAL_CANCREATESURFACEDATA {
825 LPDDRAWI_DIRECTDRAW_GBL lpDD;
826 LPDDSURFACEDESC lpDDSurfaceDesc;
827 DWORD bIsDifferentPixelFormat;
828 HRESULT ddRVal;
829 LPDDHAL_CANCREATESURFACE CanCreateSurface;
830 } DDHAL_CANCREATESURFACEDATA;
831
832 typedef struct _DDHAL_CREATEPALETTEDATA {
833 LPDDRAWI_DIRECTDRAW_GBL lpDD;
834 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
835 LPPALETTEENTRY lpColorTable;
836 HRESULT ddRVal;
837 LPDDHAL_CREATEPALETTE CreatePalette;
838 BOOL is_excl;
839 } DDHAL_CREATEPALETTEDATA;
840
841 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA {
842 LPDDRAWI_DIRECTDRAW_GBL lpDD;
843 DWORD dwEnterExcl;
844 DWORD dwReserved;
845 HRESULT ddRVal;
846 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
847 } DDHAL_SETEXCLUSIVEMODEDATA;
848
849 /* surfaces */
850 typedef struct _DDHAL_DESTROYSURFACEDATA {
851 LPDDRAWI_DIRECTDRAW_GBL lpDD;
852 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
853 HRESULT ddRVal;
854 LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
855 } DDHAL_DESTROYSURFACEDATA;
856
857 typedef struct _DDHAL_FLIPDATA {
858 LPDDRAWI_DIRECTDRAW_GBL lpDD;
859 LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr;
860 LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg;
861 DWORD dwFlags;
862 HRESULT ddRVal;
863 LPDDHALSURFCB_FLIP Flip;
864 LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurrLeft;
865 LPDDRAWI_DDRAWSURFACE_LCL lpSurfTargLeft;
866 } DDHAL_FLIPDATA;
867
868 typedef struct _DDHAL_LOCKDATA {
869 LPDDRAWI_DIRECTDRAW_GBL lpDD;
870 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
871 DWORD bHasRect;
872 RECTL rArea;
873 LPVOID lpSurfData;
874 HRESULT ddRVal;
875 LPDDHALSURFCB_LOCK Lock;
876 DWORD dwFlags;
877 } DDHAL_LOCKDATA;
878
879 typedef struct _DDHAL_UNLOCKDATA {
880 LPDDRAWI_DIRECTDRAW_GBL lpDD;
881 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
882 HRESULT ddRVal;
883 LPDDHALSURFCB_UNLOCK Unlock;
884 } DDHAL_UNLOCKDATA;
885
886 typedef struct _DDHAL_BLTDATA {
887 LPDDRAWI_DIRECTDRAW_GBL lpDD;
888 LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;
889 RECTL rDest;
890 LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface;
891 RECTL rSrc;
892 DWORD dwFlags;
893 DWORD dwROPFlags;
894 DDBLTFX bltFX;
895 HRESULT ddRVal;
896 LPDDHALSURFCB_BLT Blt;
897 BOOL IsClipped;
898 RECTL rOrigDest;
899 RECTL rOrigSrc;
900 DWORD dwRectCnt;
901 LPRECT prDestRects;
902 } DDHAL_BLTDATA;
903
904 typedef struct _DDHAL_SETPALETTEDATA {
905 LPDDRAWI_DIRECTDRAW_GBL lpDD;
906 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
907 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
908 HRESULT ddRVal;
909 LPDDHALSURFCB_SETPALETTE SetPalette;
910 BOOL Attach;
911 } DDHAL_SETPALETTEDATA;
912
913 /* palettes */
914 typedef struct _DDHAL_DESTROYPALETTEDATA {
915 LPDDRAWI_DIRECTDRAW_GBL lpDD;
916 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
917 HRESULT ddRVal;
918 LPDDHALPALCB_DESTROYPALETTE DestroyPalette;
919 } DDHAL_DESTROYPALETTEDATA;
920
921 typedef struct _DDHAL_SETENTRIESDATA {
922 LPDDRAWI_DIRECTDRAW_GBL lpDD;
923 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
924 DWORD dwBase;
925 DWORD dwNumEntries;
926 LPPALETTEENTRY lpEntries;
927 HRESULT ddRVal;
928 LPDDHALPALCB_SETENTRIES SetEntries;
929 } DDHAL_SETENTRIESDATA;
930
931
932 typedef struct _DDHAL_CANCREATEVPORTDATA
933 {
934 LPDDRAWI_DIRECTDRAW_LCL lpDD;
935 LPDDVIDEOPORTDESC lpDDVideoPortDesc;
936 HRESULT ddRVal;
937 LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort;
938 } DDHAL_CANCREATEVPORTDATA;
939
940 typedef struct _DDHAL_CREATEVPORTDATA
941 {
942 LPDDRAWI_DIRECTDRAW_LCL lpDD;
943 LPDDVIDEOPORTDESC lpDDVideoPortDesc;
944 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
945 HRESULT ddRVal;
946 LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort;
947 } DDHAL_CREATEVPORTDATA;
948
949 typedef struct _DDHAL_GETVPORTBANDWIDTHDATA
950 {
951 LPDDRAWI_DIRECTDRAW_LCL lpDD;
952 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
953 LPDDPIXELFORMAT lpddpfFormat;
954 DWORD dwWidth;
955 DWORD dwHeight;
956 DWORD dwFlags;
957 LPDDVIDEOPORTBANDWIDTH lpBandwidth;
958 HRESULT ddRVal;
959 LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth;
960 } DDHAL_GETVPORTBANDWIDTHDATA;
961
962 typedef struct _DDHAL_GETVPORTINPUTFORMATDATA
963 {
964 LPDDRAWI_DIRECTDRAW_LCL lpDD;
965 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
966 DWORD dwFlags;
967 LPDDPIXELFORMAT lpddpfFormat;
968 DWORD dwNumFormats;
969 HRESULT ddRVal;
970 LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats;
971 } DDHAL_GETVPORTINPUTFORMATDATA;
972
973 typedef struct _DDHAL_GETVPORTFIELDDATA
974 {
975 LPDDRAWI_DIRECTDRAW_LCL lpDD;
976 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
977 BOOL bField;
978 HRESULT ddRVal;
979 LPDDHALVPORTCB_GETFIELD GetVideoPortField;
980 } DDHAL_GETVPORTFIELDDATA;
981
982 typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA
983 {
984 LPDDRAWI_DIRECTDRAW_LCL lpDD;
985 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
986 DWORD dwFlags;
987 LPDDPIXELFORMAT lpddpfInputFormat;
988 LPDDPIXELFORMAT lpddpfOutputFormats;
989 DWORD dwNumFormats;
990 HRESULT ddRVal;
991 LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats;
992 } DDHAL_GETVPORTOUTPUTFORMATDATA;
993
994 typedef struct _DDHAL_GETVPORTLINEDATA
995 {
996 LPDDRAWI_DIRECTDRAW_LCL lpDD;
997 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
998 DWORD dwLine;
999 HRESULT ddRVal;
1000 LPDDHALVPORTCB_GETLINE GetVideoPortLine;
1001 } DDHAL_GETVPORTLINEDATA;
1002
1003 typedef struct _DDHAL_DESTROYVPORTDATA
1004 {
1005 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1006 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1007 HRESULT ddRVal;
1008 LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort;
1009 } DDHAL_DESTROYVPORTDATA;
1010
1011 typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA
1012 {
1013 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1014 FLATPTR fpSurface;
1015 HRESULT ddRVal;
1016 LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus;
1017 } DDHAL_GETVPORTFLIPSTATUSDATA;
1018
1019 typedef struct _DDHAL_UPDATEVPORTDATA
1020 {
1021 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1022 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1023 LPDDRAWI_DDRAWSURFACE_INT *lplpDDSurface;
1024 LPDDRAWI_DDRAWSURFACE_INT *lplpDDVBISurface;
1025 LPDDVIDEOPORTINFO lpVideoInfo;
1026 DWORD dwFlags;
1027 DWORD dwNumAutoflip;
1028 DWORD dwNumVBIAutoflip;
1029 HRESULT ddRVal;
1030 LPDDHALVPORTCB_UPDATE UpdateVideoPort;
1031 } DDHAL_UPDATEVPORTDATA;
1032
1033 typedef struct _DDHAL_WAITFORVPORTSYNCDATA
1034 {
1035 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1036 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1037 DWORD dwFlags;
1038 DWORD dwLine;
1039 DWORD dwTimeOut;
1040 HRESULT ddRVal;
1041 LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync;
1042 } DDHAL_WAITFORVPORTSYNCDATA;
1043
1044 typedef struct _DDHAL_GETVPORTSIGNALDATA
1045 {
1046 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1047 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1048 DWORD dwStatus;
1049 HRESULT ddRVal;
1050 LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus;
1051 } DDHAL_GETVPORTSIGNALDATA;
1052
1053 typedef struct _DDHAL_VPORTCOLORDATA
1054 {
1055 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1056 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1057 DWORD dwFlags;
1058 LPDDCOLORCONTROL lpColorData;
1059 HRESULT ddRVal;
1060 LPDDHALVPORTCB_COLORCONTROL ColorControl;
1061 } DDHAL_VPORTCOLORDATA;
1062
1063 typedef struct _DDHAL_FLIPVPORTDATA
1064 {
1065 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1066 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1067 LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr;
1068 LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg;
1069 HRESULT ddRVal;
1070 LPDDHALVPORTCB_FLIP FlipVideoPort;
1071 } DDHAL_FLIPVPORTDATA;
1072
1073 typedef struct _DDHAL_GETVPORTCONNECTDATA
1074 {
1075 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1076 DWORD dwPortId;
1077 LPDDVIDEOPORTCONNECT lpConnect;
1078 DWORD dwNumEntries;
1079 HRESULT ddRVal;
1080 LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo;
1081 } DDHAL_GETVPORTCONNECTDATA;
1082
1083 typedef struct _DDHAL_SYNCSURFACEDATA
1084 {
1085 DWORD dwSize;
1086 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1087 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1088 DWORD dwSurfaceOffset;
1089 ULONG_PTR fpLockPtr;
1090 LONG lPitch;
1091 DWORD dwOverlayOffset;
1092 DWORD dwOverlaySrcWidth;
1093 DWORD dwOverlaySrcHeight;
1094 DWORD dwOverlayDestWidth;
1095 DWORD dwOverlayDestHeight;
1096 ULONG_PTR dwDriverReserved1;
1097 ULONG_PTR dwDriverReserved2;
1098 ULONG_PTR dwDriverReserved3;
1099 HRESULT ddRVal;
1100 } DDHAL_SYNCSURFACEDATA;
1101
1102 typedef struct _DDHAL_SYNCVIDEOPORTDATA
1103 {
1104 DWORD dwSize;
1105 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1106 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1107 DWORD dwOriginOffset;
1108 DWORD dwHeight;
1109 DWORD dwVBIHeight;
1110 ULONG_PTR dwDriverReserved1;
1111 ULONG_PTR dwDriverReserved2;
1112 ULONG_PTR dwDriverReserved3;
1113 HRESULT ddRVal;
1114 } DDHAL_SYNCVIDEOPORTDATA;
1115
1116 typedef struct _DDHAL_DESTROYDDLOCALDATA
1117 {
1118 DWORD dwFlags;
1119 LPDDRAWI_DIRECTDRAW_LCL pDDLcl;
1120 HRESULT ddRVal;
1121 } DDHAL_DESTROYDDLOCALDATA;
1122
1123 typedef struct _DDHAL_CREATESURFACEEXDATA {
1124 DWORD dwFlags;
1125 LPDDRAWI_DIRECTDRAW_LCL lpDDLcl;
1126 LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl;
1127 HRESULT ddRVal;
1128 } DDHAL_CREATESURFACEEXDATA;
1129
1130 typedef struct _DDHAL_GETHEAPALIGNMENTDATA
1131 {
1132 ULONG_PTR dwInstance;
1133 DWORD dwHeap;
1134 HRESULT ddRVal;
1135 LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment;
1136 HEAPALIGNMENT Alignment;
1137 } DDHAL_GETHEAPALIGNMENTDATA;
1138
1139
1140 typedef struct _DDMORESURFACECAPS
1141 {
1142 DWORD dwSize;
1143 DDSCAPSEX ddsCapsMore;
1144 struct tagExtendedHeapRestrictions
1145 {
1146 DDSCAPSEX ddsCapsEx;
1147 DDSCAPSEX ddsCapsExAlt;
1148 } ddsExtendedHeapRestrictions[1];
1149 } DDMORESURFACECAPS, * LPDDMORESURFACECAPS;
1150
1151 typedef struct _DDSTEREOMODE
1152 {
1153 DWORD dwSize;
1154 DWORD dwHeight;
1155 DWORD dwWidth;
1156 DWORD dwBpp;
1157 DWORD dwRefreshRate;
1158 BOOL bSupported;
1159
1160 } DDSTEREOMODE, * LPDDSTEREOMODE;
1161
1162 /*****************************************************************************
1163 * high-level ddraw implementation structures
1164 */
1165 typedef struct _IUNKNOWN_LIST {
1166 struct _IUNKNOWN_LIST * lpLink;
1167 LPGUID lpGuid;
1168
1169 #ifndef _NO_COM
1170 IUnknown * lpIUnknown;
1171 #else
1172 LPVOID lpIUnknown;
1173 #endif /* _NO_COM */
1174 } IUNKNOWN_LIST,*LPIUNKNOWN_LIST;
1175
1176
1177 typedef struct _PROCESS_LIST {
1178 struct _PROCESS_LIST * lpLink;
1179 DWORD dwProcessId;
1180 DWORD dwRefCnt;
1181 DWORD dwAlphaDepth;
1182 DWORD dwZDepth;
1183 } PROCESS_LIST,*LPPROCESS_LIST;
1184
1185 typedef struct _ATTACHLIST {
1186 DWORD dwFlags;
1187 struct _ATTACHLIST * lpLink;
1188 LPDDRAWI_DDRAWSURFACE_LCL lpAttached;
1189 LPDDRAWI_DDRAWSURFACE_INT lpIAttached;
1190 } ATTACHLIST,*LPATTACHLIST;
1191
1192 #define DDAL_IMPLICIT 0x00000001
1193
1194 typedef struct _ACCESSRECTLIST {
1195 struct _ACCESSRECTLIST * lpLink;
1196 RECT rDest;
1197 LPDDRAWI_DIRECTDRAW_LCL lpOwner;
1198 LPVOID lpSurfaceData;
1199 DWORD dwFlags;
1200 LPHEAPALIASINFO lpHeapAliasInfo;
1201 } ACCESSRECTLIST,*LPACCESSRECTLIST;
1202
1203 #define ACCESSRECT_VRAMSTYLE 0x00000001
1204 #define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002
1205 #define ACCESSRECT_BROKEN 0x00000004
1206
1207 typedef struct _DBLNODE {
1208 struct _DBLNODE * next;
1209 struct _DBLNODE * prev;
1210 LPDDRAWI_DDRAWSURFACE_LCL object;
1211 LPDDRAWI_DDRAWSURFACE_INT object_int;
1212 } DBLNODE,*LPDBLNODE;
1213
1214 typedef struct _DDRAWI_DIRECTDRAW_INT {
1215 LPVOID lpVtbl;
1216 LPDDRAWI_DIRECTDRAW_LCL lpLcl;
1217 LPDDRAWI_DIRECTDRAW_INT lpLink;
1218 DWORD dwIntRefCnt;
1219 } DDRAWI_DIRECTDRAW_INT;
1220
1221
1222 typedef struct _DDRAWI_DIRECTDRAW_LCL {
1223 DWORD lpDDMore;
1224 LPDDRAWI_DIRECTDRAW_GBL lpGbl;
1225 DWORD dwUnused0;
1226 DWORD dwLocalFlags;
1227 DWORD dwLocalRefCnt;
1228 DWORD dwProcessId;
1229 #ifndef _NO_COM
1230 IUnknown * pUnkOuter;
1231 #else
1232 PVOID pUnkOuter;
1233 #endif
1234 DWORD dwObsolete1;
1235 ULONG_PTR hWnd;
1236 ULONG_PTR hDC;
1237 DWORD dwErrorMode;
1238 LPDDRAWI_DDRAWSURFACE_INT lpPrimary;
1239 LPDDRAWI_DDRAWSURFACE_INT lpCB;
1240 DWORD dwPreferredMode;
1241 /* DirectX 2 */
1242 HINSTANCE hD3DInstance;
1243 #ifndef _NO_COM
1244 IUnknown * pD3DIUnknown;
1245 #else
1246 PVOID pD3DIUnknown;
1247 #endif
1248 LPDDHAL_CALLBACKS lpDDCB;
1249 ULONG_PTR hDDVxd;
1250 /* DirectX 5.0 */
1251 DWORD dwAppHackFlags;
1252 /* DirectX 5.0A */
1253 ULONG_PTR hFocusWnd;
1254 DWORD dwHotTracking;
1255 DWORD dwIMEState;
1256 /* DirectX 6.0 */
1257 ULONG_PTR hWndPopup;
1258 ULONG_PTR hDD;
1259 ULONG_PTR hGammaCalibrator;
1260 LPDDGAMMACALIBRATORPROC lpGammaCalibrator;
1261 } DDRAWI_DIRECTDRAW_LCL;
1262
1263
1264 #define DDRAWILCL_HASEXCLUSIVEMODE 0x00000001
1265 #define DDRAWILCL_ISFULLSCREEN 0x00000002
1266 #define DDRAWILCL_SETCOOPCALLED 0x00000004
1267 #define DDRAWILCL_ACTIVEYES 0x00000008
1268 #define DDRAWILCL_ACTIVENO 0x00000010
1269 #define DDRAWILCL_HOOKEDHWND 0x00000020
1270 #define DDRAWILCL_ALLOWMODEX 0x00000040
1271 #define DDRAWILCL_V1SCLBEHAVIOUR 0x00000080
1272 #define DDRAWILCL_MODEHASBEENCHANGED 0x00000100
1273 #define DDRAWILCL_CREATEDWINDOW 0x00000200
1274 #define DDRAWILCL_DIRTYDC 0x00000400
1275 #define DDRAWILCL_DISABLEINACTIVATE 0x00000800
1276 #define DDRAWILCL_CURSORCLIPPED 0x00001000
1277 #define DDRAWILCL_EXPLICITMONITOR 0x00002000
1278 #define DDRAWILCL_MULTITHREADED 0x00004000
1279 #define DDRAWILCL_FPUSETUP 0x00008000
1280 #define DDRAWILCL_POWEREDDOWN 0x00010000
1281 #define DDRAWILCL_DIRECTDRAW7 0x00020000
1282 #define DDRAWILCL_ATTEMPTEDD3DCONTEXT 0x00040000
1283 #define DDRAWILCL_FPUPRESERVE 0x00080000
1284 #define DDRAWILCL_DX8DRIVER 0x00100000
1285 #define DDRAWILCL_DIRECTDRAW8 0x00200000
1286
1287
1288 typedef struct _DDRAWI_DIRECTDRAW_GBL {
1289 DWORD dwRefCnt;
1290 DWORD dwFlags;
1291 FLATPTR fpPrimaryOrig;
1292 DDCORECAPS ddCaps;
1293 DWORD dwInternal1;
1294 DWORD dwUnused1[9];
1295 LPDDHAL_CALLBACKS lpDDCBtmp;
1296 LPDDRAWI_DDRAWSURFACE_INT dsList;
1297 LPDDRAWI_DDRAWPALETTE_INT palList;
1298 LPDDRAWI_DDRAWCLIPPER_INT clipperList;
1299 LPDDRAWI_DIRECTDRAW_GBL lp16DD;
1300 DWORD dwMaxOverlays;
1301 DWORD dwCurrOverlays;
1302 DWORD dwMonitorFrequency;
1303 DDCORECAPS ddHELCaps;
1304 DWORD dwUnused2[50];
1305 DDCOLORKEY ddckCKDestOverlay;
1306 DDCOLORKEY ddckCKSrcOverlay;
1307 VIDMEMINFO vmiData;
1308 LPVOID lpDriverHandle;
1309 LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner;
1310 DWORD dwModeIndex;
1311 DWORD dwModeIndexOrig;
1312 DWORD dwNumFourCC;
1313 LPDWORD lpdwFourCC;
1314 DWORD dwNumModes;
1315 LPDDHALMODEINFO lpModeInfo;
1316 PROCESS_LIST plProcessList;
1317 DWORD dwSurfaceLockCount;
1318 DWORD dwAliasedLockCnt;
1319 ULONG_PTR dwReserved3;
1320 ULONG_PTR hDD;
1321 char cObsolete[12];
1322 DWORD dwReserved1;
1323 DWORD dwReserved2;
1324 DBLNODE dbnOverlayRoot;
1325 volatile LPWORD lpwPDeviceFlags;
1326 DWORD dwPDevice;
1327 DWORD dwWin16LockCnt;
1328 DWORD dwUnused3;
1329 DWORD hInstance;
1330 DWORD dwEvent16;
1331 DWORD dwSaveNumModes;
1332 /* DirectX 2 */
1333 ULONG_PTR lpD3DGlobalDriverData;
1334 ULONG_PTR lpD3DHALCallbacks;
1335 DDCORECAPS ddBothCaps;
1336 /* DirectX 5.0 */
1337 LPDDVIDEOPORTCAPS lpDDVideoPortCaps;
1338 LPDDRAWI_DDVIDEOPORT_INT dvpList;
1339 ULONG_PTR lpD3DHALCallbacks2;
1340 RECT rectDevice;
1341 DWORD cMonitors;
1342 LPVOID gpbmiSrc;
1343 LPVOID gpbmiDest;
1344 LPHEAPALIASINFO phaiHeapAliases;
1345 ULONG_PTR hKernelHandle;
1346 ULONG_PTR pfnNotifyProc;
1347 LPDDKERNELCAPS lpDDKernelCaps;
1348 LPDDNONLOCALVIDMEMCAPS lpddNLVCaps;
1349 LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps;
1350 LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps;
1351 ULONG_PTR lpD3DExtendedCaps;
1352 /* DirectX 5.0A */
1353 DWORD dwDOSBoxEvent;
1354 RECT rectDesktop;
1355 char cDriverName[MAX_DRIVER_NAME];
1356 /* DirectX 6.0 */
1357 ULONG_PTR lpD3DHALCallbacks3;
1358 DWORD dwNumZPixelFormats;
1359 LPDDPIXELFORMAT lpZPixelFormats;
1360 LPDDRAWI_DDMOTIONCOMP_INT mcList;
1361 DWORD hDDVxd;
1362 DDSCAPSEX ddsCapsMore;
1363 } DDRAWI_DIRECTDRAW_GBL;
1364
1365 #define DDRAWI_xxxxxxxxx1 0x00000001
1366 #define DDRAWI_xxxxxxxxx2 0x00000002
1367 #define DDRAWI_VIRTUALDESKTOP 0x00000008
1368 #define DDRAWI_MODEX 0x00000010
1369 #define DDRAWI_DISPLAYDRV 0x00000020
1370 #define DDRAWI_FULLSCREEN 0x00000040
1371 #define DDRAWI_MODECHANGED 0x00000080
1372 #define DDRAWI_NOHARDWARE 0x00000100
1373 #define DDRAWI_PALETTEINIT 0x00000200
1374 #define DDRAWI_NOEMULATION 0x00000400
1375 #define DDRAWI_HASCKEYDESTOVERLAY 0x00000800
1376 #define DDRAWI_HASCKEYSRCOVERLAY 0x00001000
1377 #define DDRAWI_HASGDIPALETTE 0x00002000
1378 #define DDRAWI_EMULATIONINITIALIZED 0x00004000
1379 #define DDRAWI_HASGDIPALETTE_EXCLUSIVE 0x00008000
1380 #define DDRAWI_MODEXILLEGAL 0x00010000
1381 #define DDRAWI_FLIPPEDTOGDI 0x00020000
1382 #define DDRAWI_NEEDSWIN16FORVRAMLOCK 0x00040000
1383 #define DDRAWI_PDEVICEVRAMBITCLEARED 0x00080000
1384 #define DDRAWI_STANDARDVGA 0x00100000
1385 #define DDRAWI_EXTENDEDALIGNMENT 0x00200000
1386 #define DDRAWI_CHANGINGMODE 0x00400000
1387 #define DDRAWI_GDIDRV 0x00800000
1388 #define DDRAWI_ATTACHEDTODESKTOP 0x01000000
1389 #define DDRAWI_UMODELOADED 0x02000000
1390 #define DDRAWI_DDRAWDATANOTFETCHED 0x04000000
1391 #define DDRAWI_SECONDARYDRIVERLOADED 0x08000000
1392 #define DDRAWI_TESTINGMODES 0x10000000
1393 #define DDRAWI_DRIVERINFO2 0x20000000
1394 #define DDRAWI_BADPDEV 0x40000000
1395
1396
1397 /* surfaces */
1398 typedef struct _DDRAWI_DDRAWSURFACE_INT {
1399 LPVOID lpVtbl;
1400 LPDDRAWI_DDRAWSURFACE_LCL lpLcl;
1401 LPDDRAWI_DDRAWSURFACE_INT lpLink;
1402 DWORD dwIntRefCnt;
1403 } DDRAWI_DDRAWSURFACE_INT;
1404
1405 typedef struct _DDRAWI_DDRAWSURFACE_GBL {
1406 DWORD dwRefCnt;
1407 DWORD dwGlobalFlags;
1408 union {
1409 LPACCESSRECTLIST lpRectList;
1410 DWORD dwBlockSizeY;
1411 LONG lSlicePitch;
1412 };
1413 union {
1414 LPVMEMHEAP lpVidMemHeap;
1415 DWORD dwBlockSizeX;
1416 };
1417 union {
1418 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1419 LPVOID lpDDHandle;
1420 };
1421 FLATPTR fpVidMem;
1422 union {
1423 LONG lPitch;
1424 DWORD dwLinearSize;
1425 };
1426 WORD wHeight;
1427 WORD wWidth;
1428 DWORD dwUsageCount;
1429 ULONG_PTR dwReserved1;
1430 DDPIXELFORMAT ddpfSurface;
1431 } DDRAWI_DDRAWSURFACE_GBL;
1432
1433 #define DDRAWISURFGBL_MEMFREE 0x00000001L
1434 #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002L
1435 #define DDRAWISURFGBL_ISGDISURFACE 0x00000004L
1436 #define DDRAWISURFGBL_SOFTWAREAUTOFLIP 0x00000008L
1437 #define DDRAWISURFGBL_LOCKNOTHOLDINGWIN16LOCK 0x00000010L
1438 #define DDRAWISURFGBL_LOCKVRAMSTYLE 0x00000020L
1439 #define DDRAWISURFGBL_LOCKBROKEN 0x00000040L
1440 #define DDRAWISURFGBL_IMPLICITHANDLE 0x00000080L
1441 #define DDRAWISURFGBL_ISCLIENTMEM 0x00000100L
1442 #define DDRAWISURFGBL_HARDWAREOPSOURCE 0x00000200L
1443 #define DDRAWISURFGBL_HARDWAREOPDEST 0x00000400L
1444 #define DDRAWISURFGBL_HARDWAREOPSTARTED (DDRAWISURFGBL_HARDWAREOPSOURCE|DDRAWISURFGBL_HARDWAREOPDEST)
1445 #define DDRAWISURFGBL_VPORTINTERLEAVED 0x00000800L
1446 #define DDRAWISURFGBL_VPORTDATA 0x00001000L
1447 #define DDRAWISURFGBL_LATEALLOCATELINEAR 0x00002000L
1448 #define DDRAWISURFGBL_SYSMEMEXECUTEBUFFER 0x00004000L
1449 #define DDRAWISURFGBL_FASTLOCKHELD 0x00008000L
1450 #define DDRAWISURFGBL_READONLYLOCKHELD 0x00010000L
1451 #define DDRAWISURFGBL_DX8SURFACE 0x00080000L
1452 #define DDRAWISURFGBL_DDHELDONTFREE 0x00100000L
1453 #define DDRAWISURFGBL_NOTIFYWHENUNLOCKED 0x00200000L
1454 #define DDRAWISURFGBL_RESERVED0 0x80000000L // Reserved flag
1455
1456 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE {
1457 DWORD dwSize;
1458 union {
1459 DWORD dwPhysicalPageTable;
1460 FLATPTR fpPhysicalVidMem;
1461 };
1462 LPDWORD pPageTable;
1463 DWORD cPages;
1464 ULONG_PTR dwSavedDCContext;
1465 FLATPTR fpAliasedVidMem;
1466 ULONG_PTR dwDriverReserved;
1467 ULONG_PTR dwHELReserved;
1468 DWORD cPageUnlocks;
1469 ULONG_PTR hKernelSurface;
1470 DWORD dwKernelRefCnt;
1471 LPDDCOLORCONTROL lpColorInfo;
1472 FLATPTR fpNTAlias;
1473 DWORD dwContentsStamp;
1474 LPVOID lpvUnswappedDriverReserved;
1475 LPVOID lpDDRAWReserved2;
1476 DWORD dwDDRAWReserved1;
1477 DWORD dwDDRAWReserved2;
1478 FLATPTR fpAliasOfVidMem;
1479 } DDRAWI_DDRAWSURFACE_GBL_MORE;
1480
1481 /* the MS version of this macro was somewhat obfuscated and unreadable
1482 * (possibly because of mediocre MS coders)... so I simplified it...
1483 * (and so I commit no copyright violations either, hah) */
1484 #define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \
1485 (*(((LPDDRAWI_DDRAWSURFACE_GBL_MORE *)(psurf_gbl)) - 1))
1486
1487 #define SURFACE_PHYSICALVIDMEM( psurf_gbl ) \
1488 ( GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl )->fpPhysicalVidMem )
1489
1490
1491 typedef struct _DISPLAYMODEINFO
1492 {
1493 WORD wWidth;
1494 WORD wHeight;
1495 BYTE wBPP;
1496 BYTE wMonitorsAttachedToDesktop;
1497 WORD wRefreshRate;
1498 } DISPLAYMODEINFO, *LPDISPLAYMODEINFO;
1499
1500 #define EQUAL_DISPLAYMODE ( A, B ) (0 == memcmp(&(A), &(B), sizeof (DISPLAYMODEINFO)))
1501
1502
1503
1504
1505 typedef struct _DDRAWI_DDRAWSURFACE_MORE {
1506 DWORD dwSize;
1507 IUNKNOWN_LIST * lpIUnknowns;
1508 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
1509 DWORD dwPageLockCount;
1510 DWORD dwBytesAllocated;
1511 LPDDRAWI_DIRECTDRAW_INT lpDD_int;
1512 DWORD dwMipMapCount;
1513 LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper;
1514 /* DirectX 5.0 */
1515 LPHEAPALIASINFO lpHeapAliasInfo;
1516 DWORD dwOverlayFlags;
1517 VOID *rgjunc;
1518 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
1519 LPDDOVERLAYFX lpddOverlayFX;
1520 DDSCAPSEX ddsCapsEx;
1521 DWORD dwTextureStage;
1522 LPVOID lpDDRAWReserved;
1523 LPVOID lpDDRAWReserved2;
1524 LPVOID lpDDrawReserved3;
1525 DWORD dwDDrawReserved4;
1526 LPVOID lpDDrawReserved5;
1527 LPDWORD lpGammaRamp;
1528 LPDWORD lpOriginalGammaRamp;
1529 LPVOID lpDDrawReserved6;
1530 #ifndef WIN95
1531 DISPLAYMODEINFO dmiDDrawReserved7;
1532 #endif
1533 DWORD dwSurfaceHandle;
1534 DWORD qwDDrawReserved8[2];
1535 LPVOID lpDDrawReserved9;
1536 DWORD cSurfaces;
1537 LPDDSURFACEDESC2 pCreatedDDSurfaceDesc2;
1538 LPDDRAWI_DDRAWSURFACE_LCL *slist;
1539 DWORD dwFVF;
1540 LPVOID lpVB;
1541 } DDRAWI_DDRAWSURFACE_MORE;
1542
1543
1544
1545 typedef struct _DDRAWI_DDRAWSURFACE_LCL {
1546 LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore;
1547 LPDDRAWI_DDRAWSURFACE_GBL lpGbl;
1548 ULONG_PTR hDDSurface;
1549 LPATTACHLIST lpAttachList;
1550 LPATTACHLIST lpAttachListFrom;
1551 DWORD dwLocalRefCnt;
1552 DWORD dwProcessId;
1553 DWORD dwFlags;
1554 DDSCAPS ddsCaps;
1555 union
1556 {
1557 LPDDRAWI_DDRAWPALETTE_INT lpDDPalette;
1558 LPDDRAWI_DDRAWPALETTE_INT lp16DDPalette;
1559 };
1560 union
1561 {
1562 LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper;
1563 LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper;
1564 };
1565 DWORD dwModeCreatedIn;
1566 DWORD dwBackBufferCount;
1567 DDCOLORKEY ddckCKDestBlt;
1568 DDCOLORKEY ddckCKSrcBlt;
1569 ULONG_PTR hDC;
1570 ULONG_PTR dwReserved1;
1571 DDCOLORKEY ddckCKSrcOverlay;
1572 DDCOLORKEY ddckCKDestOverlay;
1573 LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying;
1574 DBLNODE dbnOverlayNode;
1575 RECT rcOverlaySrc;
1576 RECT rcOverlayDest;
1577 DWORD dwClrXparent;
1578 DWORD dwAlpha;
1579 LONG lOverlayX;
1580 LONG lOverlayY;
1581 } DDRAWI_DDRAWSURFACE_LCL;
1582
1583 #define DDRAWISURF_ATTACHED 0x00000001L
1584 #define DDRAWISURF_IMPLICITCREATE 0x00000002L
1585 #define DDRAWISURF_ISFREE 0x00000004L
1586 #define DDRAWISURF_ATTACHED_FROM 0x00000008L
1587 #define DDRAWISURF_IMPLICITROOT 0x00000010L
1588 #define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020L
1589 #define DDRAWISURF_DATAISALIASED 0x00000040L
1590 #define DDRAWISURF_HASDC 0x00000080L
1591 #define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100L
1592 #define DDRAWISURF_HASCKEYDESTBLT 0x00000200L
1593 #define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400L
1594 #define DDRAWISURF_HASCKEYSRCBLT 0x00000800L
1595 #define DDRAWISURF_LOCKEXCLUDEDCURSOR 0x00001000L
1596 #define DDRAWISURF_HASPIXELFORMAT 0x00002000L
1597 #define DDRAWISURF_HASOVERLAYDATA 0x00004000L
1598 #define DDRAWISURF_SETGAMMA 0x00008000L
1599 #define DDRAWISURF_SW_CKEYDESTOVERLAY 0x00010000L
1600 #define DDRAWISURF_SW_CKEYDESTBLT 0x00020000L
1601 #define DDRAWISURF_SW_CKEYSRCOVERLAY 0x00040000L
1602 #define DDRAWISURF_SW_CKEYSRCBLT 0x00080000L
1603 #define DDRAWISURF_HW_CKEYDESTOVERLAY 0x00100000L
1604 #define DDRAWISURF_HW_CKEYDESTBLT 0x00200000L
1605 #define DDRAWISURF_HW_CKEYSRCOVERLAY 0x00400000L
1606 #define DDRAWISURF_HW_CKEYSRCBLT 0x00800000L
1607 #define DDRAWISURF_INMASTERSPRITELIST 0x01000000L
1608 #define DDRAWISURF_HELCB 0x02000000L
1609 #define DDRAWISURF_FRONTBUFFER 0x04000000L
1610 #define DDRAWISURF_BACKBUFFER 0x08000000L
1611 #define DDRAWISURF_INVALID 0x10000000L
1612 #define DDRAWISURF_DCIBUSY 0x20000000L
1613 #define DDRAWISURF_GETDCNULL 0x40000000L
1614 #define DDRAWISURF_STEREOSURFACELEFT 0x20000000L
1615 #define DDRAWISURF_DRIVERMANAGED 0x40000000L
1616 #define DDRAWISURF_DCILOCK 0x80000000L
1617
1618 /* palettes */
1619 typedef struct _DDRAWI_DDRAWPALETTE_INT {
1620 LPVOID lpVtbl;
1621 LPDDRAWI_DDRAWPALETTE_LCL lpLcl;
1622 LPDDRAWI_DDRAWPALETTE_INT lpLink;
1623 DWORD dwIntRefCnt;
1624 } DDRAWI_DDRAWPALETTE_INT;
1625
1626 typedef struct _DDRAWI_DDRAWPALETTE_GBL {
1627 DWORD dwRefCnt;
1628 DWORD dwFlags;
1629 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
1630 DWORD dwProcessId;
1631 LPPALETTEENTRY lpColorTable;
1632 union {
1633 ULONG_PTR dwReserved1;
1634 HPALETTE hHELGDIPalette;
1635 };
1636 DWORD dwDriverReserved;
1637 DWORD dwContentsStamp;
1638 DWORD dwSaveStamp;
1639 DWORD dwHandle;
1640 } DDRAWI_DDRAWPALETTE_GBL;
1641
1642 #define DDRAWIPAL_256 0x00000001
1643 #define DDRAWIPAL_16 0x00000002
1644 #define DDRAWIPAL_GDI 0x00000004
1645 #define DDRAWIPAL_STORED_8 0x00000008
1646 #define DDRAWIPAL_STORED_16 0x00000010
1647 #define DDRAWIPAL_STORED_24 0x00000020
1648 #define DDRAWIPAL_EXCLUSIVE 0x00000040
1649 #define DDRAWIPAL_INHEL 0x00000080
1650 #define DDRAWIPAL_DIRTY 0x00000100
1651 #define DDRAWIPAL_ALLOW256 0x00000200
1652 #define DDRAWIPAL_4 0x00000400
1653 #define DDRAWIPAL_2 0x00000800
1654 #define DDRAWIPAL_STORED_8INDEX 0x00001000
1655 #define DDRAWIPAL_ALPHA 0x00002000
1656
1657 #define D3DFORMAT_OP_TEXTURE 0x00000001L
1658 #define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L
1659 #define D3DFORMAT_OP_CUBETEXTURE 0x00000004L
1660 #define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L
1661 #define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L
1662 #define D3DFORMAT_OP_ZSTENCIL 0x00000040L
1663 #define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L
1664 #define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L
1665 #define D3DFORMAT_OP_DISPLAYMODE 0x00000400L
1666 #define D3DFORMAT_OP_3DACCELERATION 0x00000800L
1667 #define D3DFORMAT_OP_PIXELSIZE 0x00001000L
1668 #define D3DFORMAT_OP_CONVERT_TO_ARGB 0x00002000L
1669 #define D3DFORMAT_OP_OFFSCREENPLAIN 0x00004000L
1670 #define D3DFORMAT_OP_SRGBREAD 0x00008000L
1671 #define D3DFORMAT_OP_BUMPMAP 0x00010000L
1672 #define D3DFORMAT_OP_NOFILTER 0x00040000L
1673 #define DDPF_D3DFORMAT 0x00200000l
1674 #define DDPF_NOVEL_TEXTURE_FORMAT 0x00100000l
1675 #define D3DFORMAT_MEMBEROFGROUP_ARGB 0x00080000L
1676 #define D3DFORMAT_OP_SRGBWRITE 0x00100000L
1677 #define D3DFORMAT_OP_NOALPHABLEND 0x00200000L
1678 #define D3DFORMAT_OP_AUTOGENMIPMAP 0x00400000L
1679 #define D3DFORMAT_OP_VERTEXTEXTURE 0x00800000L
1680 #define D3DFORMAT_OP_NOTEXCOORDWRAPNORMIP 0x01000000L
1681 #define DELETED_OK 0
1682 #define DELETED_LASTONE 1
1683 #define DELETED_NOTFOUND 2
1684 #define DDCALLBACKSSIZE_V1 ( offsetof( DDHAL_DDCALLBACKS, SetExclusiveMode ) )
1685 #define DDCALLBACKSSIZE sizeof( DDHAL_DDCALLBACKS )
1686 #define DDRAWICLIP_WATCHWINDOW 0x00000001
1687 #define DDRAWICLIP_ISINITIALIZED 0x00000002
1688 #define DDRAWICLIP_INMASTERSPRITELIST 0x00000004
1689 #define PFINDEX_UNINITIALIZED (0UL)
1690 #define PFINDEX_UNSUPPORTED (~0UL)
1691 #ifndef __DD_INCLUDED__
1692 #define ROP_HAS_SOURCE 0x00000001
1693 #define ROP_HAS_PATTERN 0x00000002
1694 #define ROP_HAS_SOURCEPATTERN ROP_HAS_PATTERN | ROP_HAS_SOURCE
1695 #endif
1696 #define DDRAWIVPORT_ON 0x00000001
1697 #define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002
1698 #define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004
1699 #define DDRAWIVPORT_NOKERNELHANDLES 0x00000008
1700 #define DDRAWIVPORT_SOFTWARE_BOB 0x00000010
1701 #define DDRAWIVPORT_VBION 0x00000020
1702 #define DDRAWIVPORT_VIDEOON 0x00000040
1703 #define DDRAWI_GETCOLOR 0x0001
1704 #define DDRAWI_SETCOLOR 0x0002
1705 #define DDMCQUERY_READ 0x00000001
1706 #define DDWAITVB_I_TESTVB 0x80000006
1707
1708
1709 #define DDBLT_ANYALPHA \
1710 (DDBLT_ALPHASRCSURFACEOVERRIDE | DDBLT_ALPHASRCCONSTOVERRIDE | \
1711 DDBLT_ALPHASRC | DDBLT_ALPHADESTSURFACEOVERRIDE | \
1712 DDBLT_ALPHADESTCONSTOVERRIDE | DDBLT_ALPHADEST)
1713
1714 #define DDHAL_ALIGNVALIDCAPS (DDSCAPS_OFFSCREENPLAIN | DDSCAPS_EXECUTEBUFFER | \
1715 DDSCAPS_OVERLAY | DDSCAPS_TEXTURE | \
1716 DDSCAPS_ZBUFFER | DDSCAPS_ALPHA | DDSCAPS_FLIP )
1717
1718
1719 #define DDHALINFOSIZE_V2 sizeof(DDHALINFO)
1720
1721 #define DDOVER_ANYALPHA \
1722 (DDOVER_ALPHASRCSURFACEOVERRIDE | DDOVER_ALPHASRCCONSTOVERRIDE | \
1723 DDOVER_ALPHASRC | DDOVER_ALPHADESTSURFACEOVERRIDE | \
1724 DDOVER_ALPHADESTCONSTOVERRIDE | DDOVER_ALPHADEST)
1725
1726
1727 typedef struct _DDRAWI_DDRAWPALETTE_LCL {
1728 DWORD lpPalMore;
1729 LPDDRAWI_DDRAWPALETTE_GBL lpGbl;
1730 ULONG_PTR dwUnused0;
1731 DWORD dwLocalRefCnt;
1732 #ifndef _NO_COM
1733 IUnknown * pUnkOuter;
1734 #else
1735 PVOID pUnkOuter;
1736 #endif
1737 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
1738 ULONG_PTR dwReserved1;
1739 /* DirectX 6.0 */
1740 ULONG_PTR dwDDRAWReserved1;
1741 ULONG_PTR dwDDRAWReserved2;
1742 ULONG_PTR dwDDRAWReserved3;
1743 } DDRAWI_DDRAWPALETTE_LCL;
1744
1745
1746 typedef struct _DDMCCOMPBUFFERINFO
1747 {
1748 DWORD dwSize;
1749 DWORD dwNumCompBuffers;
1750 DWORD dwWidthToCreate;
1751 DWORD dwHeightToCreate;
1752 DWORD dwBytesToAllocate;
1753 DDSCAPS2 ddCompCaps;
1754 DDPIXELFORMAT ddPixelFormat;
1755 } DDMCCOMPBUFFERINFO, *LPDDMCCOMPBUFFERINFO;
1756
1757 typedef struct _DDMCBUFFERINFO
1758 {
1759 DWORD dwSize;
1760 LPDDRAWI_DDRAWSURFACE_LCL lpCompSurface;
1761 DWORD dwDataOffset;
1762 DWORD dwDataSize;
1763 LPVOID lpPrivate;
1764 } DDMCBUFFERINFO, *LPDDMCBUFFERINFO;
1765
1766 typedef struct _DDHAL_GETDRIVERSTATEDATA {
1767 DWORD dwFlags;
1768 union
1769 {
1770 ULONG_PTR dwhContext;
1771 };
1772 LPDWORD lpdwStates;
1773 DWORD dwLength;
1774 HRESULT ddRVal;
1775 } DDHAL_GETDRIVERSTATEDATA;
1776
1777 typedef struct _DDHAL_ADDATTACHEDSURFACEDATA
1778 {
1779 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1780 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1781 LPDDRAWI_DDRAWSURFACE_LCL lpSurfAttached;
1782 HRESULT ddRVal;
1783 LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
1784 } DDHAL_ADDATTACHEDSURFACEDATA;
1785
1786
1787
1788 typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA
1789 {
1790 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1791 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1792 LPDDRAWI_DDRAWSURFACE_LCL lpDestSurface;
1793 DWORD dwInputDataSize;
1794 LPVOID lpInputData;
1795 DWORD dwOutputDataSize;
1796 LPVOID lpOutputData;
1797 HRESULT ddRVal;
1798 LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame;
1799 } DDHAL_BEGINMOCOMPFRAMEDATA;
1800
1801 typedef struct _DDHAL_COLORCONTROLDATA
1802 {
1803 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1804 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1805 LPDDCOLORCONTROL lpColorData;
1806 DWORD dwFlags;
1807 HRESULT ddRVal;
1808 LPDDHALCOLORCB_COLORCONTROL ColorControl;
1809 } DDHAL_COLORCONTROLDATA;
1810
1811 typedef struct _DDHAL_CREATEMOCOMPDATA
1812 {
1813 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1814 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1815 LPGUID lpGuid;
1816 DWORD dwUncompWidth;
1817 DWORD dwUncompHeight;
1818 DDPIXELFORMAT ddUncompPixelFormat;
1819 LPVOID lpData;
1820 DWORD dwDataSize;
1821 HRESULT ddRVal;
1822 LPDDHALMOCOMPCB_CREATE CreateMoComp;
1823 } DDHAL_CREATEMOCOMPDATA;
1824
1825 typedef struct _DDHAL_DESTROYMOCOMPDATA
1826 {
1827 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1828 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1829 HRESULT ddRVal;
1830 LPDDHALMOCOMPCB_DESTROY DestroyMoComp;
1831 } DDHAL_DESTROYMOCOMPDATA;
1832
1833 typedef struct _DDHAL_ENDMOCOMPFRAMEDATA
1834 {
1835 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1836 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1837 LPVOID lpInputData;
1838 DWORD dwInputDataSize;
1839 HRESULT ddRVal;
1840 LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame;
1841 } DDHAL_ENDMOCOMPFRAMEDATA;
1842
1843 typedef struct _DDHAL_FLIPTOGDISURFACEDATA
1844 {
1845 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1846 DWORD dwToGDI;
1847 DWORD dwReserved;
1848 HRESULT ddRVal;
1849 LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
1850 } DDHAL_FLIPTOGDISURFACEDATA;
1851
1852 typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA
1853 {
1854 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1855 DDSCAPS DDSCaps;
1856 DWORD dwTotal;
1857 DWORD dwFree;
1858 HRESULT ddRVal;
1859 LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory;
1860 DDSCAPSEX ddsCapsEx;
1861
1862 } DDHAL_GETAVAILDRIVERMEMORYDATA;
1863
1864 typedef struct _DDHAL_GETBLTSTATUSDATA
1865 {
1866 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1867 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1868 DWORD dwFlags;
1869 HRESULT ddRVal;
1870 LPDDHALSURFCB_GETBLTSTATUS GetBltStatus;
1871 } DDHAL_GETBLTSTATUSDATA;
1872
1873 typedef struct _DDHAL_GETFLIPSTATUSDATA
1874 {
1875 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1876 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1877 DWORD dwFlags;
1878 HRESULT ddRVal;
1879 LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus;
1880 } DDHAL_GETFLIPSTATUSDATA;
1881
1882 typedef struct _DDHAL_GETINTERNALMOCOMPDATA
1883 {
1884 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1885 LPGUID lpGuid;
1886 DWORD dwWidth;
1887 DWORD dwHeight;
1888 DDPIXELFORMAT ddPixelFormat;
1889 DWORD dwScratchMemAlloc;
1890 HRESULT ddRVal;
1891 LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
1892 } DDHAL_GETINTERNALMOCOMPDATA;
1893
1894 typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA
1895 {
1896 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1897 LPGUID lpGuid;
1898 DWORD dwWidth;
1899 DWORD dwHeight;
1900 DDPIXELFORMAT ddPixelFormat;
1901 DWORD dwNumTypesCompBuffs;
1902 LPDDMCCOMPBUFFERINFO lpCompBuffInfo;
1903 HRESULT ddRVal;
1904 LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
1905 } DDHAL_GETMOCOMPCOMPBUFFDATA;
1906
1907 typedef struct _DDHAL_GETMOCOMPGUIDSDATA
1908 {
1909 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1910 DWORD dwNumGuids;
1911 LPGUID lpGuids;
1912 HRESULT ddRVal;
1913 LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids;
1914 } DDHAL_GETMOCOMPGUIDSDATA;
1915
1916 typedef struct _DDHAL_GETMOCOMPFORMATSDATA
1917 {
1918 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1919 LPGUID lpGuid;
1920 DWORD dwNumFormats;
1921 LPDDPIXELFORMAT lpFormats;
1922 HRESULT ddRVal;
1923 LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats;
1924 } DDHAL_GETMOCOMPFORMATSDATA;
1925
1926 typedef struct _DDHAL_GETSCANLINEDATA
1927 {
1928 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1929 DWORD dwScanLine;
1930 HRESULT ddRVal;
1931 LPDDHAL_GETSCANLINE GetScanLine;
1932 } DDHAL_GETSCANLINEDATA;
1933
1934 typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA
1935 {
1936 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1937 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1938 LPDDRAWI_DDRAWSURFACE_LCL lpSurface;
1939 DWORD dwFlags;
1940 HRESULT ddRVal;
1941 LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus;
1942 } DDHAL_QUERYMOCOMPSTATUSDATA;
1943
1944 typedef struct _DDHAL_RENDERMOCOMPDATA
1945 {
1946 LPDDRAWI_DIRECTDRAW_LCL lpDD;
1947 LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
1948 DWORD dwNumBuffers;
1949 LPDDMCBUFFERINFO lpBufferInfo;
1950 DWORD dwFunction;
1951 LPVOID lpInputData;
1952 DWORD dwInputDataSize;
1953 LPVOID lpOutputData;
1954 DWORD dwOutputDataSize;
1955 HRESULT ddRVal;
1956 LPDDHALMOCOMPCB_RENDER RenderMoComp;
1957 } DDHAL_RENDERMOCOMPDATA;
1958
1959 typedef struct _DDHAL_SETCOLORKEYDATA
1960 {
1961 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1962 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
1963 DWORD dwFlags;
1964 DDCOLORKEY ckNew;
1965 HRESULT ddRVal;
1966 LPDDHALSURFCB_SETCOLORKEY SetColorKey;
1967 } DDHAL_SETCOLORKEYDATA;
1968
1969 typedef struct _DDHAL_SETOVERLAYPOSITIONDATA
1970 {
1971 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1972 LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface;
1973 LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;
1974 LONG lXPos;
1975 LONG lYPos;
1976 HRESULT ddRVal;
1977 LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition;
1978 } DDHAL_SETOVERLAYPOSITIONDATA;
1979
1980 typedef struct _DDHAL_UPDATEOVERLAYDATA
1981 {
1982 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1983 LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;
1984 RECTL rDest;
1985 LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface;
1986 RECTL rSrc;
1987 DWORD dwFlags;
1988 DDOVERLAYFX overlayFX;
1989 HRESULT ddRVal;
1990 LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay;
1991 } DDHAL_UPDATEOVERLAYDATA;
1992
1993 typedef struct _DDHAL_WAITFORVERTICALBLANKDATA
1994 {
1995 LPDDRAWI_DIRECTDRAW_GBL lpDD;
1996 DWORD dwFlags;
1997 DWORD bIsInVB;
1998 ULONG_PTR hEvent;
1999 HRESULT ddRVal;
2000 LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank;
2001 } DDHAL_WAITFORVERTICALBLANKDATA;
2002
2003 typedef struct _DDHAL_DRVSETCOLORKEYDATA
2004 {
2005 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
2006 DWORD dwFlags;
2007 DDCOLORKEY ckNew;
2008 HRESULT ddRVal;
2009 LPDDHAL_SETCOLORKEY SetColorKey;
2010 } DDHAL_DRVSETCOLORKEYDATA;
2011
2012 typedef struct _DDMONITORINFO
2013 {
2014 WORD Manufacturer;
2015 WORD Product;
2016 DWORD SerialNumber;
2017 GUID DeviceIdentifier;
2018 int Mode640x480;
2019 int Mode800x600;
2020 int Mode1024x768;
2021 int Mode1280x1024;
2022 int Mode1600x1200;
2023 int ModeReserved1;
2024 int ModeReserved2;
2025 int ModeReserved3;
2026 } DDMONITORINFO, FAR *LPDDMONITORINFO;
2027
2028 typedef struct _DDRAWI_DDRAWCLIPPER_INT
2029 {
2030 LPVOID lpVtbl;
2031 LPDDRAWI_DDRAWCLIPPER_LCL lpLcl;
2032 LPDDRAWI_DDRAWCLIPPER_INT lpLink;
2033 DWORD dwIntRefCnt;
2034 } DDRAWI_DDRAWCLIPPER_INT;
2035
2036 typedef struct _DDHAL_UPDATENONLOCALHEAPDATA
2037 {
2038 LPDDRAWI_DIRECTDRAW_GBL lpDD;
2039 DWORD dwHeap;
2040 FLATPTR fpGARTLin;
2041 FLATPTR fpGARTDev;
2042 ULONG_PTR ulPolicyMaxBytes;
2043 HRESULT ddRVal;
2044 LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap;
2045 } DDHAL_UPDATENONLOCALHEAPDATA;
2046
2047 typedef struct _DDHAL_SETCLIPLISTDATA
2048 {
2049 LPDDRAWI_DIRECTDRAW_GBL lpDD;
2050 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
2051 HRESULT ddRVal;
2052 LPDDHALSURFCB_SETCLIPLIST SetClipList;
2053 } DDHAL_SETCLIPLISTDATA;
2054
2055 typedef struct _DDRAWI_DDMOTIONCOMP_LCL
2056 {
2057 LPDDRAWI_DIRECTDRAW_LCL lpDD;
2058 GUID guid;
2059 DWORD dwUncompWidth;
2060 DWORD dwUncompHeight;
2061 DDPIXELFORMAT ddUncompPixelFormat;
2062 DWORD dwInternalFlags;
2063 DWORD dwRefCnt;
2064 DWORD dwProcessId;
2065 HANDLE hMoComp;
2066 DWORD dwDriverReserved1;
2067 DWORD dwDriverReserved2;
2068 DWORD dwDriverReserved3;
2069 LPVOID lpDriverReserved1;
2070 LPVOID lpDriverReserved2;
2071 LPVOID lpDriverReserved3;
2072 } DDRAWI_DDMOTIONCOMP_LCL;
2073
2074 typedef struct _DDRAWI_DDMOTIONCOMP_INT
2075 {
2076 LPVOID lpVtbl;
2077 LPDDRAWI_DDMOTIONCOMP_LCL lpLcl;
2078 LPDDRAWI_DDMOTIONCOMP_INT lpLink;
2079 DWORD dwIntRefCnt;
2080 } DDRAWI_DDMOTIONCOMP_INT;
2081
2082
2083 typedef struct _DDRAWI_DDVIDEOPORT_LCL
2084 {
2085 LPDDRAWI_DIRECTDRAW_LCL lpDD;
2086 DDVIDEOPORTDESC ddvpDesc;
2087 DDVIDEOPORTINFO ddvpInfo;
2088 LPDDRAWI_DDRAWSURFACE_INT lpSurface;
2089 LPDDRAWI_DDRAWSURFACE_INT lpVBISurface;
2090 LPDDRAWI_DDRAWSURFACE_INT *lpFlipInts;
2091 DWORD dwNumAutoflip;
2092 DWORD dwProcessID;
2093 DWORD dwStateFlags;
2094 DWORD dwFlags;
2095 DWORD dwRefCnt;
2096 FLATPTR fpLastFlip;
2097 ULONG_PTR dwReserved1;
2098 ULONG_PTR dwReserved2;
2099 HANDLE hDDVideoPort;
2100 DWORD dwNumVBIAutoflip;
2101 LPDDVIDEOPORTDESC lpVBIDesc;
2102 LPDDVIDEOPORTDESC lpVideoDesc;
2103 LPDDVIDEOPORTINFO lpVBIInfo;
2104 LPDDVIDEOPORTINFO lpVideoInfo;
2105 DWORD dwVBIProcessID;
2106 LPDDRAWI_DDVIDEOPORT_INT lpVPNotify;
2107 } DDRAWI_DDVIDEOPORT_LCL;
2108
2109
2110 typedef struct _DDRAWI_DDVIDEOPORT_INT
2111 {
2112 LPVOID lpVtbl;
2113 LPDDRAWI_DDVIDEOPORT_LCL lpLcl;
2114 LPDDRAWI_DDVIDEOPORT_INT lpLink;
2115 DWORD dwIntRefCnt;
2116 DWORD dwFlags;
2117 } DDRAWI_DDVIDEOPORT_INT;
2118
2119
2120 typedef struct _DDRAWI_DDRAWCLIPPER_LCL
2121 {
2122 DWORD lpClipMore;
2123 LPDDRAWI_DDRAWCLIPPER_GBL lpGbl;
2124 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
2125 DWORD dwLocalRefCnt;
2126 #ifndef _NO_COM
2127 IUnknown *pUnkOuter;
2128 #else
2129 PVOID *pUnkOuter;
2130 #endif
2131 LPDDRAWI_DIRECTDRAW_INT lpDD_int;
2132 ULONG_PTR dwReserved1;
2133 #ifndef _NO_COM
2134 IUnknown * pAddrefedThisOwner;
2135 #else
2136 PVOID pAddrefedThisOwner;
2137 #endif
2138 } DDRAWI_DDRAWCLIPPER_LCL;
2139
2140
2141
2142 typedef struct _DDRAWI_DDRAWCLIPPER_GBL
2143 {
2144 DWORD dwRefCnt;
2145 DWORD dwFlags;
2146 LPDDRAWI_DIRECTDRAW_GBL lpDD;
2147 DWORD dwProcessId;
2148 ULONG_PTR dwReserved1;
2149 ULONG_PTR hWnd;
2150 LPRGNDATA lpStaticClipList;
2151 } DDRAWI_DDRAWCLIPPER_GBL;
2152
2153 typedef BOOL (PASCAL *LPDDHEL_INIT)(LPDDRAWI_DIRECTDRAW_GBL,BOOL);
2154
2155 extern HRESULT DDAPI
2156 LateAllocateSurfaceMem(
2157 LPDIRECTDRAWSURFACE lpSurface,
2158 DWORD dwPleaseAllocType,
2159 DWORD dwWidthInBytesOrSize,
2160 DWORD dwHeight);
2161
2162 LPDIRECTDRAWSURFACE GetNextMipMap(
2163 LPDIRECTDRAWSURFACE lpLevel);
2164
2165
2166
2167 typedef struct IDirectDrawClipperVtbl DIRECTDRAWCLIPPERCALLBACKS;
2168 typedef struct IDirectDrawPaletteVtbl DIRECTDRAWPALETTECALLBACKS;
2169 typedef struct IDirectDrawSurfaceVtbl DIRECTDRAWSURFACECALLBACKS;
2170 typedef struct IDirectDrawSurface2Vtbl DIRECTDRAWSURFACE2CALLBACKS;
2171 typedef struct IDirectDrawSurface3Vtbl DIRECTDRAWSURFACE3CALLBACKS;
2172 typedef struct IDirectDrawSurface4Vtbl DIRECTDRAWSURFACE4CALLBACKS;
2173 typedef struct IDirectDrawSurface7Vtbl DIRECTDRAWSURFACE7CALLBACKS;
2174 typedef struct IDirectDrawColorControlVtbl DIRECTDRAWCOLORCONTROLCALLBACKS;
2175 typedef struct IDirectDrawVtbl DIRECTDRAWCALLBACKS;
2176 typedef struct IDirectDraw2Vtbl DIRECTDRAW2CALLBACKS;
2177 typedef struct IDirectDraw4Vtbl DIRECTDRAW4CALLBACKS;
2178 typedef struct IDirectDraw7Vtbl DIRECTDRAW7CALLBACKS;
2179 typedef struct IDirectDrawKernelVtbl DIRECTDRAWKERNELCALLBACKS;
2180 typedef struct IDirectDrawSurfaceKernelVtbl DIRECTDRAWSURFACEKERNELCALLBACKS;
2181 typedef struct IDirectDrawGammaControlVtbl DIRECTDRAWGAMMACONTROLCALLBACKS;
2182
2183
2184 typedef DIRECTDRAWCLIPPERCALLBACKS *LPDIRECTDRAWCLIPPERCALLBACKS;
2185 typedef DIRECTDRAWPALETTECALLBACKS *LPDIRECTDRAWPALETTECALLBACKS;
2186 typedef DIRECTDRAWSURFACECALLBACKS *LPDIRECTDRAWSURFACECALLBACKS;
2187 typedef DIRECTDRAWCALLBACKS *LPDIRECTDRAWCALLBACKS;
2188
2189
2190 HRESULT CALLBACK
2191 D3DParseUnknownCommand (LPVOID lpvCommands,
2192 LPVOID *lplpvReturnedCommand);
2193
2194 #ifdef __cplusplus
2195 /* extern "C" */
2196 #endif
2197
2198 #endif /* __DDRAWI_INCLUDED__ */