Windows NT 4.0 source code leak
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

741 lines
31 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1995-1996, Microsoft Corporation
  3. Module Name:
  4. ddrawint.h
  5. Abstract:
  6. Private entry points, defines and types for Windows NT DirectDraw
  7. driver interface. Corresponds to Windows' 'ddrawi.h' file.
  8. --*/
  9. #ifndef __DD_INCLUDED__
  10. #define __DD_INCLUDED__
  11. #define _NO_COM
  12. #include "ddraw.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #define MAKE_HRESULT(sev,fac,code) \
  17. ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
  18. /*
  19. * offset into video meory
  20. */
  21. typedef unsigned long FLATPTR;
  22. /*
  23. * pre-declare pointers to structs containing data for DDHAL driver fns
  24. */
  25. typedef struct _DD_CREATEPALETTEDATA *PDD_CREATEPALETTEDATA;
  26. typedef struct _DD_CREATESURFACEDATA *PDD_CREATESURFACEDATA;
  27. typedef struct _DD_CANCREATESURFACEDATA *PDD_CANCREATESURFACEDATA;
  28. typedef struct _DD_WAITFORVERTICALBLANKDATA *PDD_WAITFORVERTICALBLANKDATA;
  29. typedef struct _DD_DESTROYDRIVERDATA *PDD_DESTROYDRIVERDATA;
  30. typedef struct _DD_SETMODEDATA *PDD_SETMODEDATA;
  31. typedef struct _DD_DRVSETCOLORKEYDATA *PDD_DRVSETCOLORKEYDATA;
  32. typedef struct _DD_GETSCANLINEDATA *PDD_GETSCANLINEDATA;
  33. typedef struct _DD_MAPMEMORYDATA *PDD_MAPMEMORYDATA;
  34. typedef struct _DD_DESTROYPALETTEDATA *PDD_DESTROYPALETTEDATA;
  35. typedef struct _DD_SETENTRIESDATA *PDD_SETENTRIESDATA;
  36. typedef struct _DD_BLTDATA *PDD_BLTDATA;
  37. typedef struct _DD_LOCKDATA *PDD_LOCKDATA;
  38. typedef struct _DD_UNLOCKDATA *PDD_UNLOCKDATA;
  39. typedef struct _DD_UPDATEOVERLAYDATA *PDD_UPDATEOVERLAYDATA;
  40. typedef struct _DD_SETOVERLAYPOSITIONDATA *PDD_SETOVERLAYPOSITIONDATA;
  41. typedef struct _DD_SETPALETTEDATA *PDD_SETPALETTEDATA;
  42. typedef struct _DD_FLIPDATA *PDD_FLIPDATA;
  43. typedef struct _DD_DESTROYSURFACEDATA *PDD_DESTROYSURFACEDATA;
  44. typedef struct _DD_SETCLIPLISTDATA *PDD_SETCLIPLISTDATA;
  45. typedef struct _DD_ADDATTACHEDSURFACEDATA *PDD_ADDATTACHEDSURFACEDATA;
  46. typedef struct _DD_SETCOLORKEYDATA *PDD_SETCOLORKEYDATA;
  47. typedef struct _DD_GETBLTSTATUSDATA *PDD_GETBLTSTATUSDATA;
  48. typedef struct _DD_GETFLIPSTATUSDATA *PDD_GETFLIPSTATUSDATA;
  49. /*
  50. * value in the fpVidMem; indicates dwBlockSize is valid (surface object)
  51. */
  52. #define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l
  53. #define DDHAL_PLEASEALLOC_USERMEM 0x00000004l
  54. /*
  55. * video memory data structures (passed in DD_HALINFO)
  56. */
  57. typedef struct _VIDEOMEMORY
  58. {
  59. DWORD dwFlags; // flags
  60. FLATPTR fpStart; // start of memory chunk
  61. union
  62. {
  63. FLATPTR fpEnd; // end of memory chunk
  64. DWORD dwWidth; // width of chunk (rectanglar memory)
  65. };
  66. DDSCAPS ddsCaps; // what this memory CANNOT be used for
  67. DDSCAPS ddsCapsAlt; // what this memory CANNOT be used for if it must
  68. DWORD dwHeight; // height of chunk (rectanguler memory)
  69. } VIDEOMEMORY;
  70. typedef VIDEOMEMORY *LPVIDEOMEMORY;
  71. /*
  72. * flags for vidmem struct
  73. */
  74. #define VIDMEM_ISLINEAR 0x00000001l
  75. #define VIDMEM_ISRECTANGULAR 0x00000002l
  76. #define VIDMEM_ISHEAP 0x00000004l
  77. typedef struct _VIDEOMEMORYINFO
  78. {
  79. FLATPTR fpPrimary; // offset to primary surface
  80. DWORD dwFlags; // flags
  81. DWORD dwDisplayWidth; // current display width
  82. DWORD dwDisplayHeight; // current display height
  83. LONG lDisplayPitch; // current display pitch
  84. DDPIXELFORMAT ddpfDisplay; // pixel format of display
  85. DWORD dwOffscreenAlign; // byte alignment for offscreen surfaces
  86. DWORD dwOverlayAlign; // byte alignment for overlays
  87. DWORD dwTextureAlign; // byte alignment for textures
  88. DWORD dwZBufferAlign; // byte alignment for z buffers
  89. DWORD dwAlphaAlign; // byte alignment for alpha
  90. PVOID pvPrimary; // kernel-mode pointer to primary surface
  91. } VIDEOMEMORYINFO;
  92. typedef VIDEOMEMORYINFO *LPVIDEOMEMORYINFO;
  93. /*
  94. * These structures contain the entry points in the display driver that
  95. * DDRAW will call. Entries that the display driver does not care about
  96. * should be NULL. Passed to DDRAW in DD_HALINFO.
  97. */
  98. typedef struct _DD_DIRECTDRAW_GLOBAL *PDD_DIRECTDRAW_GLOBAL;
  99. typedef struct _DD_SURFACE_GLOBAL *PDD_SURFACE_GLOBAL;
  100. typedef struct _DD_PALETTE_GLOBAL *PDD_PALETTE_GLOBAL;
  101. typedef struct _DD_CLIPPER_GLOBAL *PDD_CLIPPER_GLOBAL;
  102. typedef struct _DD_DIRECTDRAW_LOCAL *PDD_DIRECTDRAW_LOCAL;
  103. typedef struct _DD_SURFACE_LOCAL *PDD_SURFACE_LOCAL;
  104. typedef struct _DD_PALETTE_LOCAL *PDD_PALETTE_LOCAL;
  105. typedef struct _DD_CLIPPER_LOCAL *PDD_CLIPPER_LOCAL;
  106. /*
  107. * DIRECTDRAW object callbacks
  108. */
  109. typedef DWORD (APIENTRY *PDD_SETCOLORKEY)(PDD_DRVSETCOLORKEYDATA );
  110. typedef DWORD (APIENTRY *PDD_CANCREATESURFACE)(PDD_CANCREATESURFACEDATA );
  111. typedef DWORD (APIENTRY *PDD_WAITFORVERTICALBLANK)(PDD_WAITFORVERTICALBLANKDATA );
  112. typedef DWORD (APIENTRY *PDD_CREATESURFACE)(PDD_CREATESURFACEDATA);
  113. typedef DWORD (APIENTRY *PDD_DESTROYDRIVER)(PDD_DESTROYDRIVERDATA);
  114. typedef DWORD (APIENTRY *PDD_SETMODE)(PDD_SETMODEDATA);
  115. typedef DWORD (APIENTRY *PDD_CREATEPALETTE)(PDD_CREATEPALETTEDATA);
  116. typedef DWORD (APIENTRY *PDD_GETSCANLINE)(PDD_GETSCANLINEDATA);
  117. typedef DWORD (APIENTRY *PDD_MAPMEMORY)(PDD_MAPMEMORYDATA);
  118. typedef struct DD_CALLBACKS
  119. {
  120. DWORD dwSize;
  121. DWORD dwFlags;
  122. PDD_DESTROYDRIVER DestroyDriver;
  123. PDD_CREATESURFACE CreateSurface;
  124. PDD_SETCOLORKEY SetColorKey;
  125. PDD_SETMODE SetMode;
  126. PDD_WAITFORVERTICALBLANK WaitForVerticalBlank;
  127. PDD_CANCREATESURFACE CanCreateSurface;
  128. PDD_CREATEPALETTE CreatePalette;
  129. PDD_GETSCANLINE GetScanLine;
  130. PDD_MAPMEMORY MapMemory;
  131. } DD_CALLBACKS;
  132. typedef DD_CALLBACKS *PDD_CALLBACKS;
  133. #define DDHAL_CB32_DESTROYDRIVER 0x00000001l
  134. #define DDHAL_CB32_CREATESURFACE 0x00000002l
  135. #define DDHAL_CB32_SETCOLORKEY 0x00000004l
  136. #define DDHAL_CB32_SETMODE 0x00000008l
  137. #define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l
  138. #define DDHAL_CB32_CANCREATESURFACE 0x00000020l
  139. #define DDHAL_CB32_CREATEPALETTE 0x00000040l
  140. #define DDHAL_CB32_GETSCANLINE 0x00000080l
  141. #define DDHAL_CB32_MAPMEMORY 0x80000000l
  142. /*
  143. * DIRECTDRAWPALETTE object callbacks
  144. */
  145. typedef DWORD (APIENTRY *PDD_PALCB_DESTROYPALETTE)(PDD_DESTROYPALETTEDATA );
  146. typedef DWORD (APIENTRY *PDD_PALCB_SETENTRIES)(PDD_SETENTRIESDATA );
  147. typedef struct DD_PALETTECALLBACKS
  148. {
  149. DWORD dwSize;
  150. DWORD dwFlags;
  151. PDD_PALCB_DESTROYPALETTE DestroyPalette;
  152. PDD_PALCB_SETENTRIES SetEntries;
  153. } DD_PALETTECALLBACKS;
  154. typedef DD_PALETTECALLBACKS *PDD_PALETTECALLBACKS;
  155. #define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l
  156. #define DDHAL_PALCB32_SETENTRIES 0x00000002l
  157. /*
  158. * DIRECTDRAWSURFACE object callbacks
  159. */
  160. typedef DWORD (APIENTRY *PDD_SURFCB_LOCK)(PDD_LOCKDATA);
  161. typedef DWORD (APIENTRY *PDD_SURFCB_UNLOCK)(PDD_UNLOCKDATA);
  162. typedef DWORD (APIENTRY *PDD_SURFCB_BLT)(PDD_BLTDATA);
  163. typedef DWORD (APIENTRY *PDD_SURFCB_UPDATEOVERLAY)(PDD_UPDATEOVERLAYDATA);
  164. typedef DWORD (APIENTRY *PDD_SURFCB_SETOVERLAYPOSITION)(PDD_SETOVERLAYPOSITIONDATA);
  165. typedef DWORD (APIENTRY *PDD_SURFCB_SETPALETTE)(PDD_SETPALETTEDATA);
  166. typedef DWORD (APIENTRY *PDD_SURFCB_FLIP)(PDD_FLIPDATA);
  167. typedef DWORD (APIENTRY *PDD_SURFCB_DESTROYSURFACE)(PDD_DESTROYSURFACEDATA);
  168. typedef DWORD (APIENTRY *PDD_SURFCB_SETCLIPLIST)(PDD_SETCLIPLISTDATA);
  169. typedef DWORD (APIENTRY *PDD_SURFCB_ADDATTACHEDSURFACE)(PDD_ADDATTACHEDSURFACEDATA);
  170. typedef DWORD (APIENTRY *PDD_SURFCB_SETCOLORKEY)(PDD_SETCOLORKEYDATA);
  171. typedef DWORD (APIENTRY *PDD_SURFCB_GETBLTSTATUS)(PDD_GETBLTSTATUSDATA);
  172. typedef DWORD (APIENTRY *PDD_SURFCB_GETFLIPSTATUS)(PDD_GETFLIPSTATUSDATA);
  173. typedef struct DD_SURFACECALLBACKS
  174. {
  175. DWORD dwSize;
  176. DWORD dwFlags;
  177. PDD_SURFCB_DESTROYSURFACE DestroySurface;
  178. PDD_SURFCB_FLIP Flip;
  179. PDD_SURFCB_SETCLIPLIST SetClipList;
  180. PDD_SURFCB_LOCK Lock;
  181. PDD_SURFCB_UNLOCK Unlock;
  182. PDD_SURFCB_BLT Blt;
  183. PDD_SURFCB_SETCOLORKEY SetColorKey;
  184. PDD_SURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
  185. PDD_SURFCB_GETBLTSTATUS GetBltStatus;
  186. PDD_SURFCB_GETFLIPSTATUS GetFlipStatus;
  187. PDD_SURFCB_UPDATEOVERLAY UpdateOverlay;
  188. PDD_SURFCB_SETOVERLAYPOSITION SetOverlayPosition;
  189. LPVOID reserved4;
  190. PDD_SURFCB_SETPALETTE SetPalette;
  191. } DD_SURFACECALLBACKS;
  192. typedef DD_SURFACECALLBACKS *PDD_SURFACECALLBACKS;
  193. #define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001l
  194. #define DDHAL_SURFCB32_FLIP 0x00000002l
  195. #define DDHAL_SURFCB32_SETCLIPLIST 0x00000004l
  196. #define DDHAL_SURFCB32_LOCK 0x00000008l
  197. #define DDHAL_SURFCB32_UNLOCK 0x00000010l
  198. #define DDHAL_SURFCB32_BLT 0x00000020l
  199. #define DDHAL_SURFCB32_SETCOLORKEY 0x00000040l
  200. #define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080l
  201. #define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100l
  202. #define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200l
  203. #define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400l
  204. #define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800l
  205. #define DDHAL_SURFCB32_RESERVED4 0x00001000l
  206. #define DDHAL_SURFCB32_SETPALETTE 0x00002000l
  207. /*
  208. * CALLBACK RETURN VALUES
  209. *
  210. * these are values returned by the driver from the above callback routines
  211. */
  212. /*
  213. * indicates that the display driver didn't do anything with the call
  214. */
  215. #define DDHAL_DRIVER_NOTHANDLED 0x00000000l
  216. /*
  217. * indicates that the display driver handled the call; HRESULT value is valid
  218. */
  219. #define DDHAL_DRIVER_HANDLED 0x00000001l
  220. /*
  221. * indicates that the display driver couldn't handle the call because it
  222. * ran out of color key hardware resources
  223. */
  224. #define DDHAL_DRIVER_NOCKEYHW 0x00000002l
  225. /*
  226. * DDRAW internal version of DIRECTDRAWPALETTE object; it has data after the vtable
  227. */
  228. typedef struct _DD_PALETTE_GLOBAL
  229. {
  230. DWORD dwReserved1; // reserved for use by display driver
  231. } DD_PALETTE_GLOBAL;
  232. typedef struct _DD_PALETTE_LOCAL
  233. {
  234. DWORD dwReserved0; // reserved for future expansion
  235. DWORD dwReserved1; // reserved for use by display driver
  236. } DD_PALETTE_LOCAL;
  237. #define DDRAWIPAL_256 0x00000001l // 256 entry palette
  238. #define DDRAWIPAL_16 0x00000002l // 16 entry palette
  239. #define DDRAWIPAL_GDI 0x00000004l // palette allocated through GDI
  240. #define DDRAWIPAL_STORED_8 0x00000008l // palette stored as 8bpp/entry
  241. #define DDRAWIPAL_STORED_16 0x00000010l // palette stored as 16bpp/entry
  242. #define DDRAWIPAL_STORED_24 0x00000020l // palette stored as 24bpp/entry
  243. #define DDRAWIPAL_EXCLUSIVE 0x00000040l // palette being used in exclusive mode
  244. #define DDRAWIPAL_INHEL 0x00000080l // palette is done in the hel
  245. #define DDRAWIPAL_DIRTY 0x00000100l // gdi palette out 'o sync
  246. #define DDRAWIPAL_ALLOW256 0x00000200l // can fully update palette
  247. #define DDRAWIPAL_4 0x00000400l // 4 entry palette
  248. #define DDRAWIPAL_2 0x00000800l // 2 entry palette
  249. #define DDRAWIPAL_STORED_8INDEX 0x00001000l // palatte stored as 8-bit index into dst palette
  250. /*
  251. * DDRAW internal version of DIRECTDRAWCLIPPER object; it has data after the vtable
  252. */
  253. typedef struct _DD_CLIPPER_GLOBAL
  254. {
  255. DWORD dwReserved1; // reserved for use by display driver
  256. } DD_CLIPPER_GLOBAL;
  257. typedef struct _DD_CLIPPER_LOCAL
  258. {
  259. DWORD dwReserved1; // reserved for use by display driver
  260. } DD_CLIPPER_LOCAL;
  261. /*
  262. * DDRAW internal version of DIRECTDRAWSURFACE struct
  263. *
  264. * the GBL structure is global data for all duplicate objects
  265. */
  266. typedef struct _DD_SURFACE_GLOBAL
  267. {
  268. DWORD dwBlockSizeY; // block size that display driver requested (return)
  269. union {
  270. DWORD dwBlockSizeX; // block size that display driver requested (return)
  271. DWORD dwUserMemSize; // user-mode memory size that display driver requested (return)
  272. };
  273. FLATPTR fpVidMem; // pointer to video memory
  274. LONG lPitch; // pitch of surface
  275. LONG yHint; // y-coordinate of surface
  276. LONG xHint; // x-coordinate of surface
  277. DWORD wHeight; // height of surface
  278. DWORD wWidth; // width of surface
  279. DWORD dwReserved1; // reserved for use by display driver
  280. DDPIXELFORMAT ddpfSurface; // pixel format of surface
  281. } DD_SURFACE_GLOBAL;
  282. /*
  283. * the LCL structure is local data for each individual surface object
  284. */
  285. struct _DD_SURFACE_LOCAL
  286. {
  287. PDD_SURFACE_GLOBAL lpGbl; // pointer to surface shared data
  288. DWORD dwFlags; // flags
  289. DDSCAPS ddsCaps; // capabilities of surface
  290. DWORD dwReserved1; // reserved for use by display driver
  291. DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
  292. DDCOLORKEY ddckCKDestOverlay;// color key for destination overlay use
  293. };
  294. typedef struct _DD_SURFACE_LOCAL DD_SURFACE_LOCAL;
  295. #define DDRAWISURFGBL_MEMFREE 0x00000001L // video memory has been freed
  296. #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002L // surface is in system memory at request of user
  297. #define DDRAWISURFGBL_ISGDISURFACE 0x00000004L // This surface represents what GDI thinks is front buffer
  298. /*
  299. * NOTE: This flag was previously DDRAWISURFGBL_INVALID. This flags has been retired
  300. * and replaced by DDRAWISURF_INVALID in the local object.
  301. */
  302. #define DDRAWISURFGBL_RESERVED0 0x80000000L // Reserved flag
  303. #define DDRAWISURF_ATTACHED 0x00000001L // surface is attached to another
  304. #define DDRAWISURF_IMPLICITCREATE 0x00000002L // surface implicitly created
  305. #define DDRAWISURF_ISFREE 0x00000004L // surface already freed (temp flag)
  306. #define DDRAWISURF_ATTACHED_FROM 0x00000008L // surface has others attached to it
  307. #define DDRAWISURF_IMPLICITROOT 0x00000010L // surface root of implicit creation
  308. #define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020L // surface is part of primary chain
  309. #define DDRAWISURF_DATAISALIASED 0x00000040L // used for thunking
  310. #define DDRAWISURF_HASDC 0x00000080L // has a DC
  311. #define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100L // surface has CKDestOverlay
  312. #define DDRAWISURF_HASCKEYDESTBLT 0x00000200L // surface has CKDestBlt
  313. #define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400L // surface has CKSrcOverlay
  314. #define DDRAWISURF_HASCKEYSRCBLT 0x00000800L // surface has CKSrcBlt
  315. #define DDRAWISURF_xxxxxxxxxxx4 0x00001000L // spare bit
  316. #define DDRAWISURF_HASPIXELFORMAT 0x00002000L // surface structure has pixel format data
  317. #define DDRAWISURF_HASOVERLAYDATA 0x00004000L // surface structure has overlay data
  318. #define DDRAWISURF_xxxxxxxxxxx5 0x00008000L // spare bit
  319. #define DDRAWISURF_SW_CKEYDESTOVERLAY 0x00010000L // surface expects to process colorkey in software
  320. #define DDRAWISURF_SW_CKEYDESTBLT 0x00020000L // surface expects to process colorkey in software
  321. #define DDRAWISURF_SW_CKEYSRCOVERLAY 0x00040000L // surface expects to process colorkey in software
  322. #define DDRAWISURF_SW_CKEYSRCBLT 0x00080000L // surface expects to process colorkey in software
  323. #define DDRAWISURF_HW_CKEYDESTOVERLAY 0x00100000L // surface expects to process colorkey in hardware
  324. #define DDRAWISURF_HW_CKEYDESTBLT 0x00200000L // surface expects to process colorkey in hardware
  325. #define DDRAWISURF_HW_CKEYSRCOVERLAY 0x00400000L // surface expects to process colorkey in hardware
  326. #define DDRAWISURF_HW_CKEYSRCBLT 0x00800000L // surface expects to process colorkey in hardware
  327. #define DDRAWISURF_xxxxxxxxxxx6 0x01000000L // spare bit
  328. #define DDRAWISURF_HELCB 0x02000000L // surfac is the ddhel cb. must call hel for lock/blt.
  329. #define DDRAWISURF_FRONTBUFFER 0x04000000L // surface was originally a front buffer
  330. #define DDRAWISURF_BACKBUFFER 0x08000000L // surface was originally backbuffer
  331. #define DDRAWISURF_INVALID 0x10000000L // surface has been invalidated by mode set
  332. #define DDRAWISURF_CANTLOCK 0x20000000L // surface cannot be locked (primary created by HEL)
  333. /*
  334. * rop stuff
  335. */
  336. #define ROP_HAS_SOURCE 0x00000001l
  337. #define ROP_HAS_PATTERN 0x00000002l
  338. #define ROP_HAS_SOURCEPATTERN ROP_HAS_SOURCE | ROP_HAS_PATTERN
  339. /*
  340. * structure for display driver to call DDHAL_Create with
  341. */
  342. typedef struct _DD_HALINFO
  343. {
  344. DWORD dwSize;
  345. VIDEOMEMORYINFO vmiData; // video memory info
  346. DDCAPS ddCaps; // hw specific caps
  347. DWORD dwMonitorFrequency; // monitor frequency in current mode
  348. DWORD dwFlags; // create flags
  349. } DD_HALINFO;
  350. typedef DD_HALINFO *PDD_HALINFO;
  351. /*
  352. * DDRAW version of DirectDraw object;
  353. *
  354. */
  355. typedef struct _DD_DIRECTDRAW_GLOBAL
  356. {
  357. VOID* dhpdev; // driver's private PDEV pointer
  358. DWORD dwReserved1; // reserved for use by display driver
  359. DWORD dwReserved2; // reserved for use by display driver
  360. } DD_DIRECTDRAW_GLOBAL;
  361. typedef struct _DD_DIRECTDRAW_LOCAL
  362. {
  363. PDD_DIRECTDRAW_GLOBAL lpGbl; // pointer to data
  364. FLATPTR fpProcess; // address of frame buffer in calling process' address space
  365. } DD_DIRECTDRAW_LOCAL;
  366. /////////////////////////////////////////////////////////////////////////////
  367. // NT Note:
  368. //
  369. // The following structures must match, field for field, the corresponding
  370. // structures as declared in 'ddrawi.h.' We cannot simply use the same
  371. // structures because the sub-structures such as DD_DIRECTDRAW_GLOBAL are
  372. // different, and have to be properly typed for the drivers.
  373. //
  374. /////////////////////////////////////////////////////////////////////////////
  375. /****************************************************************************
  376. *
  377. * DDHAL structures for Surface Object callbacks
  378. *
  379. ***************************************************************************/
  380. /*
  381. * structure for passing information to DDHAL Blt fn
  382. */
  383. typedef struct _DD_BLTDATA
  384. {
  385. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  386. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  387. RECTL rDest; // dest rect
  388. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  389. RECTL rSrc; // src rect
  390. DWORD dwFlags; // blt flags
  391. DWORD dwROPFlags; // ROP flags (valid for ROPS only)
  392. DDBLTFX bltFX; // blt FX
  393. HRESULT ddRVal; // return value
  394. VOID* Blt; // Unused: Win95 compatibility
  395. BOOL IsClipped; // clipped blt?
  396. RECTL rOrigDest; // unclipped dest rect
  397. // (only valid if IsClipped)
  398. RECTL rOrigSrc; // unclipped src rect
  399. // (only valid if IsClipped)
  400. DWORD dwRectCnt; // count of dest rects
  401. // (only valid if IsClipped)
  402. LPRECT prDestRects; // array of dest rects
  403. // (only valid if IsClipped)
  404. } DD_BLTDATA;
  405. /*
  406. * structure for passing information to DDHAL Lock fn
  407. */
  408. typedef struct _DD_LOCKDATA
  409. {
  410. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  411. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  412. DWORD bHasRect; // rArea is valid
  413. RECTL rArea; // area being locked
  414. LPVOID lpSurfData; // pointer to screen memory (return value)
  415. HRESULT ddRVal; // return value
  416. VOID* Lock; // Unused: Win95 compatibility
  417. DWORD dwFlags; // DDLOCK flags
  418. } DD_LOCKDATA;
  419. /*
  420. * structure for passing information to DDHAL Unlock fn
  421. */
  422. typedef struct _DD_UNLOCKDATA
  423. {
  424. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  425. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  426. HRESULT ddRVal; // return value
  427. VOID* Unlock; // Unused: Win95 compatibility
  428. } DD_UNLOCKDATA;
  429. /*
  430. * structure for passing information to DDHAL UpdateOverlay fn
  431. */
  432. typedef struct _DD_UPDATEOVERLAYDATA
  433. {
  434. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  435. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  436. RECTL rDest; // dest rect
  437. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  438. RECTL rSrc; // src rect
  439. DWORD dwFlags; // flags
  440. DDOVERLAYFX overlayFX; // overlay FX
  441. HRESULT ddRVal; // return value
  442. VOID* UpdateOverlay; // Unused: Win95 compatibility
  443. } DD_UPDATEOVERLAYDATA;
  444. /*
  445. * structure for passing information to DDHAL UpdateOverlay fn
  446. */
  447. typedef struct _DD_SETOVERLAYPOSITIONDATA
  448. {
  449. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  450. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  451. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  452. LONG lXPos; // x position
  453. LONG lYPos; // y position
  454. HRESULT ddRVal; // return value
  455. VOID* SetOverlayPosition; // Unused: Win95 compatibility
  456. } DD_SETOVERLAYPOSITIONDATA;
  457. /*
  458. * structure for passing information to DDHAL SetPalette fn
  459. */
  460. typedef struct _DD_SETPALETTEDATA
  461. {
  462. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  463. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  464. PDD_PALETTE_GLOBAL lpDDPalette; // palette to set to surface
  465. HRESULT ddRVal; // return value
  466. VOID* SetPalette; // Unused: Win95 compatibility
  467. BOOL Attach; // attach this palette?
  468. } DD_SETPALETTEDATA;
  469. /*
  470. * structure for passing information to DDHAL Flip fn
  471. */
  472. typedef struct _DD_FLIPDATA
  473. {
  474. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  475. PDD_SURFACE_LOCAL lpSurfCurr; // current surface
  476. PDD_SURFACE_LOCAL lpSurfTarg; // target surface (to flip to)
  477. DWORD dwFlags; // flags
  478. HRESULT ddRVal; // return value
  479. VOID* Flip; // Unused: Win95 compatibility
  480. } DD_FLIPDATA;
  481. /*
  482. * structure for passing information to DDHAL DestroySurface fn
  483. */
  484. typedef struct _DD_DESTROYSURFACEDATA
  485. {
  486. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  487. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  488. HRESULT ddRVal; // return value
  489. VOID* DestroySurface;// Unused: Win95 compatibility
  490. } DD_DESTROYSURFACEDATA;
  491. /*
  492. * structure for passing information to DDHAL SetClipList fn
  493. */
  494. typedef struct _DD_SETCLIPLISTDATA
  495. {
  496. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  497. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  498. HRESULT ddRVal; // return value
  499. VOID* SetClipList; // Unused: Win95 compatibility
  500. } DD_SETCLIPLISTDATA;
  501. /*
  502. * structure for passing information to DDHAL AddAttachedSurface fn
  503. */
  504. typedef struct _DD_ADDATTACHEDSURFACEDATA
  505. {
  506. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  507. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  508. PDD_SURFACE_LOCAL lpSurfAttached; // surface to attach
  509. HRESULT ddRVal; // return value
  510. VOID* AddAttachedSurface; // Unused: Win95 compatibility
  511. } DD_ADDATTACHEDSURFACEDATA;
  512. /*
  513. * structure for passing information to DDHAL SetColorKey fn
  514. */
  515. typedef struct _DD_SETCOLORKEYDATA
  516. {
  517. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  518. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  519. DWORD dwFlags; // flags
  520. DDCOLORKEY ckNew; // new color key
  521. HRESULT ddRVal; // return value
  522. VOID* SetColorKey; // Unused: Win95 compatibility
  523. } DD_SETCOLORKEYDATA;
  524. /*
  525. * structure for passing information to DDHAL GetBltStatus fn
  526. */
  527. typedef struct _DD_GETBLTSTATUSDATA
  528. {
  529. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  530. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  531. DWORD dwFlags; // flags
  532. HRESULT ddRVal; // return value
  533. VOID* GetBltStatus; // Unused: Win95 compatibility
  534. } DD_GETBLTSTATUSDATA;
  535. /*
  536. * structure for passing information to DDHAL GetFlipStatus fn
  537. */
  538. typedef struct _DD_GETFLIPSTATUSDATA
  539. {
  540. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  541. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  542. DWORD dwFlags; // flags
  543. HRESULT ddRVal; // return value
  544. VOID* GetFlipStatus; // Unused: Win95 compatibility
  545. } DD_GETFLIPSTATUSDATA;
  546. /****************************************************************************
  547. *
  548. * DDHAL structures for Palette Object callbacks
  549. *
  550. ***************************************************************************/
  551. /*
  552. * structure for passing information to DDHAL DestroyPalette fn
  553. */
  554. typedef struct _DD_DESTROYPALETTEDATA
  555. {
  556. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  557. PDD_PALETTE_GLOBAL lpDDPalette; // palette struct
  558. HRESULT ddRVal; // return value
  559. VOID* DestroyPalette; // Unused: Win95 compatibility
  560. } DD_DESTROYPALETTEDATA;
  561. /*
  562. * structure for passing information to DDHAL SetEntries fn
  563. */
  564. typedef struct _DD_SETENTRIESDATA
  565. {
  566. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  567. PDD_PALETTE_GLOBAL lpDDPalette; // palette struct
  568. DWORD dwBase; // base palette index
  569. DWORD dwNumEntries; // number of palette entries
  570. LPPALETTEENTRY lpEntries; // color table
  571. HRESULT ddRVal; // return value
  572. VOID* SetEntries; // Unused: Win95 compatibility
  573. } DD_SETENTRIESDATA;
  574. /****************************************************************************
  575. *
  576. * DDHAL structures for Driver Object callbacks
  577. *
  578. ***************************************************************************/
  579. typedef DDSURFACEDESC* PDD_SURFACEDESC;
  580. /*
  581. * structure for passing information to DDHAL CreateSurface fn
  582. */
  583. typedef struct _DD_CREATESURFACEDATA
  584. {
  585. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  586. PDD_SURFACEDESC lpDDSurfaceDesc;// description of surface being created
  587. PDD_SURFACE_LOCAL *lplpSList; // list of created surface objects
  588. DWORD dwSCnt; // number of surfaces in SList
  589. HRESULT ddRVal; // return value
  590. VOID* CreateSurface; // Unused: Win95 compatibility
  591. } DD_CREATESURFACEDATA;
  592. /*
  593. * structure for passing information to DDHAL CanCreateSurface fn
  594. */
  595. typedef struct _DD_CANCREATESURFACEDATA
  596. {
  597. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  598. PDD_SURFACEDESC lpDDSurfaceDesc; // description of surface being created
  599. DWORD bIsDifferentPixelFormat;// pixel format differs from primary surface
  600. HRESULT ddRVal; // return value
  601. VOID* CanCreateSurface; // Unused: Win95 compatibility
  602. } DD_CANCREATESURFACEDATA;
  603. /*
  604. * structure for passing information to DDHAL CreatePalette fn
  605. */
  606. typedef struct _DD_CREATEPALETTEDATA
  607. {
  608. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  609. PDD_PALETTE_GLOBAL lpDDPalette; // ddraw palette struct
  610. LPPALETTEENTRY lpColorTable; // colors to go in palette
  611. HRESULT ddRVal; // return value
  612. VOID* CreatePalette; // Unused: Win95 compatibility
  613. BOOL is_excl; // process has exclusive mode
  614. } DD_CREATEPALETTEDATA;
  615. /*
  616. * Return if the vertical blank is in progress
  617. */
  618. #define DDWAITVB_I_TESTVB 0x80000006l
  619. /*
  620. * structure for passing information to DDHAL WaitForVerticalBlank fn
  621. */
  622. typedef struct _DD_WAITFORVERTICALBLANKDATA
  623. {
  624. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  625. DWORD dwFlags; // flags
  626. DWORD bIsInVB; // is in vertical blank
  627. DWORD hEvent; // event
  628. HRESULT ddRVal; // return value
  629. VOID* WaitForVerticalBlank; // Unused: Win95 compatibility
  630. } DD_WAITFORVERTICALBLANKDATA;
  631. /*
  632. * structure for passing information to DDHAL driver SetColorKey fn
  633. */
  634. typedef struct _DD_DRVSETCOLORKEYDATA
  635. {
  636. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  637. DWORD dwFlags; // flags
  638. DDCOLORKEY ckNew; // new color key
  639. HRESULT ddRVal; // return value
  640. VOID* SetColorKey; // Unused: Win95 compatibility
  641. } DD_DRVSETCOLORKEYDATA;
  642. /*
  643. * structure for passing information to DDHAL GetScanLine fn
  644. */
  645. typedef struct _DD_GETSCANLINEDATA
  646. {
  647. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  648. DWORD dwScanLine; // returned scan line
  649. HRESULT ddRVal; // return value
  650. VOID* GetScanLine; // Unused: Win95 compatibility
  651. } DD_GETSCANLINEDATA;
  652. /*
  653. * structure for passing information to DDHAL MapMemory fn
  654. */
  655. typedef struct _DD_MAPMEMORYDATA
  656. {
  657. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  658. BOOL bMap; // TRUE if map; FALSe if un-map
  659. HANDLE hProcess; // process handle
  660. FLATPTR fpProcess; // returned address in process' address space
  661. HRESULT ddRVal; // return value
  662. } DD_MAPMEMORYDATA;
  663. #ifdef __cplusplus
  664. };
  665. #endif
  666. #endif