Fixed a couple of HWND type mismatches.
[wine/multimedia.git] / include / ddrawi.h
blobedea856d3adabad2390f535f8dd9dfd41ad8e5b8
1 /* DirectDraw driver interface */
2 /* (DirectX 7 version) */
4 #ifndef __WINE_DDRAWI_H
5 #define __WINE_DDRAWI_H
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
11 #include "ddraw.h"
12 #include "dciddi.h" /* the DD HAL is layered onto DCI escapes */
14 typedef struct _DDVIDEOPORTCAPS *LPDDVIDEOPORTCAPS; /* should be in dvp.h */
15 typedef struct _DDKERNELCAPS *LPDDKERNELCAPS; /* should be in ddkernel.h */
16 typedef struct _VMEMHEAP *LPVMEMHEAP; /* should be in dmemmgr.h */
18 #define DDAPI WINAPI
20 /* the DirectDraw versions */
21 #define DD_VERSION 0x0200 /* compatibility version */
22 #define DD_RUNTIME_VERSION 0x0700 /* actual version */
24 /* the HAL version returned from QUERYESCSUPPORT - DCICOMMAND */
25 #define DD_HAL_VERSION 0x0100
27 /* more DCICOMMAND escapes */
28 #define DDCREATEDRIVEROBJECT 10
29 #define DDGET32BITDRIVERNAME 11
30 #define DDNEWCALLBACKFNS 12
31 #define DDVERSIONINFO 13
33 #define MAX_DRIVER_NAME CCHDEVICENAME
35 /*****************************************************************************
36 * Initialization stuff
38 typedef struct {
39 char szName[260];
40 char szEntryPoint[64];
41 DWORD dwContext;
42 } DD32BITDRIVERDATA,*LPDD32BITDRIVERDATA;
44 typedef struct {
45 DWORD dwHALVersion;
46 ULONG_PTR dwReserved1;
47 ULONG_PTR dwReserved2;
48 } DDVERSIONDATA,*LPDDVERSIONDATA;
50 typedef DWORD PASCAL (*LPDD32BITDRIVERINIT)(DWORD dwContext);
52 /* pointer to video memory */
53 typedef ULONG_PTR FLATPTR;
55 /* predeclare some structures */
56 typedef struct _DDHALINFO *LPDDHALINFO;
57 typedef struct _DDRAWI_DIRECTDRAW_INT *LPDDRAWI_DIRECTDRAW_INT;
58 typedef struct _DDRAWI_DIRECTDRAW_LCL *LPDDRAWI_DIRECTDRAW_LCL;
59 typedef struct _DDRAWI_DIRECTDRAW_GBL *LPDDRAWI_DIRECTDRAW_GBL;
60 typedef struct _DDRAWI_DDRAWSURFACE_INT *LPDDRAWI_DDRAWSURFACE_INT;
61 typedef struct _DDRAWI_DDRAWSURFACE_LCL *LPDDRAWI_DDRAWSURFACE_LCL;
62 typedef struct _DDRAWI_DDRAWSURFACE_GBL *LPDDRAWI_DDRAWSURFACE_GBL;
63 typedef struct _DDRAWI_DDRAWSURFACE_MORE *LPDDRAWI_DDRAWSURFACE_MORE;
64 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE *LPDDRAWI_DDRAWSURFACE_GBL_MORE;
65 typedef struct _DDRAWI_DDRAWPALETTE_INT *LPDDRAWI_DDRAWPALETTE_INT;
66 typedef struct _DDRAWI_DDRAWPALETTE_LCL *LPDDRAWI_DDRAWPALETTE_LCL;
67 typedef struct _DDRAWI_DDRAWPALETTE_GBL *LPDDRAWI_DDRAWPALETTE_GBL;
68 typedef struct _DDRAWI_DDRAWCLIPPER_INT *LPDDRAWI_DDRAWCLIPPER_INT;
69 typedef struct _DDRAWI_DDRAWCLIPPER_LCL *LPDDRAWI_DDRAWCLIPPER_LCL;
70 typedef struct _DDRAWI_DDRAWCLIPPER_GBL *LPDDRAWI_DDRAWCLIPPER_GBL;
71 typedef struct _DDRAWI_DDVIDEOPORT_INT *LPDDRAWI_DDVIDEOPORT_INT;
72 typedef struct _DDRAWI_DDVIDEOPORT_LCL *LPDDRAWI_DDVIDEOPORT_LCL;
73 typedef struct _DDRAWI_DDMOTIONCOMP_INT *LPDDRAWI_DDMOTIONCOMP_INT;
74 typedef struct _DDRAWI_DDMOTIONCOMP_LCL *LPDDRAWI_DDMOTIONCOMP_LCL;
76 /* structure GUIDs for GetDriverInfo */
77 DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xEFD60CC0,0x49E7,0x11D0,0x88,0x9D,0x00,0xAA,0x00,0xBB,0xB7,0x6A );
78 /* ...videport stuff here... */
79 DEFINE_GUID( GUID_D3DCallbacks2, 0x0BA584E1,0x70B6,0x11D0,0x88,0x9D,0x00,0xAA,0x00,0xBB,0xB7,0x6A );
80 DEFINE_GUID( GUID_D3DCallbacks3, 0xDDF41230,0xEC0A,0x11D0,0xA9,0xB6,0x00,0xAA,0x00,0xC0,0x99,0x3E );
81 DEFINE_GUID( GUID_NonLocalVidMemCaps, 0x86C4FA80,0x8D84,0x11D0,0x94,0xE8,0x00,0xC0,0x4F,0xC3,0x41,0x37 );
82 /* ...kernel stuff here... */
83 DEFINE_GUID( GUID_D3DExtendedCaps, 0x7DE41F80,0x9D93,0x11D0,0x89,0xAB,0x00,0xA0,0xC9,0x05,0x41,0x29 );
84 DEFINE_GUID( GUID_ZPixelFormats, 0x93869880,0x36CF,0x11D1,0x9B,0x1B,0x00,0xAA,0x00,0xBB,0xB8,0xAE );
85 DEFINE_GUID( GUID_DDMoreSurfaceCaps, 0x3B8A0466,0xF269,0x11D1,0x88,0x0B,0x00,0xC0,0x4F,0xD9,0x30,0xC5 );
86 DEFINE_GUID( GUID_DDStereoMode, 0xF828169C,0xA8E8,0x11D2,0xA1,0xF2,0x00,0xA0,0xC9,0x83,0xEA,0xF6 );
87 /* ...more stuff here... */
88 DEFINE_GUID(GUID_D3DParseUnknownCommandCallback,0x2E04FFA0,0x98E4,0x11D1,0x8C,0xE1,0x00,0xA0,0xC9,0x06,0x29,0xA8 );
89 /* ...motioncomp stuff here... */
90 DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00,0x3E5A,0x11D1,0xB6,0x40,0x00,0xAA,0x00,0xA1,0xF9,0x6A );
92 /*****************************************************************************
93 * driver->ddraw callbacks
95 typedef BOOL DDAPI (*LPDDHAL_SETINFO)(LPDDHALINFO lpDDHalInfo, BOOL reset);
96 typedef FLATPTR DDAPI (*LPDDHAL_VIDMEMALLOC)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, DWORD dwWidth, DWORD dwHeight);
97 typedef void DDAPI (*LPDDHAL_VIDMEMFREE)(LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, FLATPTR fpMem);
99 typedef struct {
100 DWORD dwSize;
101 LPDDHAL_SETINFO lpSetInfo;
102 LPDDHAL_VIDMEMALLOC lpVidMemAlloc;
103 LPDDHAL_VIDMEMFREE lpVidMemFree;
104 } DDHALDDRAWFNS,*LPDDHALDDRAWFNS;
106 /*****************************************************************************
107 * mode info structure
109 typedef struct _DDHALMODEINFO {
110 DWORD dwWidth;
111 DWORD dwHeight;
112 LONG lPitch;
113 DWORD dwBPP;
114 WORD wFlags;
115 WORD wRefreshRate;
116 DWORD dwRBitMask;
117 DWORD dwGBitMask;
118 DWORD dwBBitMask;
119 DWORD dwAlphaBitMask;
120 } DDHALMODEINFO,*LPDDHALMODEINFO;
122 #define DDMODEINFO_PALETTIZED 0x0001
123 #define DDMODEINFO_MODEX 0x0002
124 #define DDMODEINFO_UNSUPPORTED 0x0004
125 #define DDMODEINFO_STANDARDVGA 0x0008
126 #define DDMODEINFO_MAXREFRESH 0x0010
127 #define DDMODEINFO_STEREO 0x0020
129 /*****************************************************************************
130 * video memory info structure
132 typedef struct _VIDMEM {
133 DWORD dwFlags;
134 FLATPTR fpStart;
135 union {
136 FLATPTR fpEnd;
137 DWORD dwWidth;
138 } DUMMYUNIONNAME1;
139 DDSCAPS ddsCaps;
140 DDSCAPS ddsCapsAlt;
141 union {
142 LPVMEMHEAP lpHeap;
143 DWORD dwHeight;
144 } DUMMYUNIONNAME2;
145 } VIDMEM,*LPVIDMEM;
147 #define VIDMEM_ISLINEAR 0x00000001
148 #define VIDMEM_ISRECTANGULAR 0x00000002
149 #define VIDMEM_ISHEAP 0x00000004
150 #define VIDMEM_ISNONLOCAL 0x00000008
151 #define VIDMEM_ISWC 0x00000010
152 #define VIDMEM_ISDISABLED 0x00000020
154 typedef struct _VIDMEMINFO {
155 FLATPTR fpPrimary;
156 DWORD dwFlags;
157 DWORD dwDisplayWidth;
158 DWORD dwDisplayHeight;
159 LONG lDisplayPitch;
160 DDPIXELFORMAT ddpfDisplay;
161 DWORD dwOffscreenAlign;
162 DWORD dwOverlayAlign;
163 DWORD dwTextureAlign;
164 DWORD dwZBufferAlign;
165 DWORD dwAlphaAlign;
166 DWORD dwNumHeaps;
167 LPVIDMEM pvmList;
168 } VIDMEMINFO,*LPVIDMEMINFO;
170 typedef struct _HEAPALIAS {
171 FLATPTR fpVidMem;
172 LPVOID lpAlias;
173 DWORD dwAliasSize;
174 } HEAPALIAS,*LPHEAPALIAS;
176 typedef struct _HEAPALIASINFO {
177 DWORD dwRefCnt;
178 DWORD dwFlags;
179 DWORD dwNumHeaps;
180 LPHEAPALIAS lpAliases;
181 } HEAPALIASINFO,*LPHEAPALIASINFO;
183 #define HEAPALIASINFO_MAPPEDREAL 0x00000001
184 #define HEAPALIASINFO_MAPPEDDUMMY 0x00000002
186 /*****************************************************************************
187 * capabilities structures
189 typedef struct _DDCORECAPS {
190 DWORD dwSize;
191 DWORD dwCaps;
192 DWORD dwCaps2;
193 DWORD dwCKeyCaps;
194 DWORD dwFXCaps;
195 DWORD dwFXAlphaCaps;
196 DWORD dwPalCaps;
197 DWORD dwSVCaps;
198 DWORD dwAlphaBltConstBitDepths;
199 DWORD dwAlphaBltPixelBitDepths;
200 DWORD dwAlphaBltSurfaceBitDepths;
201 DWORD dwAlphaOverlayConstBitDepths;
202 DWORD dwAlphaOverlayPixelBitDepths;
203 DWORD dwAlphaOverlaySurfaceBitDepths;
204 DWORD dwZBufferBitDepths;
205 DWORD dwVidMemTotal;
206 DWORD dwVidMemFree;
207 DWORD dwMaxVisibleOverlays;
208 DWORD dwCurrVisibleOverlays;
209 DWORD dwNumFourCCCodes;
210 DWORD dwAlignBoundarySrc;
211 DWORD dwAlignSizeSrc;
212 DWORD dwAlignBoundaryDest;
213 DWORD dwAlignSizeDest;
214 DWORD dwAlignStrideAlign;
215 DWORD dwRops[DD_ROP_SPACE];
216 DDSCAPS ddsCaps;
217 DWORD dwMinOverlayStretch;
218 DWORD dwMaxOverlayStretch;
219 DWORD dwMinLiveVideoStretch;
220 DWORD dwMaxLiveVideoStretch;
221 DWORD dwMinHwCodecStretch;
222 DWORD dwMaxHwCodecStretch;
223 DWORD dwReserved1;
224 DWORD dwReserved2;
225 DWORD dwReserved3;
226 DWORD dwSVBCaps;
227 DWORD dwSVBCKeyCaps;
228 DWORD dwSVBFXCaps;
229 DWORD dwSVBRops[DD_ROP_SPACE];
230 DWORD dwVSBCaps;
231 DWORD dwVSBCKeyCaps;
232 DWORD dwVSBFXCaps;
233 DWORD dwVSBRops[DD_ROP_SPACE];
234 DWORD dwSSBCaps;
235 DWORD dwSSBCKeyCaps;
236 DWORD dwSSBFXCaps;
237 DWORD dwSSBRops[DD_ROP_SPACE];
238 DWORD dwMaxVideoPorts;
239 DWORD dwCurrVideoPorts;
240 DWORD dwSVBCaps2;
241 } DDCORECAPS,*LPDDCORECAPS;
243 typedef struct _DDNONLOCALVIDMEMCAPS {
244 DWORD dwSize;
245 DWORD dwNLVBCaps;
246 DWORD dwNLVBCaps2;
247 DWORD dwNLVBCKeyCaps;
248 DWORD dwNLVBFXCaps;
249 DWORD dwNLVBRops[DD_ROP_SPACE];
250 } DDNONLOCALVIDMEMCAPS,*LPDDNONLOCALVIDMEMCAPS;
252 typedef struct _DDSCAPSEX {
253 DWORD dwCaps2;
254 DWORD dwCaps3;
255 DWORD dwCaps4;
256 } DDSCAPSEX,*LPDDSCAPSEX;
258 #define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2
259 #define DDSCAPS2_VERTEXBUFFER DDSCAPS2_RESERVED1
260 #define DDSCAPS2_COMMANDBUFFER DDSCAPS2_RESERVED2
262 /*****************************************************************************
263 * ddraw->driver callbacks
265 #define DDHAL_DRIVER_NOTHANDLED 0
266 #define DDHAL_DRIVER_HANDLED 1
267 #define DDHAL_DRIVER_NOCKEYHW 2
269 typedef struct _DDHAL_DESTROYDRIVERDATA *LPDDHAL_DESTROYDRIVERDATA;
270 typedef struct _DDHAL_CREATESURFACEDATA *LPDDHAL_CREATESURFACEDATA;
271 typedef struct _DDHAL_DRVSETCOLORKEYDATA *LPDDHAL_DRVSETCOLORKEYDATA;
272 typedef struct _DDHAL_SETMODEDATA *LPDDHAL_SETMODEDATA;
273 typedef struct _DDHAL_WAITFORVERTICALBLANKDATA *LPDDHAL_WAITFORVERTICALBLANKDATA;
274 typedef struct _DDHAL_CANCREATESURFACEDATA *LPDDHAL_CANCREATESURFACEDATA;
275 typedef struct _DDHAL_CREATEPALETTEDATA *LPDDHAL_CREATEPALETTEDATA;
276 typedef struct _DDHAL_GETSCANLINEDATA *LPDDHAL_GETSCANLINEDATA;
277 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA *LPDDHAL_SETEXCLUSIVEMODEDATA;
278 typedef struct _DDHAL_FLIPTOGDISURFACEDATA *LPDDHAL_FLIPTOGDISURFACEDATA;
280 typedef DWORD PASCAL (*LPDDHAL_DESTROYDRIVER) (LPDDHAL_DESTROYDRIVERDATA);
281 typedef DWORD PASCAL (*LPDDHAL_CREATESURFACE) (LPDDHAL_CREATESURFACEDATA);
282 typedef DWORD PASCAL (*LPDDHAL_SETCOLORKEY) (LPDDHAL_DRVSETCOLORKEYDATA);
283 typedef DWORD PASCAL (*LPDDHAL_SETMODE) (LPDDHAL_SETMODEDATA);
284 typedef DWORD PASCAL (*LPDDHAL_WAITFORVERTICALBLANK)(LPDDHAL_WAITFORVERTICALBLANKDATA);
285 typedef DWORD PASCAL (*LPDDHAL_CANCREATESURFACE) (LPDDHAL_CANCREATESURFACEDATA );
286 typedef DWORD PASCAL (*LPDDHAL_CREATEPALETTE) (LPDDHAL_CREATEPALETTEDATA);
287 typedef DWORD PASCAL (*LPDDHAL_GETSCANLINE) (LPDDHAL_GETSCANLINEDATA);
288 typedef DWORD PASCAL (*LPDDHAL_SETEXCLUSIVEMODE) (LPDDHAL_SETEXCLUSIVEMODEDATA);
289 typedef DWORD PASCAL (*LPDDHAL_FLIPTOGDISURFACE) (LPDDHAL_FLIPTOGDISURFACEDATA);
291 typedef struct _DDHAL_DDCALLBACKS {
292 DWORD dwSize;
293 DWORD dwFlags;
294 LPDDHAL_DESTROYDRIVER DestroyDriver;
295 LPDDHAL_CREATESURFACE CreateSurface;
296 LPDDHAL_SETCOLORKEY SetColorKey;
297 LPDDHAL_SETMODE SetMode;
298 LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank;
299 LPDDHAL_CANCREATESURFACE CanCreateSurface;
300 LPDDHAL_CREATEPALETTE CreatePalette;
301 LPDDHAL_GETSCANLINE GetScanLine;
302 /* DirectX 2 */
303 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
304 LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
305 } DDHAL_DDCALLBACKS,*LPDDHAL_DDCALLBACKS;
307 typedef struct _DDHAL_DESTROYSURFACEDATA *LPDDHAL_DESTROYSURFACEDATA;
308 typedef struct _DDHAL_FLIPDATA *LPDDHAL_FLIPDATA;
309 typedef struct _DDHAL_SETCLIPLISTDATA *LPDDHAL_SETCLIPLISTDATA;
310 typedef struct _DDHAL_LOCKDATA *LPDDHAL_LOCKDATA;
311 typedef struct _DDHAL_UNLOCKDATA *LPDDHAL_UNLOCKDATA;
312 typedef struct _DDHAL_BLTDATA *LPDDHAL_BLTDATA;
313 typedef struct _DDHAL_SETCOLORKEYDATA *LPDDHAL_SETCOLORKEYDATA;
314 typedef struct _DDHAL_ADDATTACHEDSURFACEDATA *LPDDHAL_ADDATTACHEDSURFACEDATA;
315 typedef struct _DDHAL_GETBLTSTATUSDATA *LPDDHAL_GETBLTSTATUSDATA;
316 typedef struct _DDHAL_GETFLIPSTATUSDATA *LPDDHAL_GETFLIPSTATUSDATA;
317 typedef struct _DDHAL_UPDATEOVERLAYDATA *LPDDHAL_UPDATEOVERLAYDATA;
318 typedef struct _DDHAL_SETOVERLAYPOSITIONDATA *LPDDHAL_SETOVERLAYPOSITIONDATA;
319 typedef struct _DDHAL_SETPALETTEDATA *LPDDHAL_SETPALETTEDATA;
321 typedef DWORD PASCAL (*LPDDHALSURFCB_DESTROYSURFACE) (LPDDHAL_DESTROYSURFACEDATA);
322 typedef DWORD PASCAL (*LPDDHALSURFCB_FLIP) (LPDDHAL_FLIPDATA);
323 typedef DWORD PASCAL (*LPDDHALSURFCB_SETCLIPLIST) (LPDDHAL_SETCLIPLISTDATA);
324 typedef DWORD PASCAL (*LPDDHALSURFCB_LOCK) (LPDDHAL_LOCKDATA);
325 typedef DWORD PASCAL (*LPDDHALSURFCB_UNLOCK) (LPDDHAL_UNLOCKDATA);
326 typedef DWORD PASCAL (*LPDDHALSURFCB_BLT) (LPDDHAL_BLTDATA);
327 typedef DWORD PASCAL (*LPDDHALSURFCB_SETCOLORKEY) (LPDDHAL_SETCOLORKEYDATA);
328 typedef DWORD PASCAL (*LPDDHALSURFCB_ADDATTACHEDSURFACE)(LPDDHAL_ADDATTACHEDSURFACEDATA);
329 typedef DWORD PASCAL (*LPDDHALSURFCB_GETBLTSTATUS) (LPDDHAL_GETBLTSTATUSDATA);
330 typedef DWORD PASCAL (*LPDDHALSURFCB_GETFLIPSTATUS) (LPDDHAL_GETFLIPSTATUSDATA);
331 typedef DWORD PASCAL (*LPDDHALSURFCB_UPDATEOVERLAY) (LPDDHAL_UPDATEOVERLAYDATA);
332 typedef DWORD PASCAL (*LPDDHALSURFCB_SETOVERLAYPOSITION)(LPDDHAL_SETOVERLAYPOSITIONDATA);
333 typedef DWORD PASCAL (*LPDDHALSURFCB_SETPALETTE) (LPDDHAL_SETPALETTEDATA);
335 typedef struct _DDHAL_DDSURFACECALLBACKS {
336 DWORD dwSize;
337 DWORD dwFlags;
338 LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
339 LPDDHALSURFCB_FLIP Flip;
340 LPDDHALSURFCB_SETCLIPLIST SetClipList;
341 LPDDHALSURFCB_LOCK Lock;
342 LPDDHALSURFCB_UNLOCK Unlock;
343 LPDDHALSURFCB_BLT Blt;
344 LPDDHALSURFCB_SETCOLORKEY SetColorKey;
345 LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
346 LPDDHALSURFCB_GETBLTSTATUS GetBltStatus;
347 LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus;
348 LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay;
349 LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition;
350 LPVOID reserved4;
351 LPDDHALSURFCB_SETPALETTE SetPalette;
352 } DDHAL_DDSURFACECALLBACKS,*LPDDHAL_DDSURFACECALLBACKS;
354 typedef struct _DDHAL_DESTROYPALETTEDATA *LPDDHAL_DESTROYPALETTEDATA;
355 typedef struct _DDHAL_SETENTRIESDATA *LPDDHAL_SETENTRIESDATA;
357 typedef DWORD PASCAL (*LPDDHALPALCB_DESTROYPALETTE)(LPDDHAL_DESTROYPALETTEDATA);
358 typedef DWORD PASCAL (*LPDDHALPALCB_SETENTRIES) (LPDDHAL_SETENTRIESDATA);
360 typedef struct _DDHAL_DDPALETTECALLBACKS {
361 DWORD dwSize;
362 DWORD dwFlags;
363 LPDDHALPALCB_DESTROYPALETTE DestroyPalette;
364 LPDDHALPALCB_SETENTRIES SetEntries;
365 } DDHAL_DDPALETTECALLBACKS,*LPDDHAL_DDPALETTECALLBACKS;
367 typedef DWORD PASCAL (*LPDDHALEXEBUFCB_CANCREATEEXEBUF)(LPDDHAL_CANCREATESURFACEDATA);
368 typedef DWORD PASCAL (*LPDDHALEXEBUFCB_CREATEEXEBUF) (LPDDHAL_CREATESURFACEDATA);
369 typedef DWORD PASCAL (*LPDDHALEXEBUFCB_DESTROYEXEBUF) (LPDDHAL_DESTROYSURFACEDATA);
370 typedef DWORD PASCAL (*LPDDHALEXEBUFCB_LOCKEXEBUF) (LPDDHAL_LOCKDATA);
371 typedef DWORD PASCAL (*LPDDHALEXEBUFCB_UNLOCKEXEBUF) (LPDDHAL_UNLOCKDATA);
373 typedef struct _DDHAL_DDEXEBUFCALLBACKS {
374 DWORD dwSize;
375 DWORD dwFlags;
376 LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer;
377 LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer;
378 LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer;
379 LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer;
380 LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer;
381 } DDHAL_DDEXEBUFCALLBACKS,*LPDDHAL_DDEXEBUFCALLBACKS;
383 typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA *LPDDHAL_GETAVAILDRIVERMEMORYDATA;
384 typedef struct _DDHAL_UPDATENONLOCALHEAPDATA *LPDDHAL_UPDATENONLOCALHEAPDATA;
385 typedef struct _DDHAL_GETHEAPALIGNMENTDATA *LPDDHAL_GETHEAPALIGNMENTDATA;
387 typedef DWORD PASCAL (*LPDDHAL_GETAVAILDRIVERMEMORY)(LPDDHAL_GETAVAILDRIVERMEMORYDATA);
388 typedef DWORD PASCAL (*LPDDHAL_UPDATENONLOCALHEAP) (LPDDHAL_UPDATENONLOCALHEAPDATA);
389 typedef DWORD PASCAL (*LPDDHAL_GETHEAPALIGNMENT) (LPDDHAL_GETHEAPALIGNMENTDATA);
391 typedef struct _DDHAL_DDMISCELLANEOUSCALLBACKS {
392 DWORD dwSize;
393 DWORD dwFlags;
394 LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory;
395 LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap;
396 LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment;
397 LPDDHALSURFCB_GETBLTSTATUS GetSysmemBltStatus;
398 } DDHAL_DDMISCELLANEOUSCALLBACKS,*LPDDHAL_DDMISCELLANEOUSCALLBACKS;
400 typedef struct _DDHAL_CREATESURFACEEXDATA *LPDDHAL_CREATESURFACEEXDATA;
401 typedef struct _DDHAL_GETDRIVERSTATEDATA *LPDDHAL_GETDRIVERSTATEDATA;
402 typedef struct _DDHAL_DESTROYDDLOCALDATA *LPDDHAL_DESTROYDDLOCALDATA;
404 typedef DWORD PASCAL (*LPDDHAL_CREATESURFACEEX)(LPDDHAL_CREATESURFACEEXDATA);
405 typedef DWORD PASCAL (*LPDDHAL_GETDRIVERSTATE) (LPDDHAL_GETDRIVERSTATEDATA);
406 typedef DWORD PASCAL (*LPDDHAL_DESTROYDDLOCAL) (LPDDHAL_DESTROYDDLOCALDATA);
408 typedef struct _DDHAL_DDMISCELLANEOUS2CALLBACKS {
409 DWORD dwSize;
410 DWORD dwFlags;
411 LPVOID Reserved;
412 LPDDHAL_CREATESURFACEEX CreateSurfaceEx;
413 LPDDHAL_GETDRIVERSTATE GetDriverState;
414 LPDDHAL_DESTROYDDLOCAL DestroyDDLocal;
415 } DDHAL_DDMISCELLANEOUS2CALLBACKS,*LPDDHAL_DDMISCELLANEOUS2CALLBACKS;
417 typedef HRESULT WINAPI (*LPDDGAMMACALIBRATORPROC)(LPDDGAMMARAMP, LPBYTE);
419 /*****************************************************************************
420 * driver info structure
422 * The HAL is queried for additional callbacks via the GetDriverInfo callback.
424 typedef struct _DDHAL_GETDRIVERINFODATA *LPDDHAL_GETDRIVERINFODATA;
425 typedef DWORD PASCAL (*LPDDHAL_GETDRIVERINFO)(LPDDHAL_GETDRIVERINFODATA);
427 typedef struct _DDHALINFO {
428 DWORD dwSize;
429 LPDDHAL_DDCALLBACKS lpDDCallbacks;
430 LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks;
431 LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks;
432 VIDMEMINFO vmiData;
433 DDCORECAPS ddCaps;
434 DWORD dwMonitorFrequency;
435 LPDDHAL_GETDRIVERINFO GetDriverInfo;
436 DWORD dwModeIndex;
437 LPDWORD lpdwFourCC;
438 DWORD dwNumModes;
439 LPDDHALMODEINFO lpModeInfo;
440 DWORD dwFlags;
441 LPVOID lpPDevice;
442 DWORD hInstance;
443 /* DirectX 2 */
444 ULONG_PTR lpD3DGlobalDriverData;
445 ULONG_PTR lpD3DHALCallbacks;
446 LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks;
447 } DDHALINFO;
449 #define DDHALINFO_ISPRIMARYDISPLAY 0x00000001
450 #define DDHALINFO_MODEXILLEGAL 0x00000002
451 #define DDHALINFO_GETDRIVERINFOSET 0x00000004
453 /* where the high-level ddraw implementation stores the callbacks */
454 typedef struct _DDHAL_CALLBACKS {
455 DDHAL_DDCALLBACKS cbDDCallbacks;
456 DDHAL_DDSURFACECALLBACKS cbDDSurfaceCallbacks;
457 DDHAL_DDPALETTECALLBACKS cbDDPaletteCallbacks;
458 DDHAL_DDCALLBACKS HALDD;
459 DDHAL_DDSURFACECALLBACKS HALDDSurface;
460 DDHAL_DDPALETTECALLBACKS HALDDPalette;
461 DDHAL_DDCALLBACKS HELDD;
462 DDHAL_DDSURFACECALLBACKS HELDDSurface;
463 DDHAL_DDPALETTECALLBACKS HELDDPalette;
464 DDHAL_DDEXEBUFCALLBACKS cbDDExeBufCallbacks;
465 DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf;
466 DDHAL_DDEXEBUFCALLBACKS HELDDExeBuf;
467 /* there's more... videoport, colorcontrol, misc, and motion compensation callbacks... */
468 } DDHAL_CALLBACKS,*LPDDHAL_CALLBACKS;
470 /*****************************************************************************
471 * parameter structures
473 typedef struct _DDHAL_DESTROYDRIVERDATA {
474 LPDDRAWI_DIRECTDRAW_GBL lpDD;
475 HRESULT ddRVal;
476 LPDDHAL_DESTROYDRIVER DestroyDriver;
477 } DDHAL_DESTROYDRIVERDATA;
479 typedef struct _DDHAL_SETMODEDATA {
480 LPDDRAWI_DIRECTDRAW_GBL lpDD;
481 DWORD dwModeIndex;
482 HRESULT ddRVal;
483 LPDDHAL_SETMODE SetMode;
484 BOOL inexcl;
485 BOOL useRefreshRate;
486 } DDHAL_SETMODEDATA;
488 typedef struct _DDHAL_CREATESURFACEDATA {
489 LPDDRAWI_DIRECTDRAW_GBL lpDD;
490 LPDDSURFACEDESC lpDDSurfaceDesc;
491 LPDDRAWI_DDRAWSURFACE_LCL * lplpSList;
492 DWORD dwSCnt;
493 HRESULT ddRVal;
494 LPDDHAL_CREATESURFACE CreateSurface;
495 } DDHAL_CREATESURFACEDATA;
497 typedef struct _DDHAL_CANCREATESURFACEDATA {
498 LPDDRAWI_DIRECTDRAW_GBL lpDD;
499 LPDDSURFACEDESC lpDDSurfaceDesc;
500 DWORD bIsDifferentPixelFormat;
501 HRESULT ddRVal;
502 LPDDHAL_CANCREATESURFACE CanCreateSurface;
503 } DDHAL_CANCREATESURFACEDATA;
505 typedef struct _DDHAL_CREATEPALETTEDATA {
506 LPDDRAWI_DIRECTDRAW_GBL lpDD;
507 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
508 LPPALETTEENTRY lpColorTable;
509 HRESULT ddRVal;
510 LPDDHAL_CREATEPALETTE CreatePalette;
511 BOOL is_excl;
512 } DDHAL_CREATEPALETTEDATA;
514 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA {
515 LPDDRAWI_DIRECTDRAW_GBL lpDD;
516 DWORD dwEnterExcl;
517 DWORD dwReserved;
518 HRESULT ddRVal;
519 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
520 } DDHAL_SETEXCLUSIVEMODEDATA;
522 /* surfaces */
523 typedef struct _DDHAL_DESTROYSURFACEDATA {
524 LPDDRAWI_DIRECTDRAW_GBL lpDD;
525 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
526 HRESULT ddRVal;
527 LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
528 } DDHAL_DESTROYSURFACEDATA;
530 typedef struct _DDHAL_FLIPDATA {
531 LPDDRAWI_DIRECTDRAW_GBL lpDD;
532 LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr;
533 LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg;
534 DWORD dwFlags;
535 HRESULT ddRVal;
536 LPDDHALSURFCB_FLIP Flip;
537 LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurrLeft;
538 LPDDRAWI_DDRAWSURFACE_LCL lpSurfTargLeft;
539 } DDHAL_FLIPDATA;
541 typedef struct _DDHAL_LOCKDATA {
542 LPDDRAWI_DIRECTDRAW_GBL lpDD;
543 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
544 DWORD bHasRect;
545 RECTL rArea;
546 LPVOID lpSurfData;
547 HRESULT ddRVal;
548 LPDDHALSURFCB_LOCK Lock;
549 DWORD dwFlags;
550 } DDHAL_LOCKDATA;
552 typedef struct _DDHAL_UNLOCKDATA {
553 LPDDRAWI_DIRECTDRAW_GBL lpDD;
554 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
555 HRESULT ddRVal;
556 LPDDHALSURFCB_UNLOCK Unlock;
557 } DDHAL_UNLOCKDATA;
559 typedef struct _DDHAL_BLTDATA {
560 LPDDRAWI_DIRECTDRAW_GBL lpDD;
561 LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;
562 RECTL rDest;
563 LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface;
564 RECTL rSrc;
565 DWORD dwFlags;
566 DWORD dwROPFlags;
567 DDBLTFX bltFX;
568 HRESULT ddRVal;
569 LPDDHALSURFCB_BLT Blt;
570 BOOL IsClipped;
571 RECTL rOrigDest;
572 RECTL rOrigSrc;
573 DWORD dwRectCnt;
574 LPRECT prDestRects;
575 } DDHAL_BLTDATA;
577 typedef struct _DDHAL_SETPALETTEDATA {
578 LPDDRAWI_DIRECTDRAW_GBL lpDD;
579 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface;
580 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
581 HRESULT ddRVal;
582 LPDDHALSURFCB_SETPALETTE SetPalette;
583 BOOL Attach;
584 } DDHAL_SETPALETTEDATA;
586 /* palettes */
587 typedef struct _DDHAL_DESTROYPALETTEDATA {
588 LPDDRAWI_DIRECTDRAW_GBL lpDD;
589 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
590 HRESULT ddRVal;
591 LPDDHALPALCB_DESTROYPALETTE DestroyPalette;
592 } DDHAL_DESTROYPALETTEDATA;
594 typedef struct _DDHAL_SETENTRIESDATA {
595 LPDDRAWI_DIRECTDRAW_GBL lpDD;
596 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette;
597 DWORD dwBase;
598 DWORD dwNumEntries;
599 LPPALETTEENTRY lpEntries;
600 HRESULT ddRVal;
601 LPDDHALPALCB_SETENTRIES SetEntries;
602 } DDHAL_SETENTRIESDATA;
604 typedef struct _DDHAL_GETDRIVERINFODATA {
605 DWORD dwSize;
606 DWORD dwFlags;
607 GUID guidInfo;
608 DWORD dwExpectedSize;
609 LPVOID lpvData;
610 DWORD dwActualSize;
611 HRESULT ddRVal;
612 ULONG_PTR dwContext;
613 } DDHAL_GETDRIVERINFODATA;
615 /*****************************************************************************
616 * high-level ddraw implementation structures
618 typedef struct _IUNKNOWN_LIST {
619 struct _IUNKNOWN_LIST * lpLink;
620 LPGUID lpGuid;
621 IUnknown * lpIUnknown;
622 } IUNKNOWN_LIST,*LPIUNKNOWN_LIST;
624 typedef struct _PROCESS_LIST {
625 struct _PROCESS_LIST * lpLink;
626 DWORD dwProcessId;
627 DWORD dwRefCnt;
628 DWORD dwAlphaDepth;
629 DWORD dwZDepth;
630 } PROCESS_LIST,*LPPROCESS_LIST;
632 typedef struct _ATTACHLIST {
633 DWORD dwFlags;
634 struct _ATTACHLIST * lpLink;
635 LPDDRAWI_DDRAWSURFACE_LCL lpAttached;
636 LPDDRAWI_DDRAWSURFACE_INT lpIAttached;
637 } ATTACHLIST,*LPATTACHLIST;
639 #define DDAL_IMPLICIT 0x00000001
641 typedef struct _ACCESSRECTLIST {
642 struct _ACCESSRECTLIST * lpLink;
643 RECT rDest;
644 LPDDRAWI_DIRECTDRAW_LCL lpOwner;
645 LPVOID lpSurfaceData;
646 DWORD dwFlags;
647 LPHEAPALIASINFO lpHeapAliasInfo;
648 } ACCESSRECTLIST,*LPACCESSRECTLIST;
650 #define ACCESSRECT_VRAMSTYLE 0x00000001
651 #define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002
652 #define ACCESSRECT_BROKEN 0x00000004
654 typedef struct _DBLNODE {
655 struct _DBLNODE * next;
656 struct _DBLNODE * prev;
657 LPDDRAWI_DDRAWSURFACE_LCL object;
658 LPDDRAWI_DDRAWSURFACE_INT object_int;
659 } DBLNODE,*LPDBLNODE;
661 typedef struct _DDRAWI_DIRECTDRAW_INT {
662 LPVOID lpVtbl;
663 LPDDRAWI_DIRECTDRAW_LCL lpLcl;
664 LPDDRAWI_DIRECTDRAW_INT lpLink;
665 DWORD dwIntRefCnt;
666 } DDRAWI_DIRECTDRAW_INT;
668 typedef struct _DDRAWI_DIRECTDRAW_LCL {
669 DWORD lpDDMore;
670 LPDDRAWI_DIRECTDRAW_GBL lpGbl;
671 DWORD dwUnused0;
672 DWORD dwLocalFlags;
673 DWORD dwLocalRefCnt;
674 DWORD dwProcessId;
675 IUnknown * pUnkOuter;
676 DWORD dwObsolete1;
677 ULONG_PTR hWnd;
678 ULONG_PTR hDC;
679 DWORD dwErrorMode;
680 LPDDRAWI_DDRAWSURFACE_INT lpPrimary;
681 LPDDRAWI_DDRAWSURFACE_INT lpCB;
682 DWORD dwPreferredMode;
683 /* DirectX 2 */
684 HINSTANCE hD3DInstance;
685 IUnknown * pD3DIUnknown;
686 LPDDHAL_CALLBACKS lpDDCB;
687 ULONG_PTR hDDVxd;
688 /* DirectX 5.0 */
689 DWORD dwAppHackFlags;
690 /* DirectX 5.0A */
691 ULONG_PTR hFocusWnd;
692 DWORD dwHotTracking;
693 DWORD dwIMEState;
694 /* DirectX 6.0 */
695 ULONG_PTR hWndPopup;
696 ULONG_PTR hDD;
697 ULONG_PTR hGammaCalibrator;
698 LPDDGAMMACALIBRATORPROC lpGammaCalibrator;
699 } DDRAWI_DIRECTDRAW_LCL;
701 #define DDRAWILCL_HASEXCLUSIVEMODE 0x00000001
702 #define DDRAWILCL_ISFULLSCREEN 0x00000002
703 #define DDRAWILCL_SETCOOPCALLED 0x00000004
704 #define DDRAWILCL_ACTIVEYES 0x00000008
705 #define DDRAWILCL_ACTIVENO 0x00000010
706 #define DDRAWILCL_HOOKEDHWND 0x00000020
707 #define DDRAWILCL_ALLOWMODEX 0x00000040
708 #define DDRAWILCL_V1SCLBEHAVIOUR 0x00000080
709 #define DDRAWILCL_MODEHASBEENCHANGED 0x00000100
710 #define DDRAWILCL_CREATEDWINDOW 0x00000200
711 #define DDRAWILCL_DIRTYDC 0x00000400
712 #define DDRAWILCL_DISABLEINACTIVATE 0x00000800
713 #define DDRAWILCL_CURSORCLIPPED 0x00001000
714 #define DDRAWILCL_EXPLICITMONITOR 0x00002000
715 #define DDRAWILCL_MULTITHREADED 0x00004000
716 #define DDRAWILCL_FPUSETUP 0x00008000
717 #define DDRAWILCL_POWEREDDOWN 0x00010000
718 #define DDRAWILCL_DIRECTDRAW7 0x00020000
719 #define DDRAWILCL_ATTEMPTEDD3DCONTEXT 0x00040000
720 #define DDRAWILCL_FPUPRESERVE 0x00080000
722 typedef struct _DDRAWI_DIRECTDRAW_GBL {
723 DWORD dwRefCnt;
724 DWORD dwFlags;
725 FLATPTR fpPrimaryOrig;
726 DDCORECAPS ddCaps;
727 DWORD dwInternal1;
728 DWORD dwUnused1[9];
729 LPDDHAL_CALLBACKS lpDDCBtmp;
730 LPDDRAWI_DDRAWSURFACE_INT dsList;
731 LPDDRAWI_DDRAWPALETTE_INT palList;
732 LPDDRAWI_DDRAWCLIPPER_INT clipperList;
733 LPDDRAWI_DIRECTDRAW_GBL lp16DD;
734 DWORD dwMaxOverlays;
735 DWORD dwCurrOverlays;
736 DWORD dwMonitorFrequency;
737 DDCORECAPS ddHELCaps;
738 DWORD dwUnused2[50];
739 DDCOLORKEY ddckCKDestOverlay;
740 DDCOLORKEY ddckCKSrcOverlay;
741 VIDMEMINFO vmiData;
742 LPVOID lpDriverHandle;
743 LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner;
744 DWORD dwModeIndex;
745 DWORD dwModeIndexOrig;
746 DWORD dwNumFourCC;
747 LPDWORD lpdwFourCC;
748 DWORD dwNumModes;
749 LPDDHALMODEINFO lpModeInfo;
750 PROCESS_LIST plProcessList;
751 DWORD dwSurfaceLockCount;
752 DWORD dwAliasedLockCnt;
753 ULONG_PTR dwReserved3;
754 ULONG_PTR hDD;
755 char cObsolete[12];
756 DWORD dwReserved1;
757 DWORD dwReserved2;
758 DBLNODE dbnOverlayRoot;
759 volatile LPWORD lpwPDeviceFlags;
760 DWORD dwPDevice;
761 DWORD dwWin16LockCnt;
762 DWORD dwUnused3;
763 DWORD hInstance;
764 DWORD dwEvent16;
765 DWORD dwSaveNumModes;
766 /* DirectX 2 */
767 ULONG_PTR lpD3DGlobalDriverData;
768 ULONG_PTR lpD3DHALCallbacks;
769 DDCORECAPS ddBothCaps;
770 /* DirectX 5.0 */
771 LPDDVIDEOPORTCAPS lpDDVideoPortCaps;
772 LPDDRAWI_DDVIDEOPORT_INT dvpList;
773 ULONG_PTR lpD3DHALCallbacks2;
774 RECT rectDevice;
775 DWORD cMonitors;
776 LPVOID gpbmiSrc;
777 LPVOID gpbmiDest;
778 LPHEAPALIASINFO phaiHeapAliases;
779 ULONG_PTR hKernelHandle;
780 ULONG_PTR pfnNotifyProc;
781 LPDDKERNELCAPS lpDDKernelCaps;
782 LPDDNONLOCALVIDMEMCAPS lpddNLVCaps;
783 LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps;
784 LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps;
785 ULONG_PTR lpD3DExtendedCaps;
786 /* DirectX 5.0A */
787 DWORD dwDOSBoxEvent;
788 RECT rectDesktop;
789 char cDriverName[MAX_DRIVER_NAME];
790 /* DirectX 6.0 */
791 ULONG_PTR lpD3DHALCallbacks3;
792 DWORD dwNumZPixelFormats;
793 LPDDPIXELFORMAT lpZPixelFormats;
794 LPDDRAWI_DDMOTIONCOMP_INT mcList;
795 DWORD hDDVxd;
796 DDSCAPSEX ddsCapsMore;
797 } DDRAWI_DIRECTDRAW_GBL;
799 #define DDRAWI_VIRTUALDESKTOP 0x00000008
800 #define DDRAWI_MODEX 0x00000010
801 #define DDRAWI_DISPLAYDRV 0x00000020
802 #define DDRAWI_FULLSCREEN 0x00000040
803 #define DDRAWI_MODECHANGED 0x00000080
804 #define DDRAWI_NOHARDWARE 0x00000100
805 #define DDRAWI_PALETTEINIT 0x00000200
806 #define DDRAWI_NOEMULATION 0x00000400
807 /* more... */
809 /* surfaces */
810 typedef struct _DDRAWI_DDRAWSURFACE_INT {
811 LPVOID lpVtbl;
812 LPDDRAWI_DDRAWSURFACE_LCL lpLcl;
813 LPDDRAWI_DDRAWSURFACE_INT lpLink;
814 DWORD dwIntRefCnt;
815 } DDRAWI_DDRAWSURFACE_INT;
817 typedef struct _DDRAWI_DDRAWSURFACE_GBL {
818 DWORD dwRefCnt;
819 DWORD dwGlobalFlags;
820 union {
821 LPACCESSRECTLIST lpRectList;
822 DWORD dwBlockSizeY;
823 } DUMMYUNIONNAME1;
824 union {
825 LPVMEMHEAP lpVidMemHeap;
826 DWORD dwBlockSizeX;
827 } DUMMYUNIONNAME2;
828 union {
829 LPDDRAWI_DIRECTDRAW_GBL lpDD;
830 LPVOID lpDDHandle;
831 } DUMMYUNIONNAME3;
832 FLATPTR fpVidMem;
833 union {
834 LONG lPitch;
835 DWORD dwLinearSize;
836 } DUMMYUNIONNAME4;
837 WORD wHeight;
838 WORD wWidth;
839 DWORD dwUsageCount;
840 ULONG_PTR dwReserved1; /* for display driver use */
841 /* optional (defaults to primary surface pixelformat) */
842 DDPIXELFORMAT ddpfSurface;
843 } DDRAWI_DDRAWSURFACE_GBL;
845 #define DDRAWISURFGBL_MEMFREE 0x00000001
846 #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002
847 #define DDRAWISURFGBL_ISGDISURFACE 0x00000004
848 #define DDRAWISURFGBL_SOFTWAREAUTOFLIP 0x00000008
849 #define DDRAWISURFGBL_LOCKNOTHOLDINGWIN16LOCK 0x00000010
850 #define DDRAWISURFGBL_LOCKVRAMSTYLE 0x00000020
851 #define DDRAWISURFGBL_LOCKBROKEN 0x00000040
852 #define DDRAWISURFGBL_IMPLICITHANDLE 0x00000080
853 #define DDRAWISURFGBL_ISCLIENTMEM 0x00000100
854 #define DDRAWISURFGBL_HARDWAREOPSOURCE 0x00000200
855 #define DDRAWISURFGBL_HARDWAREOPDEST 0x00000400
856 #define DDRAWISURFGBL_HARDWAREOPSTARTED 0x00000600
857 #define DDRAWISURFGBL_VPORTINTERLEAVED 0x00000800
858 #define DDRAWISURFGBL_VPORTDATA 0x00001000
859 #define DDRAWISURFGBL_LATEALLOCATELINEAR 0x00002000
860 #define DDRAWISURFGBL_SYSMEMEXECUTEBUFFER 0x00004000
861 #define DDRAWISURFGBL_FASTLOCKHELD 0x00008000
862 #define DDRAWISURFGBL_READONLYLOCKHELD 0x00010000
864 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE {
865 DWORD dwSize;
866 union {
867 DWORD dwPhysicalPageTable;
868 FLATPTR fpPhysicalVidMem;
869 } DUMMYUNIONNAME1;
870 LPDWORD pPageTable;
871 DWORD cPages;
872 ULONG_PTR dwSavedDCContext;
873 FLATPTR fpAliasedVidMem;
874 ULONG_PTR dwDriverReserved;
875 ULONG_PTR dwHELReserved;
876 DWORD cPageUnlocks;
877 ULONG_PTR hKernelSurface;
878 DWORD dwKernelRefCnt;
879 LPDDCOLORCONTROL lpColorInfo;
880 FLATPTR fpNTAlias;
881 DWORD dwContentsStamp;
882 LPVOID lpvUnswappedDriverReserved;
883 LPVOID lpDDRAWReserved2;
884 DWORD dwDDRAWReserved1;
885 DWORD dwDDRAWReserved2;
886 FLATPTR fpAliasOfVidMem;
887 } DDRAWI_DDRAWSURFACE_GBL_MORE;
889 /* the MS version of this macro was somewhat obfuscated and unreadable
890 * (possibly because of mediocre MS coders)... so I simplified it...
891 * (and so I commit no copyright violations either, hah) */
892 #define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \
893 (*(((LPDDRAWI_DDRAWSURFACE_GBL_MORE *)(psurf_gbl)) - 1))
895 typedef struct _DDRAWI_DDRAWSURFACE_MORE {
896 DWORD dwSize;
897 IUNKNOWN_LIST * lpIUnknowns;
898 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
899 DWORD dwPageLockCount;
900 DWORD dwBytesAllocated;
901 LPDDRAWI_DIRECTDRAW_INT lpDD_int;
902 DWORD dwMipMapCount;
903 LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper;
904 /* DirectX 5.0 */
905 LPHEAPALIASINFO lpHeapAliasInfo;
906 DWORD dwOverlayFlags;
907 VOID *rgjunc;
908 LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort;
909 LPDDOVERLAYFX lpddOverlayFX;
910 DDSCAPSEX ddsCapsEx;
911 DWORD dwTextureStage;
912 LPVOID lpDDRAWReserved;
913 LPVOID lpDDRAWReserved2;
914 LPVOID lpDDrawReserved3;
915 DWORD dwDDrawReserved4;
916 LPVOID lpDDrawReserved5;
917 LPDWORD lpGammaRamp;
918 LPDWORD lpOriginalGammaRamp;
919 LPVOID lpDDrawReserved6;
920 DWORD dwSurfaceHandle;
921 DWORD qwDDrawReserved8[2];
922 LPVOID lpDDrawReserved9;
923 DWORD cSurfaces;
924 LPDDSURFACEDESC2 pCreatedDDSurfaceDesc2;
925 LPDDRAWI_DDRAWSURFACE_LCL *slist;
926 DWORD dwFVF;
927 LPVOID lpVB;
928 } DDRAWI_DDRAWSURFACE_MORE;
930 typedef struct _DDRAWI_DDRAWSURFACE_LCL {
931 LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore;
932 LPDDRAWI_DDRAWSURFACE_GBL lpGbl;
933 ULONG_PTR hDDSurface;
934 LPATTACHLIST lpAttachList;
935 LPATTACHLIST lpAttachListFrom;
936 DWORD dwLocalRefCnt;
937 DWORD dwProcessId;
938 DWORD dwFlags;
939 DDSCAPS ddsCaps;
940 LPDDRAWI_DDRAWPALETTE_INT lpDDPalette;
941 LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper;
942 DWORD dwModeCreatedIn;
943 DWORD dwBackBufferCount;
944 DDCOLORKEY ddckCKDestBlt;
945 DDCOLORKEY ddckCKSrcBlt;
946 ULONG_PTR hDC;
947 ULONG_PTR dwReserved1; /* for display driver use */
948 /* overlays only */
949 DDCOLORKEY ddckCKSrcOverlay;
950 DDCOLORKEY ddckCKDestOverlay;
951 LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying;
952 DBLNODE dbnOverlayNode;
953 RECT rcOverlaySrc;
954 RECT rcOverlayDest;
955 DWORD dwClrXparent;
956 DWORD dwAlpha;
957 LONG lOverlayX;
958 LONG lOverlayY;
959 } DDRAWI_DDRAWSURFACE_LCL;
961 #define DDRAWISURF_ATTACHED 0x00000001
962 #define DDRAWISURF_IMPLICITCREATE 0x00000002
963 #define DDRAWISURF_ISFREE 0x00000004
964 #define DDRAWISURF_ATTACHED_FROM 0x00000008
965 #define DDRAWISURF_IMPLICITROOT 0x00000010
966 #define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020
967 #define DDRAWISURF_DATAISALIASED 0x00000040
968 #define DDRAWISURF_HASDC 0x00000080
969 #define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100
970 #define DDRAWISURF_HASCKEYDESTBLT 0x00000200
971 #define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400
972 #define DDRAWISURF_HASCKEYSRCBLT 0x00000800
973 #define DDRAWISURF_LOCKEXCLUDEDCURSOR 0x00001000
974 #define DDRAWISURF_HASPIXELFORMAT 0x00002000
975 #define DDRAWISURF_HASOVERLAYDATA 0x00004000
976 #define DDRAWISURF_SETGAMMA 0x00008000
977 /* more... */
978 #define DDRAWISURF_INVALID 0x10000000
980 /* palettes */
981 typedef struct _DDRAWI_DDRAWPALETTE_INT {
982 LPVOID lpVtbl;
983 LPDDRAWI_DDRAWPALETTE_LCL lpLcl;
984 LPDDRAWI_DDRAWPALETTE_INT lpLink;
985 DWORD dwIntRefCnt;
986 } DDRAWI_DDRAWPALETTE_INT;
988 typedef struct _DDRAWI_DDRAWPALETTE_GBL {
989 DWORD dwRefCnt;
990 DWORD dwFlags;
991 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
992 DWORD dwProcessId;
993 LPPALETTEENTRY lpColorTable;
994 union {
995 ULONG_PTR dwReserved1; /* for display driver use */
996 HPALETTE hHELGDIPalette;
997 } DUMMYUNIONNAME1;
998 /* DirectX 5.0 */
999 DWORD dwDriverReserved;
1000 DWORD dwContentsStamp;
1001 /* DirectX 6.0 */
1002 DWORD dwSaveStamp;
1003 /* DirectX 7.0 */
1004 DWORD dwHandle;
1005 } DDRAWI_DDRAWPALETTE_GBL;
1007 #define DDRAWIPAL_256 0x00000001
1008 #define DDRAWIPAL_16 0x00000002
1009 #define DDRAWIPAL_GDI 0x00000004
1010 #define DDRAWIPAL_STORED_8 0x00000008
1011 #define DDRAWIPAL_STORED_16 0x00000010
1012 #define DDRAWIPAL_STORED_24 0x00000020
1013 #define DDRAWIPAL_EXCLUSIVE 0x00000040
1014 #define DDRAWIPAL_INHEL 0x00000080
1015 #define DDRAWIPAL_DIRTY 0x00000100
1016 #define DDRAWIPAL_ALLOW256 0x00000200
1017 #define DDRAWIPAL_4 0x00000400
1018 #define DDRAWIPAL_2 0x00000800
1019 #define DDRAWIPAL_STORED_8INDEX 0x00001000
1020 #define DDRAWIPAL_ALPHA 0x00002000
1022 typedef struct _DDRAWI_DDRAWPALETTE_LCL {
1023 DWORD lpPalMore;
1024 LPDDRAWI_DDRAWPALETTE_GBL lpGbl;
1025 ULONG_PTR dwUnused0;
1026 DWORD dwLocalRefCnt;
1027 IUnknown * pUnkOuter;
1028 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl;
1029 ULONG_PTR dwReserved1;
1030 /* DirectX 6.0 */
1031 ULONG_PTR dwDDRAWReserved1;
1032 ULONG_PTR dwDDRAWReserved2;
1033 ULONG_PTR dwDDRAWReserved3;
1034 } DDRAWI_DDRAWPALETTE_LCL;
1036 #ifdef __cplusplus
1037 } /* extern "C" */
1038 #endif
1040 #endif /* __WINE_DDRAWI_H */