VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/ddrawi.h@ 30705

Last change on this file since 30705 was 16477, checked in by vboxsync, 16 years ago

LGPL disclaimer by filemuncher

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette