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