1 /* DirectDraw driver interface */
2 /* (DirectX 7 version) */
4 #ifndef __WINE_DDRAWI_H
5 #define __WINE_DDRAWI_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 */
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
40 char szEntryPoint
[64];
42 } DD32BITDRIVERDATA
,*LPDD32BITDRIVERDATA
;
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 /*****************************************************************************
77 * driver->ddraw callbacks
79 typedef BOOL
DDAPI (*LPDDHAL_SETINFO
)(LPDDHALINFO lpDDHalInfo
, BOOL reset
);
80 typedef FLATPTR
DDAPI (*LPDDHAL_VIDMEMALLOC
)(LPDDRAWI_DIRECTDRAW_GBL lpDD
, int heap
, DWORD dwWidth
, DWORD dwHeight
);
81 typedef void DDAPI (*LPDDHAL_VIDMEMFREE
)(LPDDRAWI_DIRECTDRAW_GBL lpDD
, int heap
, FLATPTR fpMem
);
85 LPDDHAL_SETINFO lpSetInfo
;
86 LPDDHAL_VIDMEMALLOC lpVidMemAlloc
;
87 LPDDHAL_VIDMEMFREE lpVidMemFree
;
88 } DDHALDDRAWFNS
,*LPDDHALDDRAWFNS
;
90 /*****************************************************************************
93 typedef struct _DDHALMODEINFO
{
103 DWORD dwAlphaBitMask
;
104 } DDHALMODEINFO
,*LPDDHALMODEINFO
;
106 #define DDMODEINFO_PALETTIZED 0x0001
107 #define DDMODEINFO_MODEX 0x0002
108 #define DDMODEINFO_UNSUPPORTED 0x0004
109 #define DDMODEINFO_STANDARDVGA 0x0008
110 #define DDMODEINFO_MAXREFRESH 0x0010
111 #define DDMODEINFO_STEREO 0x0020
113 /*****************************************************************************
114 * video memory info structure
116 typedef struct _VIDMEM
{
131 #define VIDMEM_ISLINEAR 0x00000001
132 #define VIDMEM_ISRECTANGULAR 0x00000002
133 #define VIDMEM_ISHEAP 0x00000004
134 #define VIDMEM_ISNONLOCAL 0x00000008
135 #define VIDMEM_ISWC 0x00000010
136 #define VIDMEM_ISDISABLED 0x00000020
138 typedef struct _VIDMEMINFO
{
141 DWORD dwDisplayWidth
;
142 DWORD dwDisplayHeight
;
144 DDPIXELFORMAT ddpfDisplay
;
145 DWORD dwOffscreenAlign
;
146 DWORD dwOverlayAlign
;
147 DWORD dwTextureAlign
;
148 DWORD dwZBufferAlign
;
152 } VIDMEMINFO
,*LPVIDMEMINFO
;
154 typedef struct _HEAPALIAS
{
158 } HEAPALIAS
,*LPHEAPALIAS
;
160 typedef struct _HEAPALIASINFO
{
164 LPHEAPALIAS lpAliases
;
165 } HEAPALIASINFO
,*LPHEAPALIASINFO
;
167 #define HEAPALIASINFO_MAPPEDREAL 0x00000001
168 #define HEAPALIASINFO_MAPPEDDUMMY 0x00000002
170 /*****************************************************************************
171 * capabilities structures
173 typedef struct _DDCORECAPS
{
182 DWORD dwAlphaBltConstBitDepths
;
183 DWORD dwAlphaBltPixelBitDepths
;
184 DWORD dwAlphaBltSurfaceBitDepths
;
185 DWORD dwAlphaOverlayConstBitDepths
;
186 DWORD dwAlphaOverlayPixelBitDepths
;
187 DWORD dwAlphaOverlaySurfaceBitDepths
;
188 DWORD dwZBufferBitDepths
;
191 DWORD dwMaxVisibleOverlays
;
192 DWORD dwCurrVisibleOverlays
;
193 DWORD dwNumFourCCCodes
;
194 DWORD dwAlignBoundarySrc
;
195 DWORD dwAlignSizeSrc
;
196 DWORD dwAlignBoundaryDest
;
197 DWORD dwAlignSizeDest
;
198 DWORD dwAlignStrideAlign
;
199 DWORD dwRops
[DD_ROP_SPACE
];
201 DWORD dwMinOverlayStretch
;
202 DWORD dwMaxOverlayStretch
;
203 DWORD dwMinLiveVideoStretch
;
204 DWORD dwMaxLiveVideoStretch
;
205 DWORD dwMinHwCodecStretch
;
206 DWORD dwMaxHwCodecStretch
;
213 DWORD dwSVBRops
[DD_ROP_SPACE
];
217 DWORD dwVSBRops
[DD_ROP_SPACE
];
221 DWORD dwSSBRops
[DD_ROP_SPACE
];
222 DWORD dwMaxVideoPorts
;
223 DWORD dwCurrVideoPorts
;
225 } DDCORECAPS
,*LPDDCORECAPS
;
227 typedef struct _DDNONLOCALVIDMEMCAPS
{
231 DWORD dwNLVBCKeyCaps
;
233 DWORD dwNLVBRops
[DD_ROP_SPACE
];
234 } DDNONLOCALVIDMEMCAPS
,*LPDDNONLOCALVIDMEMCAPS
;
236 typedef struct _DDSCAPSEX
{
240 } DDSCAPSEX
,*LPDDSCAPSEX
;
242 /*****************************************************************************
243 * ddraw->driver callbacks
245 #define DDHAL_DRIVER_NOTHANDLED 0
246 #define DDHAL_DRIVER_HANDLED 1
247 #define DDHAL_DRIVER_NOCKEYHW 2
249 typedef struct _DDHAL_DESTROYDRIVERDATA
*LPDDHAL_DESTROYDRIVERDATA
;
250 typedef struct _DDHAL_CREATESURFACEDATA
*LPDDHAL_CREATESURFACEDATA
;
251 typedef struct _DDHAL_DRVSETCOLORKEYDATA
*LPDDHAL_DRVSETCOLORKEYDATA
;
252 typedef struct _DDHAL_SETMODEDATA
*LPDDHAL_SETMODEDATA
;
253 typedef struct _DDHAL_WAITFORVERTICALBLANKDATA
*LPDDHAL_WAITFORVERTICALBLANKDATA
;
254 typedef struct _DDHAL_CANCREATESURFACEDATA
*LPDDHAL_CANCREATESURFACEDATA
;
255 typedef struct _DDHAL_CREATEPALETTEDATA
*LPDDHAL_CREATEPALETTEDATA
;
256 typedef struct _DDHAL_GETSCANLINEDATA
*LPDDHAL_GETSCANLINEDATA
;
257 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA
*LPDDHAL_SETEXCLUSIVEMODEDATA
;
258 typedef struct _DDHAL_FLIPTOGDISURFACEDATA
*LPDDHAL_FLIPTOGDISURFACEDATA
;
260 typedef DWORD
PASCAL (*LPDDHAL_DESTROYDRIVER
) (LPDDHAL_DESTROYDRIVERDATA
);
261 typedef DWORD
PASCAL (*LPDDHAL_CREATESURFACE
) (LPDDHAL_CREATESURFACEDATA
);
262 typedef DWORD
PASCAL (*LPDDHAL_SETCOLORKEY
) (LPDDHAL_DRVSETCOLORKEYDATA
);
263 typedef DWORD
PASCAL (*LPDDHAL_SETMODE
) (LPDDHAL_SETMODEDATA
);
264 typedef DWORD
PASCAL (*LPDDHAL_WAITFORVERTICALBLANK
)(LPDDHAL_WAITFORVERTICALBLANKDATA
);
265 typedef DWORD
PASCAL (*LPDDHAL_CANCREATESURFACE
) (LPDDHAL_CANCREATESURFACEDATA
);
266 typedef DWORD
PASCAL (*LPDDHAL_CREATEPALETTE
) (LPDDHAL_CREATEPALETTEDATA
);
267 typedef DWORD
PASCAL (*LPDDHAL_GETSCANLINE
) (LPDDHAL_GETSCANLINEDATA
);
268 typedef DWORD
PASCAL (*LPDDHAL_SETEXCLUSIVEMODE
) (LPDDHAL_SETEXCLUSIVEMODEDATA
);
269 typedef DWORD
PASCAL (*LPDDHAL_FLIPTOGDISURFACE
) (LPDDHAL_FLIPTOGDISURFACEDATA
);
271 typedef struct _DDHAL_DDCALLBACKS
{
274 LPDDHAL_DESTROYDRIVER DestroyDriver
;
275 LPDDHAL_CREATESURFACE CreateSurface
;
276 LPDDHAL_SETCOLORKEY SetColorKey
;
277 LPDDHAL_SETMODE SetMode
;
278 LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank
;
279 LPDDHAL_CANCREATESURFACE CanCreateSurface
;
280 LPDDHAL_CREATEPALETTE CreatePalette
;
281 LPDDHAL_GETSCANLINE GetScanLine
;
283 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode
;
284 LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface
;
285 } DDHAL_DDCALLBACKS
,*LPDDHAL_DDCALLBACKS
;
287 typedef struct _DDHAL_DESTROYSURFACEDATA
*LPDDHAL_DESTROYSURFACEDATA
;
288 typedef struct _DDHAL_FLIPDATA
*LPDDHAL_FLIPDATA
;
289 typedef struct _DDHAL_SETCLIPLISTDATA
*LPDDHAL_SETCLIPLISTDATA
;
290 typedef struct _DDHAL_LOCKDATA
*LPDDHAL_LOCKDATA
;
291 typedef struct _DDHAL_UNLOCKDATA
*LPDDHAL_UNLOCKDATA
;
292 typedef struct _DDHAL_BLTDATA
*LPDDHAL_BLTDATA
;
293 typedef struct _DDHAL_SETCOLORKEYDATA
*LPDDHAL_SETCOLORKEYDATA
;
294 typedef struct _DDHAL_ADDATTACHEDSURFACEDATA
*LPDDHAL_ADDATTACHEDSURFACEDATA
;
295 typedef struct _DDHAL_GETBLTSTATUSDATA
*LPDDHAL_GETBLTSTATUSDATA
;
296 typedef struct _DDHAL_GETFLIPSTATUSDATA
*LPDDHAL_GETFLIPSTATUSDATA
;
297 typedef struct _DDHAL_UPDATEOVERLAYDATA
*LPDDHAL_UPDATEOVERLAYDATA
;
298 typedef struct _DDHAL_SETOVERLAYPOSITIONDATA
*LPDDHAL_SETOVERLAYPOSITIONDATA
;
299 typedef struct _DDHAL_SETPALETTEDATA
*LPDDHAL_SETPALETTEDATA
;
301 typedef DWORD
PASCAL (*LPDDHALSURFCB_DESTROYSURFACE
) (LPDDHAL_DESTROYSURFACEDATA
);
302 typedef DWORD
PASCAL (*LPDDHALSURFCB_FLIP
) (LPDDHAL_FLIPDATA
);
303 typedef DWORD
PASCAL (*LPDDHALSURFCB_SETCLIPLIST
) (LPDDHAL_SETCLIPLISTDATA
);
304 typedef DWORD
PASCAL (*LPDDHALSURFCB_LOCK
) (LPDDHAL_LOCKDATA
);
305 typedef DWORD
PASCAL (*LPDDHALSURFCB_UNLOCK
) (LPDDHAL_UNLOCKDATA
);
306 typedef DWORD
PASCAL (*LPDDHALSURFCB_BLT
) (LPDDHAL_BLTDATA
);
307 typedef DWORD
PASCAL (*LPDDHALSURFCB_SETCOLORKEY
) (LPDDHAL_SETCOLORKEYDATA
);
308 typedef DWORD
PASCAL (*LPDDHALSURFCB_ADDATTACHEDSURFACE
)(LPDDHAL_ADDATTACHEDSURFACEDATA
);
309 typedef DWORD
PASCAL (*LPDDHALSURFCB_GETBLTSTATUS
) (LPDDHAL_GETBLTSTATUSDATA
);
310 typedef DWORD
PASCAL (*LPDDHALSURFCB_GETFLIPSTATUS
) (LPDDHAL_GETFLIPSTATUSDATA
);
311 typedef DWORD
PASCAL (*LPDDHALSURFCB_UPDATEOVERLAY
) (LPDDHAL_UPDATEOVERLAYDATA
);
312 typedef DWORD
PASCAL (*LPDDHALSURFCB_SETOVERLAYPOSITION
)(LPDDHAL_SETOVERLAYPOSITIONDATA
);
313 typedef DWORD
PASCAL (*LPDDHALSURFCB_SETPALETTE
) (LPDDHAL_SETPALETTEDATA
);
315 typedef struct _DDHAL_DDSURFACECALLBACKS
{
318 LPDDHALSURFCB_DESTROYSURFACE DestroySurface
;
319 LPDDHALSURFCB_FLIP Flip
;
320 LPDDHALSURFCB_SETCLIPLIST SetClipList
;
321 LPDDHALSURFCB_LOCK Lock
;
322 LPDDHALSURFCB_UNLOCK Unlock
;
323 LPDDHALSURFCB_BLT Blt
;
324 LPDDHALSURFCB_SETCOLORKEY SetColorKey
;
325 LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface
;
326 LPDDHALSURFCB_GETBLTSTATUS GetBltStatus
;
327 LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus
;
328 LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay
;
329 LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition
;
331 LPDDHALSURFCB_SETPALETTE SetPalette
;
332 } DDHAL_DDSURFACECALLBACKS
,*LPDDHAL_DDSURFACECALLBACKS
;
334 typedef struct _DDHAL_DESTROYPALETTEDATA
*LPDDHAL_DESTROYPALETTEDATA
;
335 typedef struct _DDHAL_SETENTRIESDATA
*LPDDHAL_SETENTRIESDATA
;
337 typedef DWORD
PASCAL (*LPDDHALPALCB_DESTROYPALETTE
)(LPDDHAL_DESTROYPALETTEDATA
);
338 typedef DWORD
PASCAL (*LPDDHALPALCB_SETENTRIES
) (LPDDHAL_SETENTRIESDATA
);
340 typedef struct _DDHAL_DDPALETTECALLBACKS
{
343 LPDDHALPALCB_DESTROYPALETTE DestroyPalette
;
344 LPDDHALPALCB_SETENTRIES SetEntries
;
345 } DDHAL_DDPALETTECALLBACKS
,*LPDDHAL_DDPALETTECALLBACKS
;
347 typedef DWORD
PASCAL (*LPDDHALEXEBUFCB_CANCREATEEXEBUF
)(LPDDHAL_CANCREATESURFACEDATA
);
348 typedef DWORD
PASCAL (*LPDDHALEXEBUFCB_CREATEEXEBUF
) (LPDDHAL_CREATESURFACEDATA
);
349 typedef DWORD
PASCAL (*LPDDHALEXEBUFCB_DESTROYEXEBUF
) (LPDDHAL_DESTROYSURFACEDATA
);
350 typedef DWORD
PASCAL (*LPDDHALEXEBUFCB_LOCKEXEBUF
) (LPDDHAL_LOCKDATA
);
351 typedef DWORD
PASCAL (*LPDDHALEXEBUFCB_UNLOCKEXEBUF
) (LPDDHAL_UNLOCKDATA
);
353 typedef struct _DDHAL_DDEXEBUFCALLBACKS
{
356 LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer
;
357 LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer
;
358 LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer
;
359 LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer
;
360 LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer
;
361 } DDHAL_DDEXEBUFCALLBACKS
,*LPDDHAL_DDEXEBUFCALLBACKS
;
363 typedef HRESULT
WINAPI (*LPDDGAMMACALIBRATORPROC
)(LPDDGAMMARAMP
, LPBYTE
);
365 /*****************************************************************************
366 * driver info structure
368 * The HAL is queried for additional callbacks via the GetDriverInfo callback.
370 typedef struct _DDHAL_GETDRIVERINFODATA
*LPDDHAL_GETDRIVERINFODATA
;
371 typedef DWORD
PASCAL (*LPDDHAL_GETDRIVERINFO
)(LPDDHAL_GETDRIVERINFODATA
);
373 typedef struct _DDHALINFO
{
375 LPDDHAL_DDCALLBACKS lpDDCallbacks
;
376 LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks
;
377 LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks
;
380 DWORD dwMonitorFrequency
;
381 LPDDHAL_GETDRIVERINFO GetDriverInfo
;
385 LPDDHALMODEINFO lpModeInfo
;
390 ULONG_PTR lpD3DGlobalDriverData
;
391 ULONG_PTR lpD3DHALCallbacks
;
392 LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks
;
395 #define DDHALINFO_ISPRIMARYDISPLAY 0x00000001
396 #define DDHALINFO_MODEXILLEGAL 0x00000002
397 #define DDHALINFO_GETDRIVERINFOSET 0x00000004
399 /* where the high-level ddraw implementation stores the callbacks */
400 typedef struct _DDHAL_CALLBACKS
{
401 DDHAL_DDCALLBACKS cbDDCallbacks
;
402 DDHAL_DDSURFACECALLBACKS cbDDSurfaceCallbacks
;
403 DDHAL_DDPALETTECALLBACKS cbDDPaletteCallbacks
;
404 DDHAL_DDCALLBACKS HALDD
;
405 DDHAL_DDSURFACECALLBACKS HALDDSurface
;
406 DDHAL_DDPALETTECALLBACKS HALDDPalette
;
407 DDHAL_DDCALLBACKS HELDD
;
408 DDHAL_DDSURFACECALLBACKS HELDDSurface
;
409 DDHAL_DDPALETTECALLBACKS HELDDPalette
;
410 DDHAL_DDEXEBUFCALLBACKS cbDDExeBufCallbacks
;
411 DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf
;
412 DDHAL_DDEXEBUFCALLBACKS HELDDExeBuf
;
413 /* there's more... videoport, colorcontrol, misc, and motion compensation callbacks... */
414 } DDHAL_CALLBACKS
,*LPDDHAL_CALLBACKS
;
416 /*****************************************************************************
417 * parameter structures
419 typedef struct _DDHAL_DESTROYDRIVERDATA
{
420 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
422 LPDDHAL_DESTROYDRIVER DestroyDriver
;
423 } DDHAL_DESTROYDRIVERDATA
;
425 typedef struct _DDHAL_SETMODEDATA
{
426 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
429 LPDDHAL_SETMODE SetMode
;
434 typedef struct _DDHAL_CREATESURFACEDATA
{
435 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
436 LPDDSURFACEDESC lpDDSurfaceDesc
;
437 LPDDRAWI_DDRAWSURFACE_LCL
* lplpSList
;
440 LPDDHAL_CREATESURFACE CreateSurface
;
441 } DDHAL_CREATESURFACEDATA
;
443 typedef struct _DDHAL_CANCREATESURFACEDATA
{
444 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
445 LPDDSURFACEDESC lpDDSurfaceDesc
;
446 DWORD bIsDifferentPixelFormat
;
448 LPDDHAL_CANCREATESURFACE CanCreateSurface
;
449 } DDHAL_CANCREATESURFACEDATA
;
451 typedef struct _DDHAL_CREATEPALETTEDATA
{
452 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
453 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
;
454 LPPALETTEENTRY lpColorTable
;
456 LPDDHAL_CREATEPALETTE CreatePalette
;
458 } DDHAL_CREATEPALETTEDATA
;
460 typedef struct _DDHAL_SETEXCLUSIVEMODEDATA
{
461 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
465 LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode
;
466 } DDHAL_SETEXCLUSIVEMODEDATA
;
469 typedef struct _DDHAL_DESTROYSURFACEDATA
{
470 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
471 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
;
473 LPDDHALSURFCB_DESTROYSURFACE DestroySurface
;
474 } DDHAL_DESTROYSURFACEDATA
;
476 typedef struct _DDHAL_BLTDATA
{
477 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
478 LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface
;
480 LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface
;
486 LPDDHALSURFCB_BLT Blt
;
494 typedef struct _DDHAL_SETPALETTEDATA
{
495 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
496 LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
;
497 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
;
499 LPDDHALSURFCB_SETPALETTE SetPalette
;
501 } DDHAL_SETPALETTEDATA
;
504 typedef struct _DDHAL_DESTROYPALETTEDATA
{
505 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
506 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
;
508 LPDDHALPALCB_DESTROYPALETTE DestroyPalette
;
509 } DDHAL_DESTROYPALETTEDATA
;
511 typedef struct _DDHAL_SETENTRIESDATA
{
512 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
513 LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
;
516 LPPALETTEENTRY lpEntries
;
518 LPDDHALPALCB_SETENTRIES SetEntries
;
519 } DDHAL_SETENTRIESDATA
;
521 typedef struct _DDHAL_GETDRIVERINFODATA
{
525 DWORD dwExpectedSize
;
530 } DDHAL_GETDRIVERINFODATA
;
532 /*****************************************************************************
533 * high-level ddraw implementation structures
535 typedef struct _IUNKNOWN_LIST
{
536 struct _IUNKNOWN_LIST
* lpLink
;
538 IUnknown
* lpIUnknown
;
539 } IUNKNOWN_LIST
,*LPIUNKNOWN_LIST
;
541 typedef struct _PROCESS_LIST
{
542 struct _PROCESS_LIST
* lpLink
;
547 } PROCESS_LIST
,*LPPROCESS_LIST
;
549 typedef struct _ATTACHLIST
{
551 struct _ATTACHLIST
* lpLink
;
552 LPDDRAWI_DDRAWSURFACE_LCL lpAttached
;
553 LPDDRAWI_DDRAWSURFACE_INT lpIAttached
;
554 } ATTACHLIST
,*LPATTACHLIST
;
556 #define DDAL_IMPLICIT 0x00000001
558 typedef struct _ACCESSRECTLIST
{
559 struct _ACCESSRECTLIST
* lpLink
;
561 LPDDRAWI_DIRECTDRAW_LCL lpOwner
;
562 LPVOID lpSurfaceData
;
564 LPHEAPALIASINFO lpHeapAliasInfo
;
565 } ACCESSRECTLIST
,*LPACCESSRECTLIST
;
567 #define ACCESSRECT_VRAMSTYLE 0x00000001
568 #define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002
569 #define ACCESSRECT_BROKEN 0x00000004
571 typedef struct _DBLNODE
{
572 struct _DBLNODE
* next
;
573 struct _DBLNODE
* prev
;
574 LPDDRAWI_DDRAWSURFACE_LCL object
;
575 LPDDRAWI_DDRAWSURFACE_INT object_int
;
576 } DBLNODE
,*LPDBLNODE
;
578 typedef struct _DDRAWI_DIRECTDRAW_INT
{
580 LPDDRAWI_DIRECTDRAW_LCL lpLcl
;
581 LPDDRAWI_DIRECTDRAW_INT lpLink
;
583 } DDRAWI_DIRECTDRAW_INT
;
585 typedef struct _DDRAWI_DIRECTDRAW_LCL
{
587 LPDDRAWI_DIRECTDRAW_GBL lpGbl
;
592 IUnknown
* pUnkOuter
;
597 LPDDRAWI_DDRAWSURFACE_INT lpPrimary
;
598 LPDDRAWI_DDRAWSURFACE_INT lpCB
;
599 DWORD dwPreferredMode
;
601 HINSTANCE hD3DInstance
;
602 IUnknown
* pD3DIUnknown
;
603 LPDDHAL_CALLBACKS lpDDCB
;
606 DWORD dwAppHackFlags
;
614 ULONG_PTR hGammaCalibrator
;
615 LPDDGAMMACALIBRATORPROC lpGammaCalibrator
;
616 } DDRAWI_DIRECTDRAW_LCL
;
618 #define DDRAWILCL_HASEXCLUSIVEMODE 0x00000001
619 #define DDRAWILCL_ISFULLSCREEN 0x00000002
620 #define DDRAWILCL_SETCOOPCALLED 0x00000004
621 #define DDRAWILCL_ACTIVEYES 0x00000008
622 #define DDRAWILCL_ACTIVENO 0x00000010
623 #define DDRAWILCL_HOOKEDHWND 0x00000020
624 #define DDRAWILCL_ALLOWMODEX 0x00000040
625 #define DDRAWILCL_V1SCLBEHAVIOUR 0x00000080
626 #define DDRAWILCL_MODEHASBEENCHANGED 0x00000100
627 #define DDRAWILCL_CREATEDWINDOW 0x00000200
628 #define DDRAWILCL_DIRTYDC 0x00000400
629 #define DDRAWILCL_DISABLEINACTIVATE 0x00000800
630 #define DDRAWILCL_CURSORCLIPPED 0x00001000
631 #define DDRAWILCL_EXPLICITMONITOR 0x00002000
632 #define DDRAWILCL_MULTITHREADED 0x00004000
633 #define DDRAWILCL_FPUSETUP 0x00008000
634 #define DDRAWILCL_POWEREDDOWN 0x00010000
635 #define DDRAWILCL_DIRECTDRAW7 0x00020000
636 #define DDRAWILCL_ATTEMPTEDD3DCONTEXT 0x00040000
637 #define DDRAWILCL_FPUPRESERVE 0x00080000
639 typedef struct _DDRAWI_DIRECTDRAW_GBL
{
642 FLATPTR fpPrimaryOrig
;
646 LPDDHAL_CALLBACKS lpDDCBtmp
;
647 LPDDRAWI_DDRAWSURFACE_INT dsList
;
648 LPDDRAWI_DDRAWPALETTE_INT palList
;
649 LPDDRAWI_DDRAWCLIPPER_INT clipperList
;
650 LPDDRAWI_DIRECTDRAW_GBL lp16DD
;
652 DWORD dwCurrOverlays
;
653 DWORD dwMonitorFrequency
;
654 DDCORECAPS ddHELCaps
;
656 DDCOLORKEY ddckCKDestOverlay
;
657 DDCOLORKEY ddckCKSrcOverlay
;
659 LPVOID lpDriverHandle
;
660 LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner
;
662 DWORD dwModeIndexOrig
;
666 LPDDHALMODEINFO lpModeInfo
;
667 PROCESS_LIST plProcessList
;
668 DWORD dwSurfaceLockCount
;
669 DWORD dwAliasedLockCnt
;
670 ULONG_PTR dwReserved3
;
675 DBLNODE dbnOverlayRoot
;
676 volatile LPWORD lpwPDeviceFlags
;
678 DWORD dwWin16LockCnt
;
682 DWORD dwSaveNumModes
;
684 ULONG_PTR lpD3DGlobalDriverData
;
685 ULONG_PTR lpD3DHALCallbacks
;
686 DDCORECAPS ddBothCaps
;
688 LPDDVIDEOPORTCAPS lpDDVideoPortCaps
;
689 LPDDRAWI_DDVIDEOPORT_INT dvpList
;
690 ULONG_PTR lpD3DHALCallbacks2
;
695 LPHEAPALIASINFO phaiHeapAliases
;
696 ULONG_PTR hKernelHandle
;
697 ULONG_PTR pfnNotifyProc
;
698 LPDDKERNELCAPS lpDDKernelCaps
;
699 LPDDNONLOCALVIDMEMCAPS lpddNLVCaps
;
700 LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps
;
701 LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps
;
702 ULONG_PTR lpD3DExtendedCaps
;
706 char cDriverName
[MAX_DRIVER_NAME
];
708 ULONG_PTR lpD3DHALCallbacks3
;
709 DWORD dwNumZPixelFormats
;
710 LPDDPIXELFORMAT lpZPixelFormats
;
711 LPDDRAWI_DDMOTIONCOMP_INT mcList
;
713 DDSCAPSEX ddsCapsMore
;
714 } DDRAWI_DIRECTDRAW_GBL
;
716 #define DDRAWI_VIRTUALDESKTOP 0x00000008
717 #define DDRAWI_MODEX 0x00000010
718 #define DDRAWI_DISPLAYDRV 0x00000020
719 #define DDRAWI_FULLSCREEN 0x00000040
720 #define DDRAWI_MODECHANGED 0x00000080
721 #define DDRAWI_NOHARDWARE 0x00000100
722 #define DDRAWI_PALETTEINIT 0x00000200
723 #define DDRAWI_NOEMULATION 0x00000400
727 typedef struct _DDRAWI_DDRAWSURFACE_INT
{
729 LPDDRAWI_DDRAWSURFACE_LCL lpLcl
;
730 LPDDRAWI_DDRAWSURFACE_INT lpLink
;
732 } DDRAWI_DDRAWSURFACE_INT
;
734 typedef struct _DDRAWI_DDRAWSURFACE_GBL
{
738 LPACCESSRECTLIST lpRectList
;
742 LPVMEMHEAP lpVidMemHeap
;
746 LPDDRAWI_DIRECTDRAW_GBL lpDD
;
757 ULONG_PTR dwReserved1
; /* for display driver use */
758 /* optional (defaults to primary surface pixelformat) */
759 DDPIXELFORMAT ddpfSurface
;
760 } DDRAWI_DDRAWSURFACE_GBL
;
762 #define DDRAWISURFGBL_MEMFREE 0x00000001
763 #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002
764 #define DDRAWISURFGBL_ISGDISURFACE 0x00000004
765 #define DDRAWISURFGBL_SOFTWAREAUTOFLIP 0x00000008
766 #define DDRAWISURFGBL_LOCKNOTHOLDINGWIN16LOCK 0x00000010
767 #define DDRAWISURFGBL_LOCKVRAMSTYLE 0x00000020
768 #define DDRAWISURFGBL_LOCKBROKEN 0x00000040
769 #define DDRAWISURFGBL_IMPLICITHANDLE 0x00000080
770 #define DDRAWISURFGBL_ISCLIENTMEM 0x00000100
771 #define DDRAWISURFGBL_HARDWAREOPSOURCE 0x00000200
772 #define DDRAWISURFGBL_HARDWAREOPDEST 0x00000400
773 #define DDRAWISURFGBL_HARDWAREOPSTARTED 0x00000600
774 #define DDRAWISURFGBL_VPORTINTERLEAVED 0x00000800
775 #define DDRAWISURFGBL_VPORTDATA 0x00001000
776 #define DDRAWISURFGBL_LATEALLOCATELINEAR 0x00002000
777 #define DDRAWISURFGBL_SYSMEMEXECUTEBUFFER 0x00004000
778 #define DDRAWISURFGBL_FASTLOCKHELD 0x00008000
779 #define DDRAWISURFGBL_READONLYLOCKHELD 0x00010000
781 typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE
{
784 DWORD dwPhysicalPageTable
;
785 FLATPTR fpPhysicalVidMem
;
789 ULONG_PTR dwSavedDCContext
;
790 FLATPTR fpAliasedVidMem
;
791 ULONG_PTR dwDriverReserved
;
792 ULONG_PTR dwHELReserved
;
794 ULONG_PTR hKernelSurface
;
795 DWORD dwKernelRefCnt
;
796 LPDDCOLORCONTROL lpColorInfo
;
798 DWORD dwContentsStamp
;
799 LPVOID lpvUnswappedDriverReserved
;
800 LPVOID lpDDRAWReserved2
;
801 DWORD dwDDRAWReserved1
;
802 DWORD dwDDRAWReserved2
;
803 FLATPTR fpAliasOfVidMem
;
804 } DDRAWI_DDRAWSURFACE_GBL_MORE
;
806 /* the MS version of this macro was somewhat obfuscated and unreadable
807 * (possibly because of mediocre MS coders)... so I simplified it...
808 * (and so I commit no copyright violations either, hah) */
809 #define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \
810 (*(((LPDDRAWI_DDRAWSURFACE_GBL_MORE *)(psurf_gbl)) - 1))
812 typedef struct _DDRAWI_DDRAWSURFACE_MORE
{
814 IUNKNOWN_LIST
* lpIUnknowns
;
815 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
;
816 DWORD dwPageLockCount
;
817 DWORD dwBytesAllocated
;
818 LPDDRAWI_DIRECTDRAW_INT lpDD_int
;
820 LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper
;
823 } DDRAWI_DDRAWSURFACE_MORE
;
825 typedef struct _DDRAWI_DDRAWSURFACE_LCL
{
826 LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore
;
827 LPDDRAWI_DDRAWSURFACE_GBL lpGbl
;
828 ULONG_PTR hDDSurface
;
829 LPATTACHLIST lpAttachList
;
830 LPATTACHLIST lpAttachListFrom
;
835 LPDDRAWI_DDRAWPALETTE_INT lpDDPalette
;
836 LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper
;
837 DWORD dwModeCreatedIn
;
838 DWORD dwBackBufferCount
;
839 DDCOLORKEY ddckCKDestBlt
;
840 DDCOLORKEY ddckCKSrcBlt
;
842 ULONG_PTR dwReserved1
; /* for display driver use */
844 DDCOLORKEY ddckCKSrcOverlay
;
845 DDCOLORKEY ddckCKDestOverlay
;
846 LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying
;
847 DBLNODE dbnOverlayNode
;
854 } DDRAWI_DDRAWSURFACE_LCL
;
856 #define DDRAWISURF_ATTACHED 0x00000001
857 #define DDRAWISURF_IMPLICITCREATE 0x00000002
858 #define DDRAWISURF_ISFREE 0x00000004
859 #define DDRAWISURF_ATTACHED_FROM 0x00000008
860 #define DDRAWISURF_IMPLICITROOT 0x00000010
861 #define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020
862 #define DDRAWISURF_DATAISALIASED 0x00000040
863 #define DDRAWISURF_HASDC 0x00000080
864 #define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100
865 #define DDRAWISURF_HASCKEYDESTBLT 0x00000200
866 #define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400
867 #define DDRAWISURF_HASCKEYSRCBLT 0x00000800
868 #define DDRAWISURF_LOCKEXCLUDEDCURSOR 0x00001000
869 #define DDRAWISURF_HASPIXELFORMAT 0x00002000
870 #define DDRAWISURF_HASOVERLAYDATA 0x00004000
871 #define DDRAWISURF_SETGAMMA 0x00008000
873 #define DDRAWISURF_INVALID 0x10000000
876 typedef struct _DDRAWI_DDRAWPALETTE_INT
{
878 LPDDRAWI_DDRAWPALETTE_LCL lpLcl
;
879 LPDDRAWI_DDRAWPALETTE_INT lpLink
;
881 } DDRAWI_DDRAWPALETTE_INT
;
883 typedef struct _DDRAWI_DDRAWPALETTE_GBL
{
886 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
;
888 LPPALETTEENTRY lpColorTable
;
890 ULONG_PTR dwReserved1
; /* for display driver use */
891 HPALETTE hHELGDIPalette
;
894 DWORD dwDriverReserved
;
895 DWORD dwContentsStamp
;
900 } DDRAWI_DDRAWPALETTE_GBL
;
902 #define DDRAWIPAL_256 0x00000001
903 #define DDRAWIPAL_16 0x00000002
904 #define DDRAWIPAL_GDI 0x00000004
905 #define DDRAWIPAL_STORED_8 0x00000008
906 #define DDRAWIPAL_STORED_16 0x00000010
907 #define DDRAWIPAL_STORED_24 0x00000020
908 #define DDRAWIPAL_EXCLUSIVE 0x00000040
909 #define DDRAWIPAL_INHEL 0x00000080
910 #define DDRAWIPAL_DIRTY 0x00000100
911 #define DDRAWIPAL_ALLOW256 0x00000200
912 #define DDRAWIPAL_4 0x00000400
913 #define DDRAWIPAL_2 0x00000800
914 #define DDRAWIPAL_STORED_8INDEX 0x00001000
915 #define DDRAWIPAL_ALPHA 0x00002000
917 typedef struct _DDRAWI_DDRAWPALETTE_LCL
{
919 LPDDRAWI_DDRAWPALETTE_GBL lpGbl
;
922 IUnknown
* pUnkOuter
;
923 LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
;
924 ULONG_PTR dwReserved1
;
926 ULONG_PTR dwDDRAWReserved1
;
927 ULONG_PTR dwDDRAWReserved2
;
928 ULONG_PTR dwDDRAWReserved3
;
929 } DDRAWI_DDRAWPALETTE_LCL
;
935 #endif /* __WINE_DDRAWI_H */