Leaked source code of windows server 2003
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.

4027 lines
184 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddrawi.h
  6. * Content: DirectDraw internal header file
  7. * Used by DirectDraw and by the display drivers.
  8. *@@BEGIN_DDKSPLIT
  9. * See ddrawpr.h for all information private to DirectDraw.
  10. * History:
  11. * Date By Reason
  12. * ==== == ======
  13. * 25-dec-94 craige initial implementation
  14. * 06-jan-95 craige video memory manager integration
  15. * 13-jan-95 craige re-worked to updated spec + ongoing work
  16. * 21-jan-95 craige made 32-bit + ongoing work
  17. * 31-jan-95 craige and even more ongoing work...
  18. * 04-feb-95 craige performance tuning, ongoing work
  19. * 22-feb-95 craige use critical sections on Win95
  20. * 02-mar-95 craige work work work
  21. * 06-mar-95 craige HEL integration
  22. * 11-mar-95 craige palette stuff
  23. * 17-mar-95 craige COM interface
  24. * 19-mar-95 craige use HRESULTs, use same process list handling for
  25. * driver objects as surface and palette
  26. * 20-mar-95 craige new CSECT work
  27. * 23-mar-95 craige attachment work
  28. * 27-mar-95 craige linear or rectangular vidmem
  29. * 28-mar-95 craige RGBQUAD -> PALETTEENTRY; other palette stuff
  30. * 29-mar-95 craige removed Eitherxxx caps from DIRECTDRAW
  31. * 31-mar-95 craige use critical sections with palettes
  32. * 04-apr-95 craige palette tweaks
  33. * 06-apr-95 craige split out process list stuff
  34. * 10-apr-95 craige bug 3,16 - palette issues
  35. * 13-apr-95 craige EricEng's little contribution to our being late
  36. * 06-may-95 craige use driver-level csects only
  37. * 09-may-95 craige escape call to get 32-bit DLL
  38. * 14-may-95 craige cleaned out obsolete junk
  39. * 15-may-95 craige made separate VMEM struct for rect & linear
  40. * 24-may-95 kylej removed obsolete ZOrder variables
  41. * 24-may-95 craige removed dwOrigNumHeaps
  42. * 28-may-95 craige cleaned up HAL: added GetBltStatus;GetFlipStatus;
  43. * GetScanLine
  44. * 02-jun-95 craige added PROCESS_LIST2 to DIRECTDRAW object; removed
  45. * hWndPal from DIRECTDRAW object; added lpDDSurface
  46. * to DIRECTDRAWPALETTE object
  47. * 06-jun-95 craige maintain entire primary surface in DIRECTDRAW object
  48. * 07-jun-95 craige moved DCLIST to PROCESSLIST
  49. * 10-jun-95 craige split out vmemmgr stuff
  50. * 12-jun-95 craige new process list stuff
  51. * 16-jun-95 craige removed fpVidMemOrig; new surface structure
  52. * 20-jun-95 kylej added is_excl field to DDHAL_CREATEPALETTEDATA struct
  53. * 21-jun-95 craige added DirectDrawClipper object; removed clipping
  54. * info from surface object
  55. * 22-jun-95 craige more clipping work
  56. * 25-jun-95 craige one ddraw mutex
  57. * 26-jun-95 craige reorganized surface structure
  58. * 27-jun-95 craige added dwModeCreatedIn to surface
  59. * 30-jun-95 kylej removed lpPrimarySurface, dwZDepth, dwAlphaDepth
  60. * from direct draw object. Modified some surface and
  61. * direct draw object flags.
  62. * 01-jul-95 craige hide composition & streaming stuff
  63. * 02-jul-95 craige added extra reserved field for HEL
  64. * 03-jul-95 craige YEEHAW: new driver struct; added pUnkOuter to all objects
  65. * 09-jul-95 craige track win16lock info in driver struct; added
  66. * DDHAL_DRIVER_NOCKEYHW
  67. * 10-jul-95 craige support SetOverlayPosition
  68. * 13-jul-95 craige removed old junk from ddraw object; added new mode stuff;
  69. * changed Get/SetOverlayPosition to use longs;
  70. * fixed duplicate flag in DDRAWIPAL_xxx
  71. * 14-jul-95 craige added VIDMEM_ISHEAP
  72. * 20-jul-95 craige internal reorg to prevent thunking during modeset;
  73. * palette bugs
  74. * 22-jul-95 craige bug 230 - unsupported starting modes
  75. * 29-jul-95 toddla remove unused palette stuff
  76. * 31-jul-95 toddla added DD_HAL_VERSION
  77. * 01-aug-95 toddla added dwPDevice to DDRAWI_DIRECTDRAW_GBL
  78. * 10-aug-95 craige added VALID_ALIGNMENT
  79. * 13-aug-95 craige internal/external version of DD_HAL_VERSION
  80. * 21-aug-95 craige mode X support
  81. * 27-aug-95 craige bug 742: added DDRAWIPAL_ALLOW256
  82. * 08-nov-95 colinmc added DDRAWIPAL flags to support 1, 2 and 4 bit
  83. * RGB and indexed palettes
  84. * 21-nov-95 colinmc made Direct3D a queryable interface off DirectDraw
  85. * 23-nov-95 colinmc made Direct3D textures and devices queryable off
  86. * DirectDraw surfaces
  87. * 09-dec-95 colinmc execute buffer support
  88. * 12-dec-95 colinmc shared back and z-buffer support (run away, run away...)
  89. * 22-dec-95 colinmc Direct3D support no longer conditional
  90. * 02-jan-96 kylej New interface structures, no vtbl in local objects
  91. * 10-jan-96 colinmc Aggregate IUnknowns of surfaces now maintained as
  92. * list
  93. * 18-jan-96 jeffno Changed free entries in DDRAW_GBL and SURFACE_LCL to NT
  94. * kernel-mode handles
  95. * 29-jan-96 colinmc Aggregated IUnknowns now stored in additional
  96. * surface structure
  97. * 09-feb-96 colinmc Addition of lost surface flag to local surface
  98. * objects
  99. * 17-feb-96 colinmc Fixed execute buffer size restriction problem
  100. * 01-mar-96 kylej Change DDCAPS size
  101. * 03-mar-96 colinmc Hack to keep interim drivers working
  102. * 13-mar-96 craige Bug 7528: hw that doesn't have modex
  103. * 14-mar-96 colinmc Class factory support for clippers
  104. * 24-mar-96 colinmc Bug 14321: not possible to specify back buffer and
  105. * mip-map count in a single call
  106. * 13-apr-96 colinmc Bug 17736: no notification to driver of when GDI
  107. * frame buffer is being displayed
  108. * 16-apr-96 kylej Bug 17900: DBLNODE struct incompatible with ddraw 1
  109. * 05-sep-96 craige added dwAppHackFlags to DDRAWI_DIRECTDRAW_LCL struct.
  110. * 01-oct-96 ketand added GetAvailDriverMemory
  111. * 05-oct-96 colinmc Work Item: Removing the restriction on taking Win16
  112. * lock on VRAM surfaces (not including the primary)
  113. * 07-oct-96 colinmc Fixed build breaker with GetAvailDriverMem
  114. * 07-oct-96 ketand Created DDRAWSURFACE_GBL_MORE
  115. * 12-oct-96 colinmc Improvements to Win16 locking code to reduce virtual
  116. * memory usage
  117. * 09-nov-96 colinmc Fixed problem with old and new drivers not working
  118. * with DirectDraw
  119. * 15-nov-96 colinmc Finally removed DDSCAPS_3D and moved the definition
  120. * of DDSCAPS_EXECUTEBUFFER to here so that it was
  121. * visible from the DDK.
  122. * 08-dec-96 colinmc Initial AGP support
  123. * 12-jan-97 colinmc More Win16 lock work
  124. * 13-jan-97 jvanaken Basic support for IDirectDrawSurface3 interface
  125. * 21-jan-97 ketand Deleted Winwatch/Streaming/Composition. Add multi-mon support.
  126. * 27-jan-97 colinmc AGP support
  127. * 29-jan-97 colinmc Fixed build breaker
  128. * 29-jan-97 smac Removed old ring 0 code
  129. * 29-jan-97 jeffno Mode13 support. A new flag in DDMODEINFO.
  130. * 01-feb-97 colinmc Bug 5574: Need to remove USE_ALIAS from headers
  131. * Bug 4665: Extra bytes per surface for driver
  132. * 02-feb-97 colinmc Bug 5625: DirectX drivers not longer be recognized
  133. * due to bad size validation on DDCALLBACKS
  134. * 24-feb-97 ketand Add dwContext to GETDRIVERINFODATA for NT and multimon
  135. * 03-mar-97 smac Added kernel mode interface
  136. * 03-mar-97 jeffno Work item: Extended surface memory alignment
  137. * 08-mar-97 colinmc New function to allow surface pointer to be
  138. * specified
  139. * 11-mar-97 jeffno Asynchronous DMA support
  140. * 23-mar-97 colinmc Bug 6673: Change structure numbering scheme for
  141. * consistency's sake and pass version number to the
  142. * driver. Also update the runtime version number
  143. * passed in the DCI command
  144. * 24-mar-97 jeffno Optimized Surfaces
  145. * 30-sep-97 jeffno IDirectDraw4
  146. * 03-oct-97 jeffno DDSCAPS2 and DDSURFACEDESC2
  147. * 31-oct-97 johnstep Persistent-content surfaces for Windows 9x
  148. * 05-nov-97 jvanaken Support for AlphaBlt and SetSpriteDisplayList
  149. * 26-nov-97 t-craigs IDirectDrawPalette2 and a few changes/additions to Surface4
  150. *@@END_DDKSPLIT
  151. *
  152. ***************************************************************************/
  153. #ifndef __DDRAWI_INCLUDED__
  154. #define __DDRAWI_INCLUDED__
  155. //
  156. // This is a helper for external driver builds.
  157. //
  158. #if (!defined(WIN95)) && (!defined(WINNT))
  159. #define WIN95
  160. #endif
  161. /*
  162. * METAQUESTION: Why are Windows handles stored as DWORDs instead of
  163. * their proper types?
  164. * METAANSWER: To make the thunk to the 16-bit side completely painless.
  165. */
  166. #define OBJECT_ISROOT 0x80000000l // object is root object
  167. /*
  168. * stuff for drivers
  169. */
  170. #ifndef _WIN32
  171. typedef long HRESULT;
  172. typedef LPVOID REFIID;
  173. #ifndef GUID_DEFINED
  174. #define GUID_DEFINED
  175. typedef struct _GUID {
  176. ULONG Data1;
  177. unsigned short Data2;
  178. unsigned short Data3;
  179. unsigned char Data4[8];
  180. } GUID;
  181. #endif // !defined(GUID_DEFINED)
  182. typedef GUID FAR *LPGUID;
  183. #define MAKE_HRESULT(sev,fac,code) \
  184. ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
  185. #endif
  186. /*
  187. * These definitions are required to allow polymorphic structure members (i.e. those
  188. * that are referred to both as DWORDs and as pointers) to resolve into a type
  189. * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
  190. * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
  191. */
  192. #ifndef MAXULONG_PTR
  193. #define ULONG_PTR DWORD
  194. #define PULONG_PTR LPDWORD
  195. #endif //MAXULONG_PTR
  196. //@@BEGIN_DDKSPLIT
  197. // Include ddrawp.h for DirectDraw and D3D builds. DDK includes ddraw.h
  198. #ifdef MSBUILD
  199. #include "ddrawp.h"
  200. #include "dvpp.h"
  201. #include "ddkernel.h"
  202. #else
  203. //@@END_DDKSPLIT
  204. #include "ddraw.h"
  205. #include "dvp.h"
  206. #include "ddkernel.h"
  207. //@@BEGIN_DDKSPLIT
  208. #endif
  209. #include "ddmcp.h"
  210. //@@END_DDKSPLIT
  211. #include "dmemmgr.h"
  212. #ifdef IS_16
  213. // ddraw16 16-bit compiler cannot handle 32-bit d3d headers included by d3dhal.h
  214. // so for ddraw16 build, explicitly list d3dhal ptr types here
  215. #define LPD3DHAL_GLOBALDRIVERDATA ULONG_PTR
  216. #define LPD3DHAL_CALLBACKS ULONG_PTR
  217. #define LPD3DHAL_CALLBACKS2 ULONG_PTR
  218. #define LPD3DHAL_CALLBACKS3 ULONG_PTR
  219. #define LPD3DHAL_D3DEXTENDEDCAPS ULONG_PTR
  220. #define LPD3DHAL_COMMANDBUFFERCALLBACKS ULONG_PTR
  221. //@@BEGIN_DDKSPLIT
  222. #else
  223. // make sure to get d3d8 private version so the
  224. // d3d8typesp gets included instead of d3d8types
  225. #if DIRECT3D_VERSION >= 0x800
  226. #include "d3dhalp.h"
  227. #else
  228. #include "d3dhal.h"
  229. #endif
  230. //@@END_DDKSPLIT
  231. #endif
  232. #ifndef _WIN32
  233. /*
  234. * these error codes are DIFFERENT in Win32 and Win16!!!!
  235. */
  236. #undef E_NOTIMPL
  237. #undef E_OUTOFMEMORY
  238. #undef E_INVALIDARG
  239. #undef E_FAIL
  240. #define E_NOTIMPL 0x80004001L
  241. #define E_OUTOFMEMORY 0x8007000EL
  242. #define E_INVALIDARG 0x80070057L
  243. #define E_FAIL 0x80004005L
  244. #endif
  245. #define DDUNSUPPORTEDMODE ((DWORD) -1)
  246. #define VALID_ALIGNMENT( align ) (!((align == 0) || (align % 2) != 0 ))
  247. #ifdef _WIN32
  248. /*
  249. * These GUIDs are used to identify driver info structures, not interfaces,
  250. * so the prefix GUID_ is used instead of IID_.
  251. *
  252. */
  253. DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
  254. DEFINE_GUID( GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
  255. DEFINE_GUID( GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
  256. DEFINE_GUID( GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
  257. DEFINE_GUID( GUID_D3DCallbacks2, 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
  258. DEFINE_GUID( GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
  259. DEFINE_GUID( GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37);
  260. DEFINE_GUID( GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
  261. DEFINE_GUID( GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
  262. DEFINE_GUID( GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
  263. DEFINE_GUID( GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae);
  264. DEFINE_GUID( GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
  265. DEFINE_GUID( GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
  266. DEFINE_GUID( GUID_OptSurfaceKmodeInfo, 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  267. DEFINE_GUID( GUID_OptSurfaceUmodeInfo, 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  268. DEFINE_GUID( GUID_UserModeDriverInfo, 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  269. DEFINE_GUID( GUID_UserModeDriverPassword, 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  270. DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  271. DEFINE_GUID( GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e);
  272. DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A);
  273. //@@BEGIN_DDKSPLIT
  274. DEFINE_GUID( GUID_NTCallbacks, 0x6fe9ecde, 0xdf89, 0x11d1, 0x9d, 0xb0, 0x00, 0x60, 0x08, 0x27, 0x71, 0xba);
  275. DEFINE_GUID( GUID_DDMoreCaps, 0x880baf30, 0xb030, 0x11d0, 0x8e, 0xa7, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b);
  276. DEFINE_GUID( GUID_VPE2Callbacks, 0x52882147, 0x2d47, 0x469a, 0xa0, 0xd1, 0x3, 0x45, 0x58, 0x90, 0xf6, 0xc8);
  277. //@@END_DDKSPLIT
  278. #endif //_WIN32
  279. // The Callback that the drivers can use to parse unknown commands
  280. // passed to them via the DrawPrimitives2 callback. The driver obtains this
  281. // callback thru a GetDriverInfo call with GUID_D3DParseUnknownCommandCallback
  282. // made by ddraw somewhere around the initialization time.
  283. #ifdef __cplusplus
  284. extern "C"
  285. #endif
  286. HRESULT CALLBACK D3DParseUnknownCommand (LPVOID lpvCommands,
  287. LPVOID *lplpvReturnedCommand);
  288. /*
  289. * This DDPF flag is used by drivers to signify that this format is new and may be
  290. * a candidate for hiding from certain applications
  291. * KEEP THIS DEFINITION IN SYNC WITH THAT OF DDPF_RESERVED1 IN DDRAW.H
  292. */
  293. #define DDPF_NOVEL_TEXTURE_FORMAT 0x00100000l
  294. /*
  295. * This DDPF flag is used to indicate a DX8+ format capability entry in
  296. * the texture format list. It is not visible to applications.
  297. */
  298. #define DDPF_D3DFORMAT 0x00200000l
  299. /*
  300. * List of operations supported on formats in DX8+ texture list.
  301. * See the DX8 DDK for a complete description of these flags.
  302. */
  303. #define D3DFORMAT_OP_TEXTURE 0x00000001L
  304. #define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L
  305. #define D3DFORMAT_OP_CUBETEXTURE 0x00000004L
  306. #define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L
  307. #define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L
  308. #define D3DFORMAT_OP_ZSTENCIL 0x00000040L
  309. #define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L
  310. // This format can be used as a render target if the current display mode
  311. // is the same depth if the alpha channel is ignored. e.g. if the device
  312. // can render to A8R8G8B8 when the display mode is X8R8G8B8, then the
  313. // format op list entry for A8R8G8B8 should have this cap.
  314. #define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L
  315. // This format contains DirectDraw support (including Flip). This flag
  316. // should not to be set on alpha formats.
  317. #define D3DFORMAT_OP_DISPLAYMODE 0x00000400L
  318. // The rasterizer can support some level of Direct3D support in this format
  319. // and implies that the driver can create a Context in this mode (for some
  320. // render target format). When this flag is set, the D3DFORMAT_OP_DISPLAYMODE
  321. // flag must also be set.
  322. #define D3DFORMAT_OP_3DACCELERATION 0x00000800L
  323. // If the driver needs a private format to be D3D or driver manageable,
  324. // then it needs to tell D3D the pixelsize in bits per pixel by setting
  325. // dwPrivateFormatBitCount in DDPIXELFORMAT and by setting the below
  326. // format op. If the below format op is not set, then D3D or the driver
  327. // will NOT be allowed to manage the format.
  328. #define D3DFORMAT_OP_PIXELSIZE 0x00001000L
  329. /*
  330. * List of processes attached to a DirectDraw object
  331. */
  332. typedef struct _PROCESS_LIST
  333. {
  334. struct _PROCESS_LIST FAR *lpLink;
  335. DWORD dwProcessId;
  336. DWORD dwRefCnt;
  337. DWORD dwAlphaDepth;
  338. DWORD dwZDepth;
  339. } PROCESS_LIST;
  340. typedef PROCESS_LIST FAR *LPPROCESS_LIST;
  341. /*
  342. * Information about the refresh rates that monitor/display card can support
  343. */
  344. typedef struct _DDMONITORINFO
  345. {
  346. WORD Manufacturer; // Montor manufacturer
  347. WORD Product; // Monitor product ID
  348. DWORD SerialNumber; // Monitor serial number
  349. GUID DeviceIdentifier; // From DDDEVICEIDENTIFIER, describes card/driver
  350. int Mode640x480; // Highest refresh rate support, 0 if none, -1 if untested
  351. int Mode800x600;
  352. int Mode1024x768;
  353. int Mode1280x1024;
  354. int Mode1600x1200;
  355. int ModeReserved1;
  356. int ModeReserved2;
  357. int ModeReserved3;
  358. } DDMONITORINFO, FAR *LPDDMONITORINFO;
  359. //@@BEGIN_DDKSPLIT
  360. /*
  361. * Mode test context and mode list structures used by StartModeTest API
  362. */
  363. typedef struct _MODETESTDATA
  364. {
  365. DWORD dwWidth;
  366. DWORD dwHeight;
  367. DWORD dwBPP;
  368. DWORD dwRefreshRate;
  369. } MODETESTDATA, * LPMODETESTDATA;
  370. typedef struct _MODETESTCONTEXT
  371. {
  372. DWORD dwTimeStamp;
  373. DWORD dwNumModes;
  374. DWORD dwCurrentMode;
  375. DWORD dwOrigModeIndex;
  376. LPMODETESTDATA lpModeList;
  377. } MODETESTCONTEXT, * LPMODETESTCONTEXT;
  378. //@@END_DDKSPLIT
  379. /*
  380. * DeleteFromActiveProcessList return codes
  381. */
  382. #define DELETED_OK 0
  383. #define DELETED_LASTONE 1
  384. #define DELETED_NOTFOUND 2
  385. #define DDBLT_ANYALPHA \
  386. (DDBLT_ALPHASRCSURFACEOVERRIDE | \
  387. DDBLT_ALPHASRCCONSTOVERRIDE | \
  388. DDBLT_ALPHASRC | \
  389. DDBLT_ALPHADESTSURFACEOVERRIDE | \
  390. DDBLT_ALPHADESTCONSTOVERRIDE | \
  391. DDBLT_ALPHADEST)
  392. #define DDOVER_ANYALPHA \
  393. (DDOVER_ALPHASRCSURFACEOVERRIDE | \
  394. DDOVER_ALPHASRCCONSTOVERRIDE | \
  395. DDOVER_ALPHASRC | \
  396. DDOVER_ALPHADESTSURFACEOVERRIDE | \
  397. DDOVER_ALPHADESTCONSTOVERRIDE | \
  398. DDOVER_ALPHADEST)
  399. typedef struct IDirectDrawClipperVtbl DIRECTDRAWCLIPPERCALLBACKS;
  400. typedef struct IDirectDrawPaletteVtbl DIRECTDRAWPALETTECALLBACKS;
  401. typedef struct IDirectDrawSurfaceVtbl DIRECTDRAWSURFACECALLBACKS;
  402. typedef struct IDirectDrawSurface2Vtbl DIRECTDRAWSURFACE2CALLBACKS;
  403. typedef struct IDirectDrawSurface3Vtbl DIRECTDRAWSURFACE3CALLBACKS;
  404. typedef struct IDirectDrawSurface4Vtbl DIRECTDRAWSURFACE4CALLBACKS;
  405. typedef struct IDirectDrawSurface7Vtbl DIRECTDRAWSURFACE7CALLBACKS;
  406. typedef struct IDirectDrawColorControlVtbl DIRECTDRAWCOLORCONTROLCALLBACKS;
  407. typedef struct IDirectDrawVtbl DIRECTDRAWCALLBACKS;
  408. typedef struct IDirectDraw2Vtbl DIRECTDRAW2CALLBACKS;
  409. typedef struct IDirectDraw4Vtbl DIRECTDRAW4CALLBACKS;
  410. typedef struct IDirectDraw7Vtbl DIRECTDRAW7CALLBACKS;
  411. typedef struct IDirectDrawKernelVtbl DIRECTDRAWKERNELCALLBACKS;
  412. typedef struct IDirectDrawSurfaceKernelVtbl DIRECTDRAWSURFACEKERNELCALLBACKS;
  413. typedef struct IDirectDrawGammaControlVtbl DIRECTDRAWGAMMACONTROLCALLBACKS;
  414. //@@BEGIN_DDKSPLIT
  415. #ifdef POSTPONED
  416. typedef struct IDirectDrawFactory2Vtbl DDFACTORY2CALLBACKS;
  417. typedef struct IDirectDrawPalette2Vtbl DIRECTDRAWPALETTE2CALLBACKS;
  418. typedef struct IPersistVtbl DIRECTDRAWSURFACEPERSISTCALLBACKS;
  419. typedef struct IPersistStreamVtbl DIRECTDRAWSURFACEPERSISTSTREAMCALLBACKS;
  420. typedef struct IPersistVtbl DIRECTDRAWPALETTEPERSISTCALLBACKS;
  421. typedef struct IPersistStreamVtbl DIRECTDRAWPALETTEPERSISTSTREAMCALLBACKS;
  422. typedef struct IDirectDrawOptSurfaceVtbl DIRECTDRAWOPTSURFACECALLBACKS;
  423. #endif //POSTPONED
  424. //@@END_DDKSPLIT
  425. typedef DIRECTDRAWCLIPPERCALLBACKS FAR *LPDIRECTDRAWCLIPPERCALLBACKS;
  426. typedef DIRECTDRAWPALETTECALLBACKS FAR *LPDIRECTDRAWPALETTECALLBACKS;
  427. typedef DIRECTDRAWSURFACECALLBACKS FAR *LPDIRECTDRAWSURFACECALLBACKS;
  428. typedef DIRECTDRAWCALLBACKS FAR *LPDIRECTDRAWCALLBACKS;
  429. #ifdef __cplusplus
  430. extern "C" {
  431. #endif
  432. #if defined( IS_32 ) || defined( WIN32 ) || defined( _WIN32 )
  433. #undef IS_32
  434. #define IS_32
  435. #define DDAPI WINAPI
  436. #define EXTERN_DDAPI WINAPI
  437. #else
  438. #define DDAPI __loadds WINAPI
  439. #define EXTERN_DDAPI __export WINAPI
  440. #endif
  441. //@@BEGIN_DDKSPLIT
  442. #ifdef POSTPONED
  443. typedef struct _NONDELEGATINGUNKNOWNCALLBACKS
  444. {
  445. HRESULT (DDAPI *QueryInterface) (LPDIRECTDRAW, REFIID, LPVOID FAR * );
  446. DWORD (DDAPI *AddRef) (LPDIRECTDRAW);
  447. DWORD (DDAPI *Release) (LPDIRECTDRAW);
  448. } NONDELEGATINGUNKNOWNCALLBACKS;
  449. #endif
  450. //@@END_DDKSPLIT
  451. /*
  452. * DCI escape
  453. */
  454. #ifndef DCICOMMAND
  455. #define DCICOMMAND 3075 // escape value
  456. #endif
  457. /*
  458. * this is the DirectDraw version
  459. * passed to the driver in DCICMD.dwVersion
  460. *
  461. * Most older HALs will fail if DD_VERSION does not match what they
  462. * are expecting. Therefore, DD_VERSION cannot change if we want DX5+ to
  463. * run on DX2/3 HALs. For this reason, we added a new version call that
  464. * allows the HAL to know the real version of DirectDraw, which is equal
  465. * to DD_RUNTIME_VERSION. This is for informational purposes only. HALs
  466. * should not fail DirectDraw if they receive an unknown DirectDraw runtime
  467. * version.
  468. */
  469. #define DD_VERSION 0x00000200l
  470. #define DD_RUNTIME_VERSION 0x00000802l
  471. /*
  472. * this is the HAL version.
  473. * the driver returns this number from QUERYESCSUPPORT/DCICOMMAND
  474. */
  475. #define DD_HAL_VERSION 0x0100
  476. //@@BEGIN_DDKSPLIT
  477. #define DD_HAL_VERSION_EXTERNAL 0x0100
  478. #undef DD_HAL_VERSION
  479. #define DD_HAL_VERSION 0x00ff // special internal version
  480. //@@END_DDKSPLIT
  481. #include "dciddi.h"
  482. #define DDCREATEDRIVEROBJECT 10 // create an object
  483. #define DDGET32BITDRIVERNAME 11 // get a 32-bit driver name
  484. #define DDNEWCALLBACKFNS 12 // new callback fns coming
  485. #define DDVERSIONINFO 13 // tells driver the ddraw version
  486. typedef struct
  487. {
  488. char szName[260]; // 32-bit driver name
  489. char szEntryPoint[64]; // entry point
  490. DWORD dwContext; // context to pass to entry point
  491. } DD32BITDRIVERDATA, FAR *LPDD32BITDRIVERDATA;
  492. typedef struct
  493. {
  494. DWORD dwHALVersion; // Version of DirectDraw for which the HAL was created
  495. ULONG_PTR dwReserved1; // Reserved for future use
  496. ULONG_PTR dwReserved2; // Reserved for future use
  497. } DDVERSIONDATA, FAR *LPDDVERSIONDATA;
  498. typedef DWORD (FAR PASCAL *LPDD32BITDRIVERINIT)(DWORD dwContext);
  499. /*
  500. * pointer to video meory
  501. */
  502. typedef ULONG_PTR FLATPTR;
  503. /*
  504. * indicates that DDRAW.DLL has been unloaded...
  505. */
  506. #define DDRAW_DLL_UNLOADED (LPVOID) 1
  507. /*
  508. * critical section types
  509. */
  510. typedef LPVOID CSECT_HANDLE;
  511. #ifdef NOUSE_CRITSECTS
  512. typedef xxx CSECT; // generate an error for now
  513. #else
  514. #if defined( IS_32 ) && !defined( _NOCSECT_TYPE )
  515. typedef CRITICAL_SECTION CSECT;
  516. typedef CSECT *LPCSECT;
  517. #else
  518. typedef struct
  519. {
  520. DWORD vals[6];
  521. } CSECT;
  522. typedef void FAR *LPCSECT;
  523. #endif
  524. #endif
  525. /*
  526. * DLL names
  527. */
  528. #define DDHAL_DRIVER_DLLNAME "DDRAW16.DLL"
  529. #define DDHAL_APP_DLLNAME "DDRAW.DLL"
  530. /*
  531. * maximum size of a driver name
  532. */
  533. #ifndef CCHDEVICENAME
  534. #define CCHDEVICENAME 32
  535. #endif
  536. #define MAX_DRIVER_NAME CCHDEVICENAME
  537. /*
  538. * largest palette supported
  539. */
  540. #define MAX_PALETTE_SIZE 256
  541. /*
  542. * maximum number of surfaces that can be autoflipped between
  543. */
  544. #define MAX_AUTOFLIP_BUFFERS 10
  545. /*
  546. * Indicates the surface is an execute buffer, i.e., a linear chunk of system
  547. * or video memory that holds a Direct3D display list. A driver reports this
  548. * cap to indicate that it can create execute buffers in video memory and
  549. * Direct3D uses this bit to request execute buffers. However, it is not
  550. * visible to via the API.
  551. */
  552. #define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2
  553. /*
  554. * Indicates to the driver that the "execute" buffer that is to be created is actually
  555. * a vertex buffer. Used by CreateVertexBuffer in D3D
  556. */
  557. #define DDSCAPS2_VERTEXBUFFER DDSCAPS2_RESERVED1
  558. /*
  559. * Indicates to the driver that the "execute" buffer that is to be created is actually
  560. * a command buffer. Used by internally in D3D
  561. */
  562. #define DDSCAPS2_COMMANDBUFFER DDSCAPS2_RESERVED2
  563. /*
  564. * Indicates to the driver that the "execute" buffer that is to be created is actually
  565. * an index buffer.
  566. */
  567. #define DDSCAPS2_INDEXBUFFER DDSCAPS2_RESERVED3
  568. /*
  569. * Internal formats are not exposed to applications.
  570. //@@BEGIN_DDKSPLIT
  571. * NOTE: Must keep these in sync with enum in d3d8types.h
  572. //@@END_DDKSPLIT
  573. */
  574. #define D3DFMT_INTERNAL_D32 71
  575. #define D3DFMT_INTERNAL_S1D15 72
  576. #define D3DFMT_INTERNAL_D15S1 73
  577. #define D3DFMT_INTERNAL_S8D24 74
  578. #define D3DFMT_INTERNAL_D24S8 75
  579. #define D3DFMT_INTERNAL_X8D24 76
  580. #define D3DFMT_INTERNAL_D24X8 77
  581. /*
  582. * pre-declare pointers to structs containing data for DDHAL fns
  583. */
  584. typedef struct _DDHAL_CREATEPALETTEDATA FAR *LPDDHAL_CREATEPALETTEDATA;
  585. typedef struct _DDHAL_CREATESURFACEDATA FAR *LPDDHAL_CREATESURFACEDATA;
  586. typedef struct _DDHAL_CANCREATESURFACEDATA FAR *LPDDHAL_CANCREATESURFACEDATA;
  587. typedef struct _DDHAL_WAITFORVERTICALBLANKDATA FAR *LPDDHAL_WAITFORVERTICALBLANKDATA;
  588. typedef struct _DDHAL_DESTROYDRIVERDATA FAR *LPDDHAL_DESTROYDRIVERDATA;
  589. typedef struct _DDHAL_SETMODEDATA FAR *LPDDHAL_SETMODEDATA;
  590. typedef struct _DDHAL_DRVSETCOLORKEYDATA FAR *LPDDHAL_DRVSETCOLORKEYDATA;
  591. typedef struct _DDHAL_GETSCANLINEDATA FAR *LPDDHAL_GETSCANLINEDATA;
  592. typedef struct _DDHAL_DESTROYPALETTEDATA FAR *LPDDHAL_DESTROYPALETTEDATA;
  593. typedef struct _DDHAL_SETENTRIESDATA FAR *LPDDHAL_SETENTRIESDATA;
  594. typedef struct _DDHAL_BLTDATA FAR *LPDDHAL_BLTDATA;
  595. typedef struct _DDHAL_LOCKDATA FAR *LPDDHAL_LOCKDATA;
  596. typedef struct _DDHAL_UNLOCKDATA FAR *LPDDHAL_UNLOCKDATA;
  597. typedef struct _DDHAL_UPDATEOVERLAYDATA FAR *LPDDHAL_UPDATEOVERLAYDATA;
  598. typedef struct _DDHAL_SETOVERLAYPOSITIONDATA FAR *LPDDHAL_SETOVERLAYPOSITIONDATA;
  599. typedef struct _DDHAL_SETPALETTEDATA FAR *LPDDHAL_SETPALETTEDATA;
  600. typedef struct _DDHAL_FLIPDATA FAR *LPDDHAL_FLIPDATA;
  601. typedef struct _DDHAL_DESTROYSURFACEDATA FAR *LPDDHAL_DESTROYSURFACEDATA;
  602. typedef struct _DDHAL_SETCLIPLISTDATA FAR *LPDDHAL_SETCLIPLISTDATA;
  603. typedef struct _DDHAL_ADDATTACHEDSURFACEDATA FAR *LPDDHAL_ADDATTACHEDSURFACEDATA;
  604. typedef struct _DDHAL_SETCOLORKEYDATA FAR *LPDDHAL_SETCOLORKEYDATA;
  605. typedef struct _DDHAL_GETBLTSTATUSDATA FAR *LPDDHAL_GETBLTSTATUSDATA;
  606. typedef struct _DDHAL_GETFLIPSTATUSDATA FAR *LPDDHAL_GETFLIPSTATUSDATA;
  607. typedef struct _DDHAL_SETEXCLUSIVEMODEDATA FAR *LPDDHAL_SETEXCLUSIVEMODEDATA;
  608. typedef struct _DDHAL_FLIPTOGDISURFACEDATA FAR *LPDDHAL_FLIPTOGDISURFACEDATA;
  609. typedef struct _DDHAL_CANCREATEVPORTDATA FAR *LPDDHAL_CANCREATEVPORTDATA;
  610. typedef struct _DDHAL_CREATEVPORTDATA FAR *LPDDHAL_CREATEVPORTDATA;
  611. typedef struct _DDHAL_FLIPVPORTDATA FAR *LPDDHAL_FLIPVPORTDATA;
  612. typedef struct _DDHAL_GETVPORTCONNECTDATA FAR *LPDDHAL_GETVPORTCONNECTDATA;
  613. typedef struct _DDHAL_GETVPORTBANDWIDTHDATA FAR *LPDDHAL_GETVPORTBANDWIDTHDATA;
  614. typedef struct _DDHAL_GETVPORTINPUTFORMATDATA FAR *LPDDHAL_GETVPORTINPUTFORMATDATA;
  615. typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA FAR *LPDDHAL_GETVPORTOUTPUTFORMATDATA;
  616. typedef struct _DDHAL_GETVPORTFIELDDATA FAR *LPDDHAL_GETVPORTFIELDDATA;
  617. typedef struct _DDHAL_GETVPORTLINEDATA FAR *LPDDHAL_GETVPORTLINEDATA;
  618. typedef struct _DDHAL_DESTROYVPORTDATA FAR *LPDDHAL_DESTROYVPORTDATA;
  619. typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA FAR *LPDDHAL_GETVPORTFLIPSTATUSDATA;
  620. typedef struct _DDHAL_UPDATEVPORTDATA FAR *LPDDHAL_UPDATEVPORTDATA;
  621. typedef struct _DDHAL_WAITFORVPORTSYNCDATA FAR *LPDDHAL_WAITFORVPORTSYNCDATA;
  622. typedef struct _DDHAL_GETVPORTSIGNALDATA FAR *LPDDHAL_GETVPORTSIGNALDATA;
  623. typedef struct _DDHAL_VPORTCOLORDATA FAR *LPDDHAL_VPORTCOLORDATA;
  624. typedef struct _DDHAL_COLORCONTROLDATA FAR *LPDDHAL_COLORCONTROLDATA;
  625. typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA FAR *LPDDHAL_GETAVAILDRIVERMEMORYDATA;
  626. typedef struct _DDHAL_UPDATENONLOCALHEAPDATA FAR *LPDDHAL_UPDATENONLOCALHEAPDATA;
  627. typedef struct _DDHAL_GETHEAPALIGNMENTDATA FAR *LPDDHAL_GETHEAPALIGNMENTDATA;
  628. typedef struct _DDHAL_GETDRIVERINFODATA FAR *LPDDHAL_GETDRIVERINFODATA;
  629. typedef struct _DDHAL_SYNCSURFACEDATA FAR *LPDDHAL_SYNCSURFACEDATA;
  630. typedef struct _DDHAL_SYNCVIDEOPORTDATA FAR *LPDDHAL_SYNCVIDEOPORTDATA;
  631. typedef struct _DDHAL_GETMOCOMPGUIDSDATA FAR *LPDDHAL_GETMOCOMPGUIDSDATA;
  632. typedef struct _DDHAL_GETMOCOMPFORMATSDATA FAR *LPDDHAL_GETMOCOMPFORMATSDATA;
  633. typedef struct _DDHAL_CREATEMOCOMPDATA FAR *LPDDHAL_CREATEMOCOMPDATA;
  634. typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA FAR *LPDDHAL_GETMOCOMPCOMPBUFFDATA;
  635. typedef struct _DDHAL_GETINTERNALMOCOMPDATA FAR *LPDDHAL_GETINTERNALMOCOMPDATA;
  636. typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA FAR *LPDDHAL_BEGINMOCOMPFRAMEDATA;
  637. typedef struct _DDHAL_ENDMOCOMPFRAMEDATA FAR *LPDDHAL_ENDMOCOMPFRAMEDATA;
  638. typedef struct _DDHAL_RENDERMOCOMPDATA FAR *LPDDHAL_RENDERMOCOMPDATA;
  639. typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA FAR *LPDDHAL_QUERYMOCOMPSTATUSDATA;
  640. typedef struct _DDHAL_DESTROYMOCOMPDATA FAR *LPDDHAL_DESTROYMOCOMPDATA;
  641. typedef struct _DDHAL_CREATESURFACEEXDATA FAR *LPDDHAL_CREATESURFACEEXDATA;
  642. typedef struct _DDHAL_GETDRIVERSTATEDATA FAR *LPDDHAL_GETDRIVERSTATEDATA;
  643. typedef struct _DDHAL_DESTROYDDLOCALDATA FAR *LPDDHAL_DESTROYDDLOCALDATA;
  644. //@@BEGIN_DDKSPLIT
  645. #ifdef POSTPONED2
  646. typedef struct _DDHAL_SETSPRITEDISPLAYLISTDATA FAR *LPDDHAL_SETSPRITEDISPLAYLISTDATA;
  647. typedef struct _DDHAL_RESIZEDATA FAR *LPDDHAL_RESIZEDATA;
  648. typedef struct _DDHAL_CAPTURECOMPOSITIONBUFFERDATA FAR *LPDDHAL_CAPTURECOMPOSITIONBUFFERDATA;
  649. #endif //POSTPONED2
  650. //@@END_DDKSPLIT
  651. /*
  652. * value in the fpVidMem; indicates dwBlockSize is valid (surface object)
  653. */
  654. #define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l
  655. /*
  656. * Values in fpVidMem: Indicates dwLinearSizde is valid.
  657. * THIS VALUE CAN ONLY BE USED BY A D3D Optimize DRIVER FUNCTION
  658. * IT IS INVALID FOR A DRIVER TO RETURN THIS VALUE FROM CreateSurface32.
  659. */
  660. #define DDHAL_PLEASEALLOC_LINEARSIZE 0x00000003l
  661. /*
  662. * DRIVER SERVICES
  663. *
  664. * These services exported from ddraw.dll can be called by the HAL.
  665. * They are intended for use by the d3d Optimize HAL call.
  666. */
  667. extern HRESULT DDAPI LateAllocateSurfaceMem(
  668. LPDIRECTDRAWSURFACE lpSurface,
  669. DWORD dwPleaseAllocType,
  670. DWORD dwWidthInBytesOrSize,
  671. DWORD dwHeight);
  672. LPDIRECTDRAWSURFACE GetNextMipMap(
  673. LPDIRECTDRAWSURFACE lpLevel);
  674. /*
  675. * video memory data structures (passed in DDHALINFO)
  676. */
  677. typedef struct _VIDMEM
  678. {
  679. DWORD dwFlags; // flags
  680. FLATPTR fpStart; // start of memory chunk
  681. union
  682. {
  683. FLATPTR fpEnd; // end of memory chunk
  684. DWORD dwWidth; // width of chunk (rectanglar memory)
  685. };
  686. DDSCAPS ddsCaps; // what this memory CANNOT be used for
  687. DDSCAPS ddsCapsAlt; // what this memory CANNOT be used for if it must
  688. union
  689. {
  690. LPVMEMHEAP lpHeap; // heap pointer, used by DDRAW
  691. DWORD dwHeight; // height of chunk (rectanguler memory)
  692. };
  693. } VIDMEM;
  694. typedef VIDMEM FAR *LPVIDMEM;
  695. /*
  696. * flags for vidmem struct
  697. */
  698. #define VIDMEM_ISLINEAR 0x00000001l // heap is linear
  699. #define VIDMEM_ISRECTANGULAR 0x00000002l // heap is rectangular
  700. #define VIDMEM_ISHEAP 0x00000004l // heap is preallocated by driver
  701. #define VIDMEM_ISNONLOCAL 0x00000008l // heap populated with non-local video memory
  702. #define VIDMEM_ISWC 0x00000010l // heap populated with write combining memory
  703. #define VIDMEM_HEAPDISABLED 0x00000020l // heap disabled
  704. typedef struct _VIDMEMINFO
  705. {
  706. /* 0*/ FLATPTR fpPrimary; // pointer to primary surface
  707. /* 4*/ DWORD dwFlags; // flags
  708. /* 8*/ DWORD dwDisplayWidth; // current display width
  709. /* c*/ DWORD dwDisplayHeight; // current display height
  710. /*10*/ LONG lDisplayPitch; // current display pitch
  711. /*14*/ DDPIXELFORMAT ddpfDisplay; // pixel format of display
  712. /*34*/ DWORD dwOffscreenAlign; // byte alignment for offscreen surfaces
  713. /*38*/ DWORD dwOverlayAlign; // byte alignment for overlays
  714. /*3c*/ DWORD dwTextureAlign; // byte alignment for textures
  715. /*40*/ DWORD dwZBufferAlign; // byte alignment for z buffers
  716. /*44*/ DWORD dwAlphaAlign; // byte alignment for alpha
  717. /*48*/ DWORD dwNumHeaps; // number of memory heaps in vmList
  718. /*4c*/ LPVIDMEM pvmList; // array of heaps
  719. } VIDMEMINFO;
  720. typedef VIDMEMINFO FAR *LPVIDMEMINFO;
  721. typedef struct _HEAPALIAS // PRIVATE
  722. {
  723. FLATPTR fpVidMem; // start of aliased vid mem
  724. LPVOID lpAlias; // start of heap alias
  725. DWORD dwAliasSize; // size of alias allocated
  726. } HEAPALIAS;
  727. typedef HEAPALIAS FAR *LPHEAPALIAS;
  728. typedef struct _HEAPALIASINFO // PRIVATE
  729. {
  730. DWORD dwRefCnt; // reference count of these aliases
  731. DWORD dwFlags; // flags
  732. DWORD dwNumHeaps; // number of aliased heaps
  733. LPHEAPALIAS lpAliases; // array of heaps
  734. } HEAPALIASINFO;
  735. typedef HEAPALIASINFO FAR *LPHEAPALIASINFO;
  736. #define HEAPALIASINFO_MAPPEDREAL 0x00000001l // PRIVATE: heap aliases mapped to real video memory
  737. #define HEAPALIASINFO_MAPPEDDUMMY 0x00000002l // PRIVATE: heap aliased mapped to dummy memory
  738. typedef struct _DDRAWI_DIRECTDRAW_INT FAR *LPDDRAWI_DIRECTDRAW_INT;
  739. typedef struct _DDRAWI_DIRECTDRAW_LCL FAR *LPDDRAWI_DIRECTDRAW_LCL;
  740. typedef struct _DDRAWI_DIRECTDRAW_GBL FAR *LPDDRAWI_DIRECTDRAW_GBL;
  741. typedef struct _DDRAWI_DDRAWSURFACE_GBL FAR *LPDDRAWI_DDRAWSURFACE_GBL;
  742. typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE FAR *LPDDRAWI_DDRAWSURFACE_GBL_MORE;
  743. typedef struct _DDRAWI_DDRAWPALETTE_GBL FAR *LPDDRAWI_DDRAWPALETTE_GBL;
  744. typedef struct _DDRAWI_DDRAWPALETTE_INT FAR *LPDDRAWI_DDRAWPALETTE_INT;
  745. typedef struct _DDRAWI_DDRAWCLIPPER_INT FAR *LPDDRAWI_DDRAWCLIPPER_INT;
  746. typedef struct _DDRAWI_DDRAWCLIPPER_GBL FAR *LPDDRAWI_DDRAWCLIPPER_GBL;
  747. typedef struct _DDRAWI_DDRAWSURFACE_MORE FAR *LPDDRAWI_DDRAWSURFACE_MORE;
  748. typedef struct _DDRAWI_DDRAWSURFACE_LCL FAR *LPDDRAWI_DDRAWSURFACE_LCL;
  749. typedef struct _DDRAWI_DDRAWSURFACE_INT FAR *LPDDRAWI_DDRAWSURFACE_INT;
  750. typedef struct _DDRAWI_DDVIDEOPORT_INT FAR *LPDDRAWI_DDVIDEOPORT_INT;
  751. typedef struct _DDRAWI_DDVIDEOPORT_LCL FAR *LPDDRAWI_DDVIDEOPORT_LCL;
  752. typedef struct _DDRAWI_DDRAWPALETTE_LCL FAR *LPDDRAWI_DDRAWPALETTE_LCL;
  753. typedef struct _DDRAWI_DDRAWCLIPPER_LCL FAR *LPDDRAWI_DDRAWCLIPPER_LCL;
  754. typedef struct _DDRAWI_DDMOTIONCOMP_INT FAR *LPDDRAWI_DDMOTIONCOMP_INT;
  755. typedef struct _DDRAWI_DDMOTIONCOMP_LCL FAR *LPDDRAWI_DDMOTIONCOMP_LCL;
  756. /*
  757. * List of IUnknowns aggregated by a DirectDraw surface.
  758. */
  759. typedef struct _IUNKNOWN_LIST
  760. {
  761. struct _IUNKNOWN_LIST FAR *lpLink;
  762. GUID FAR *lpGuid;
  763. IUnknown FAR *lpIUnknown;
  764. } IUNKNOWN_LIST;
  765. typedef IUNKNOWN_LIST FAR *LPIUNKNOWN_LIST;
  766. /*
  767. * hardware emulation layer stuff
  768. */
  769. typedef BOOL (FAR PASCAL *LPDDHEL_INIT)(LPDDRAWI_DIRECTDRAW_GBL,BOOL);
  770. /*
  771. * These structures contain the entry points in the display driver that
  772. * DDRAW will call. Entries that the display driver does not care about
  773. * should be NULL. Passed to DDRAW in DDHALINFO.
  774. */
  775. /*
  776. * DIRECTDRAW object callbacks
  777. */
  778. typedef DWORD (FAR PASCAL *LPDDHAL_SETCOLORKEY)(LPDDHAL_DRVSETCOLORKEYDATA );
  779. typedef DWORD (FAR PASCAL *LPDDHAL_CANCREATESURFACE)(LPDDHAL_CANCREATESURFACEDATA );
  780. typedef DWORD (FAR PASCAL *LPDDHAL_WAITFORVERTICALBLANK)(LPDDHAL_WAITFORVERTICALBLANKDATA );
  781. typedef DWORD (FAR PASCAL *LPDDHAL_CREATESURFACE)(LPDDHAL_CREATESURFACEDATA);
  782. typedef DWORD (FAR PASCAL *LPDDHAL_DESTROYDRIVER)(LPDDHAL_DESTROYDRIVERDATA);
  783. typedef DWORD (FAR PASCAL *LPDDHAL_SETMODE)(LPDDHAL_SETMODEDATA);
  784. typedef DWORD (FAR PASCAL *LPDDHAL_CREATEPALETTE)(LPDDHAL_CREATEPALETTEDATA);
  785. typedef DWORD (FAR PASCAL *LPDDHAL_GETSCANLINE)(LPDDHAL_GETSCANLINEDATA);
  786. typedef DWORD (FAR PASCAL *LPDDHAL_SETEXCLUSIVEMODE)(LPDDHAL_SETEXCLUSIVEMODEDATA);
  787. typedef DWORD (FAR PASCAL *LPDDHAL_FLIPTOGDISURFACE)(LPDDHAL_FLIPTOGDISURFACEDATA);
  788. typedef DWORD (FAR PASCAL *LPDDHAL_GETDRIVERINFO)(LPDDHAL_GETDRIVERINFODATA);
  789. typedef struct _DDHAL_DDCALLBACKS
  790. {
  791. DWORD dwSize;
  792. DWORD dwFlags;
  793. LPDDHAL_DESTROYDRIVER DestroyDriver;
  794. LPDDHAL_CREATESURFACE CreateSurface;
  795. LPDDHAL_SETCOLORKEY SetColorKey;
  796. LPDDHAL_SETMODE SetMode;
  797. LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank;
  798. LPDDHAL_CANCREATESURFACE CanCreateSurface;
  799. LPDDHAL_CREATEPALETTE CreatePalette;
  800. LPDDHAL_GETSCANLINE GetScanLine;
  801. // *** New fields for DX2 *** //
  802. LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
  803. LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
  804. //@@BEGIN_DDKSPLIT
  805. // For backward compatibility with pre-DX5 runtimes, must not
  806. // add fields to this structure. Use GetDriverInfo instead.
  807. //@@END_DDKSPLIT
  808. } DDHAL_DDCALLBACKS;
  809. typedef DDHAL_DDCALLBACKS FAR *LPDDHAL_DDCALLBACKS;
  810. #define DDCALLBACKSSIZE_V1 ( offsetof( DDHAL_DDCALLBACKS, SetExclusiveMode ) )
  811. #define DDCALLBACKSSIZE sizeof( DDHAL_DDCALLBACKS )
  812. #define DDHAL_CB32_DESTROYDRIVER 0x00000001l
  813. #define DDHAL_CB32_CREATESURFACE 0x00000002l
  814. #define DDHAL_CB32_SETCOLORKEY 0x00000004l
  815. #define DDHAL_CB32_SETMODE 0x00000008l
  816. #define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l
  817. #define DDHAL_CB32_CANCREATESURFACE 0x00000020l
  818. #define DDHAL_CB32_CREATEPALETTE 0x00000040l
  819. #define DDHAL_CB32_GETSCANLINE 0x00000080l
  820. #define DDHAL_CB32_SETEXCLUSIVEMODE 0x00000100l
  821. #define DDHAL_CB32_FLIPTOGDISURFACE 0x00000200l
  822. /*
  823. * DIRECTDRAWPALETTE object callbacks
  824. */
  825. typedef DWORD (FAR PASCAL *LPDDHALPALCB_DESTROYPALETTE)(LPDDHAL_DESTROYPALETTEDATA );
  826. typedef DWORD (FAR PASCAL *LPDDHALPALCB_SETENTRIES)(LPDDHAL_SETENTRIESDATA );
  827. typedef struct _DDHAL_DDPALETTECALLBACKS
  828. {
  829. DWORD dwSize;
  830. DWORD dwFlags;
  831. LPDDHALPALCB_DESTROYPALETTE DestroyPalette;
  832. LPDDHALPALCB_SETENTRIES SetEntries;
  833. } DDHAL_DDPALETTECALLBACKS;
  834. typedef DDHAL_DDPALETTECALLBACKS FAR *LPDDHAL_DDPALETTECALLBACKS;
  835. #define DDPALETTECALLBACKSSIZE sizeof( DDHAL_DDPALETTECALLBACKS )
  836. #define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l
  837. #define DDHAL_PALCB32_SETENTRIES 0x00000002l
  838. /*
  839. * DIRECTDRAWSURFACE object callbacks
  840. */
  841. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_LOCK)(LPDDHAL_LOCKDATA);
  842. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_UNLOCK)(LPDDHAL_UNLOCKDATA);
  843. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_BLT)(LPDDHAL_BLTDATA);
  844. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_UPDATEOVERLAY)(LPDDHAL_UPDATEOVERLAYDATA);
  845. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_SETOVERLAYPOSITION)(LPDDHAL_SETOVERLAYPOSITIONDATA);
  846. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_SETPALETTE)(LPDDHAL_SETPALETTEDATA);
  847. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_FLIP)(LPDDHAL_FLIPDATA);
  848. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_DESTROYSURFACE)(LPDDHAL_DESTROYSURFACEDATA);
  849. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_SETCLIPLIST)(LPDDHAL_SETCLIPLISTDATA);
  850. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_ADDATTACHEDSURFACE)(LPDDHAL_ADDATTACHEDSURFACEDATA);
  851. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_SETCOLORKEY)(LPDDHAL_SETCOLORKEYDATA);
  852. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_GETBLTSTATUS)(LPDDHAL_GETBLTSTATUSDATA);
  853. typedef DWORD (FAR PASCAL *LPDDHALSURFCB_GETFLIPSTATUS)(LPDDHAL_GETFLIPSTATUSDATA);
  854. typedef struct _DDHAL_DDSURFACECALLBACKS
  855. {
  856. DWORD dwSize;
  857. DWORD dwFlags;
  858. LPDDHALSURFCB_DESTROYSURFACE DestroySurface;
  859. LPDDHALSURFCB_FLIP Flip;
  860. LPDDHALSURFCB_SETCLIPLIST SetClipList;
  861. LPDDHALSURFCB_LOCK Lock;
  862. LPDDHALSURFCB_UNLOCK Unlock;
  863. LPDDHALSURFCB_BLT Blt;
  864. LPDDHALSURFCB_SETCOLORKEY SetColorKey;
  865. LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
  866. LPDDHALSURFCB_GETBLTSTATUS GetBltStatus;
  867. LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus;
  868. LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay;
  869. LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition;
  870. LPVOID reserved4;
  871. LPDDHALSURFCB_SETPALETTE SetPalette;
  872. } DDHAL_DDSURFACECALLBACKS;
  873. typedef DDHAL_DDSURFACECALLBACKS FAR *LPDDHAL_DDSURFACECALLBACKS;
  874. #define DDSURFACECALLBACKSSIZE sizeof( DDHAL_DDSURFACECALLBACKS )
  875. #define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001l
  876. #define DDHAL_SURFCB32_FLIP 0x00000002l
  877. #define DDHAL_SURFCB32_SETCLIPLIST 0x00000004l
  878. #define DDHAL_SURFCB32_LOCK 0x00000008l
  879. #define DDHAL_SURFCB32_UNLOCK 0x00000010l
  880. #define DDHAL_SURFCB32_BLT 0x00000020l
  881. #define DDHAL_SURFCB32_SETCOLORKEY 0x00000040l
  882. #define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080l
  883. #define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100l
  884. #define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200l
  885. #define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400l
  886. #define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800l
  887. #define DDHAL_SURFCB32_RESERVED4 0x00001000l
  888. #define DDHAL_SURFCB32_SETPALETTE 0x00002000l
  889. // This structure can be queried from the driver from DX5 onward
  890. // using GetDriverInfo with GUID_MiscellaneousCallbacks
  891. typedef DWORD (FAR PASCAL *LPDDHAL_GETAVAILDRIVERMEMORY)(LPDDHAL_GETAVAILDRIVERMEMORYDATA);
  892. typedef DWORD (FAR PASCAL *LPDDHAL_UPDATENONLOCALHEAP)(LPDDHAL_UPDATENONLOCALHEAPDATA);
  893. typedef DWORD (FAR PASCAL *LPDDHAL_GETHEAPALIGNMENT)(LPDDHAL_GETHEAPALIGNMENTDATA);
  894. /*
  895. * This prototype is identical to that of GetBltStatus
  896. */
  897. typedef struct _DDHAL_DDMISCELLANEOUSCALLBACKS {
  898. DWORD dwSize;
  899. DWORD dwFlags;
  900. LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory;
  901. LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap;
  902. LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment;
  903. /*
  904. * The GetSysmemBltStatus callback uses the same prototype as GetBltStatus.
  905. * It is legal to point both pointers to the same driver routine.
  906. */
  907. LPDDHALSURFCB_GETBLTSTATUS GetSysmemBltStatus;
  908. } DDHAL_DDMISCELLANEOUSCALLBACKS, *LPDDHAL_DDMISCELLANEOUSCALLBACKS;
  909. #define DDHAL_MISCCB32_GETAVAILDRIVERMEMORY 0x00000001l
  910. #define DDHAL_MISCCB32_UPDATENONLOCALHEAP 0x00000002l
  911. #define DDHAL_MISCCB32_GETHEAPALIGNMENT 0x00000004l
  912. #define DDHAL_MISCCB32_GETSYSMEMBLTSTATUS 0x00000008l
  913. #define DDMISCELLANEOUSCALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUSCALLBACKS)
  914. //@@BEGIN_DDKSPLIT
  915. // This structure can be queried from the driver from NT5 onward
  916. // using GetDriverInfo with GUID_NTCallbacks
  917. typedef DWORD (FAR PASCAL *LPDDHAL_SETEXCLUSIVEMODE)(LPDDHAL_SETEXCLUSIVEMODEDATA);
  918. typedef DWORD (FAR PASCAL *LPDDHAL_FLIPTOGDISURFACE)(LPDDHAL_FLIPTOGDISURFACEDATA);
  919. typedef struct _DDHAL_DDNTCALLBACKS {
  920. DWORD dwSize;
  921. DWORD dwFlags;
  922. LPVOID FreeDriverMemory; // kernel-mode only
  923. LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode;
  924. LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface;
  925. } DDHAL_DDNTCALLBACKS, *LPDDHAL_DDNTCALLBACKS;
  926. #define DDHAL_NTCB32_FREEDRIVERMEMORY 0x00000001l
  927. #define DDHAL_NTCB32_SETEXCLUSIVEMODE 0x00000002l
  928. #define DDHAL_NTCB32_FLIPTOGDISURFACE 0x00000004l
  929. #define DDNTCALLBACKSSIZE sizeof(DDHAL_DDNTCALLBACKS)
  930. // This structure can be queried from the driver from Whistler onward
  931. // using GetDriverInfo with GUID_NTCallbacks
  932. typedef DWORD (FAR PASCAL *LPDDHAL_ACQUIREVPORTNOTIFICATION)(LPDDRAWI_DDVIDEOPORT_LCL,HANDLE*,LPDDVIDEOPORTNOTIFY);
  933. typedef DWORD (FAR PASCAL *LPDDHAL_RELEASEVPORTNOTIFICATION)(LPDDRAWI_DDVIDEOPORT_LCL,HANDLE);
  934. typedef struct _DDHAL_DDVPE2CALLBACKS {
  935. DWORD dwSize;
  936. DWORD dwFlags;
  937. LPDDHAL_ACQUIREVPORTNOTIFICATION AcquireNotification;
  938. LPDDHAL_RELEASEVPORTNOTIFICATION ReleaseNotification;
  939. } DDHAL_DDVPE2CALLBACKS, *LPDDHAL_DDVPE2CALLBACKS;
  940. #define DDHAL_VPE2CB32_ACQUIRENOTIFICATION 0x00000001l
  941. #define DDHAL_VPE2CB32_RELEASENOTIFICATION 0x00000002l
  942. #define DDVPE2CALLBACKSSIZE sizeof(DDHAL_DDVPE2CALLBACKS)
  943. //@@END_DDKSPLIT
  944. // DDHAL_DDMISCELLANEOUS2CALLBACKS:
  945. // This structure can be queried from the driver from DX7 onward
  946. // using GetDriverInfo with GUID_Miscellaneous2Callbacks
  947. typedef DWORD (FAR PASCAL *LPDDHAL_CREATESURFACEEX)(LPDDHAL_CREATESURFACEEXDATA);
  948. typedef DWORD (FAR PASCAL *LPDDHAL_GETDRIVERSTATE)(LPDDHAL_GETDRIVERSTATEDATA);
  949. typedef DWORD (FAR PASCAL *LPDDHAL_DESTROYDDLOCAL)(LPDDHAL_DESTROYDDLOCALDATA);
  950. //@@BEGIN_DDKSPLIT
  951. typedef DWORD (FAR PASCAL *LPDDHAL_ALPHABLT)(LPDDHAL_BLTDATA);
  952. #ifdef POSTPONED2
  953. typedef DWORD (FAR PASCAL *LPDDHAL_SETSPRITEDISPLAYLIST)(LPDDHAL_SETSPRITEDISPLAYLISTDATA);
  954. typedef DWORD (FAR PASCAL *LPDDHAL_RESIZE)(LPDDHAL_RESIZEDATA);
  955. typedef DWORD (FAR PASCAL *LPDDHAL_CAPTURECOMPOSITIONBUFFER)(LPDDHAL_CAPTURECOMPOSITIONBUFFERDATA);
  956. #endif //POSTPONED2
  957. //@@END_DDKSPLIT
  958. typedef struct _DDHAL_DDMISCELLANEOUS2CALLBACKS {
  959. DWORD dwSize;
  960. DWORD dwFlags;
  961. //@@BEGIN_DDKSPLIT
  962. #if 1
  963. LPDDHAL_ALPHABLT AlphaBlt;
  964. #else
  965. //@@END_DDKSPLIT
  966. LPVOID Reserved;
  967. //@@BEGIN_DDKSPLIT
  968. #endif
  969. //@@END_DDKSPLIT
  970. LPDDHAL_CREATESURFACEEX CreateSurfaceEx;
  971. LPDDHAL_GETDRIVERSTATE GetDriverState;
  972. LPDDHAL_DESTROYDDLOCAL DestroyDDLocal;
  973. //@@BEGIN_DDKSPLIT
  974. #ifdef POSTPONED2
  975. LPDDHAL_SETSPRITEDISPLAYLIST SetSpriteDisplayList;
  976. LPDDHAL_RESIZE Resize;
  977. LPDDHAL_CAPTURECOMPOSITIONBUFFER CaptureCompositionBuffer;
  978. #endif //POSTPONED2
  979. //@@END_DDKSPLIT
  980. } DDHAL_DDMISCELLANEOUS2CALLBACKS, *LPDDHAL_DDMISCELLANEOUS2CALLBACKS;
  981. #define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002l
  982. #define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004l
  983. #define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008l
  984. //@@BEGIN_DDKSPLIT
  985. #define DDHAL_MISC2CB32_ALPHABLT 0x00000001l
  986. // ***** POSTPONED2 fields must NOT be ahead of other field as dwFlags bits must be contiguous
  987. // ValidateCallbacks() is enforing this ******
  988. #ifdef POSTPONED2
  989. #define DDHAL_MISC2CB32_SETSPRITEDISPLAYLIST 0x00000008l
  990. #define DDHAL_MISC2CB32_RESIZE 0x00000010l
  991. #define DDHAL_MISC2CB32_CAPTURECOMPOSITIONBUFFER 0x00000020l
  992. #endif //POSTPONED2
  993. //@@END_DDKSPLIT
  994. #define DDMISCELLANEOUS2CALLBACKSSIZE sizeof(DDHAL_DDMISCELLANEOUS2CALLBACKS)
  995. /*
  996. * DIRECTDRAWEXEBUF pseudo object callbacks
  997. *
  998. * NOTE: Execute buffers are not a distinct object type, they piggy back off
  999. * the surface data structures and high level API. However, they have their
  1000. * own HAL callbacks as they may have different driver semantics from "normal"
  1001. * surfaces. They also piggy back off the HAL data structures.
  1002. *
  1003. * !!! NOTE: Need to resolve whether we export execute buffer copying as a
  1004. * blit or some other from of copy instruction.
  1005. */
  1006. typedef DWORD (FAR PASCAL *LPDDHALEXEBUFCB_CANCREATEEXEBUF)(LPDDHAL_CANCREATESURFACEDATA );
  1007. typedef DWORD (FAR PASCAL *LPDDHALEXEBUFCB_CREATEEXEBUF)(LPDDHAL_CREATESURFACEDATA);
  1008. typedef DWORD (FAR PASCAL *LPDDHALEXEBUFCB_DESTROYEXEBUF)(LPDDHAL_DESTROYSURFACEDATA);
  1009. typedef DWORD (FAR PASCAL *LPDDHALEXEBUFCB_LOCKEXEBUF)(LPDDHAL_LOCKDATA);
  1010. typedef DWORD (FAR PASCAL *LPDDHALEXEBUFCB_UNLOCKEXEBUF)(LPDDHAL_UNLOCKDATA);
  1011. typedef struct _DDHAL_DDEXEBUFCALLBACKS
  1012. {
  1013. DWORD dwSize;
  1014. DWORD dwFlags;
  1015. LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer;
  1016. LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer;
  1017. LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer;
  1018. LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer;
  1019. LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer;
  1020. } DDHAL_DDEXEBUFCALLBACKS;
  1021. typedef DDHAL_DDEXEBUFCALLBACKS FAR *LPDDHAL_DDEXEBUFCALLBACKS;
  1022. #define DDEXEBUFCALLBACKSSIZE sizeof( DDHAL_DDEXEBUFCALLBACKS )
  1023. #define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001l
  1024. #define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002l
  1025. #define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004l
  1026. #define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008l
  1027. #define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010l
  1028. /*
  1029. * DIRECTVIDEOPORT object callbacks
  1030. */
  1031. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_CANCREATEVIDEOPORT)(LPDDHAL_CANCREATEVPORTDATA);
  1032. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_CREATEVIDEOPORT)(LPDDHAL_CREATEVPORTDATA);
  1033. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_FLIP)(LPDDHAL_FLIPVPORTDATA);
  1034. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETBANDWIDTH)(LPDDHAL_GETVPORTBANDWIDTHDATA);
  1035. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETINPUTFORMATS)(LPDDHAL_GETVPORTINPUTFORMATDATA);
  1036. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETOUTPUTFORMATS)(LPDDHAL_GETVPORTOUTPUTFORMATDATA);
  1037. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETFIELD)(LPDDHAL_GETVPORTFIELDDATA);
  1038. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETLINE)(LPDDHAL_GETVPORTLINEDATA);
  1039. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETVPORTCONNECT)(LPDDHAL_GETVPORTCONNECTDATA);
  1040. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_DESTROYVPORT)(LPDDHAL_DESTROYVPORTDATA);
  1041. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETFLIPSTATUS)(LPDDHAL_GETVPORTFLIPSTATUSDATA);
  1042. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_UPDATE)(LPDDHAL_UPDATEVPORTDATA);
  1043. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_WAITFORSYNC)(LPDDHAL_WAITFORVPORTSYNCDATA);
  1044. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_GETSIGNALSTATUS)(LPDDHAL_GETVPORTSIGNALDATA);
  1045. typedef DWORD (FAR PASCAL *LPDDHALVPORTCB_COLORCONTROL)(LPDDHAL_VPORTCOLORDATA);
  1046. typedef struct _DDHAL_DDVIDEOPORTCALLBACKS
  1047. {
  1048. DWORD dwSize;
  1049. DWORD dwFlags;
  1050. LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort;
  1051. LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort;
  1052. LPDDHALVPORTCB_FLIP FlipVideoPort;
  1053. LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth;
  1054. LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats;
  1055. LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats;
  1056. LPVOID lpReserved1;
  1057. LPDDHALVPORTCB_GETFIELD GetVideoPortField;
  1058. LPDDHALVPORTCB_GETLINE GetVideoPortLine;
  1059. LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo;
  1060. LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort;
  1061. LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus;
  1062. LPDDHALVPORTCB_UPDATE UpdateVideoPort;
  1063. LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync;
  1064. LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus;
  1065. LPDDHALVPORTCB_COLORCONTROL ColorControl;
  1066. } DDHAL_DDVIDEOPORTCALLBACKS;
  1067. typedef DDHAL_DDVIDEOPORTCALLBACKS FAR *LPDDHAL_DDVIDEOPORTCALLBACKS;
  1068. #define DDVIDEOPORTCALLBACKSSIZE sizeof( DDHAL_DDVIDEOPORTCALLBACKS )
  1069. #define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001l
  1070. #define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002l
  1071. #define DDHAL_VPORT32_FLIP 0x00000004l
  1072. #define DDHAL_VPORT32_GETBANDWIDTH 0x00000008l
  1073. #define DDHAL_VPORT32_GETINPUTFORMATS 0x00000010l
  1074. #define DDHAL_VPORT32_GETOUTPUTFORMATS 0x00000020l
  1075. #define DDHAL_VPORT32_GETFIELD 0x00000080l
  1076. #define DDHAL_VPORT32_GETLINE 0x00000100l
  1077. #define DDHAL_VPORT32_GETCONNECT 0x00000200l
  1078. #define DDHAL_VPORT32_DESTROY 0x00000400l
  1079. #define DDHAL_VPORT32_GETFLIPSTATUS 0x00000800l
  1080. #define DDHAL_VPORT32_UPDATE 0x00001000l
  1081. #define DDHAL_VPORT32_WAITFORSYNC 0x00002000l
  1082. #define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000l
  1083. #define DDHAL_VPORT32_COLORCONTROL 0x00008000l
  1084. /*
  1085. * DIRECTDRAWCOLORCONTROL object callbacks
  1086. */
  1087. typedef DWORD (FAR PASCAL *LPDDHALCOLORCB_COLORCONTROL)(LPDDHAL_COLORCONTROLDATA);
  1088. typedef struct _DDHAL_DDCOLORCONTROLCALLBACKS
  1089. {
  1090. DWORD dwSize;
  1091. DWORD dwFlags;
  1092. LPDDHALCOLORCB_COLORCONTROL ColorControl;
  1093. } DDHAL_DDCOLORCONTROLCALLBACKS;
  1094. typedef DDHAL_DDCOLORCONTROLCALLBACKS FAR *LPDDHAL_DDCOLORCONTROLCALLBACKS;
  1095. #define DDCOLORCONTROLCALLBACKSSIZE sizeof( DDHAL_DDCOLORCONTROLCALLBACKS )
  1096. #define DDHAL_COLOR_COLORCONTROL 0x00000001l
  1097. /*
  1098. * DIRECTDRAWSURFACEKERNEL object callbacks
  1099. * This structure can be queried from the driver from DX5 onward
  1100. * using GetDriverInfo with GUID_KernelCallbacks
  1101. */
  1102. typedef DWORD (FAR PASCAL *LPDDHALKERNELCB_SYNCSURFACE)(LPDDHAL_SYNCSURFACEDATA);
  1103. typedef DWORD (FAR PASCAL *LPDDHALKERNELCB_SYNCVIDEOPORT)(LPDDHAL_SYNCVIDEOPORTDATA);
  1104. typedef struct _DDHAL_DDKERNELCALLBACKS
  1105. {
  1106. DWORD dwSize;
  1107. DWORD dwFlags;
  1108. LPDDHALKERNELCB_SYNCSURFACE SyncSurfaceData;
  1109. LPDDHALKERNELCB_SYNCVIDEOPORT SyncVideoPortData;
  1110. } DDHAL_DDKERNELCALLBACKS, *LPDDHAL_DDKERNELCALLBACKS;
  1111. #define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001l
  1112. #define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002l
  1113. #define DDKERNELCALLBACKSSIZE sizeof(DDHAL_DDKERNELCALLBACKS)
  1114. typedef HRESULT (WINAPI *LPDDGAMMACALIBRATORPROC)( LPDDGAMMARAMP, LPBYTE);
  1115. /*
  1116. * DIRECTDRAWMOTIONCOMP object callbacks
  1117. */
  1118. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_GETGUIDS)( LPDDHAL_GETMOCOMPGUIDSDATA);
  1119. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_GETFORMATS)( LPDDHAL_GETMOCOMPFORMATSDATA);
  1120. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_CREATE)( LPDDHAL_CREATEMOCOMPDATA);
  1121. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_GETCOMPBUFFINFO)( LPDDHAL_GETMOCOMPCOMPBUFFDATA);
  1122. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_GETINTERNALINFO)( LPDDHAL_GETINTERNALMOCOMPDATA);
  1123. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_BEGINFRAME)( LPDDHAL_BEGINMOCOMPFRAMEDATA);
  1124. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_ENDFRAME)( LPDDHAL_ENDMOCOMPFRAMEDATA);
  1125. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_RENDER)( LPDDHAL_RENDERMOCOMPDATA);
  1126. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_QUERYSTATUS)( LPDDHAL_QUERYMOCOMPSTATUSDATA);
  1127. typedef DWORD (FAR PASCAL *LPDDHALMOCOMPCB_DESTROY)( LPDDHAL_DESTROYMOCOMPDATA);
  1128. typedef struct _DDHAL_DDMOTIONCOMPCALLBACKS
  1129. {
  1130. DWORD dwSize;
  1131. DWORD dwFlags;
  1132. LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids;
  1133. LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats;
  1134. LPDDHALMOCOMPCB_CREATE CreateMoComp;
  1135. LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
  1136. LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
  1137. LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame;
  1138. LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame;
  1139. LPDDHALMOCOMPCB_RENDER RenderMoComp;
  1140. LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus;
  1141. LPDDHALMOCOMPCB_DESTROY DestroyMoComp;
  1142. } DDHAL_DDMOTIONCOMPCALLBACKS;
  1143. typedef DDHAL_DDMOTIONCOMPCALLBACKS FAR *LPDDHAL_DDMOTIONCOMPCALLBACKS;
  1144. #define DDMOTIONCOMPCALLBACKSSIZE sizeof( DDHAL_DDMOTIONCOMPCALLBACKS )
  1145. #define DDHAL_MOCOMP32_GETGUIDS 0x00000001
  1146. #define DDHAL_MOCOMP32_GETFORMATS 0x00000002
  1147. #define DDHAL_MOCOMP32_CREATE 0x00000004
  1148. #define DDHAL_MOCOMP32_GETCOMPBUFFINFO 0x00000008
  1149. #define DDHAL_MOCOMP32_GETINTERNALINFO 0x00000010
  1150. #define DDHAL_MOCOMP32_BEGINFRAME 0x00000020
  1151. #define DDHAL_MOCOMP32_ENDFRAME 0x00000040
  1152. #define DDHAL_MOCOMP32_RENDER 0x00000080
  1153. #define DDHAL_MOCOMP32_QUERYSTATUS 0x00000100
  1154. #define DDHAL_MOCOMP32_DESTROY 0x00000200
  1155. //@@BEGIN_DDKSPLIT
  1156. #ifdef POSTPONED
  1157. /*
  1158. * DDHAL_DDUMODEDRVINFO object callbacks
  1159. * Contains the data required for supporting user mode drivers.
  1160. * This structure can be queried from the driver from DX6 onwards using:
  1161. * GetDriverInfo with GUID_UserModeDriverInfo
  1162. */
  1163. typedef struct _DDHAL_DDUMODEDRVINFO
  1164. {
  1165. DWORD dwSize;
  1166. DWORD dwFlags;
  1167. LPSTR lpszDllName;
  1168. GUID uniqueGuid;
  1169. ULONG_PTR dwReserved1;
  1170. } DDHAL_DDUMODEDRVINFO, *LPDDHAL_DDUMODEDRVINFO;
  1171. #define DDHAL_DDUMODEDRVINFOSIZE sizeof( DDHAL_DDUMODEDRVINFO )
  1172. #define DDHAL_UMODEDRV_DLLNAME 0x00000001
  1173. #define DDHAL_UMODEDRV_UNIQGUID 0x00000002
  1174. #define DDHAL_UMODEDRV_ALL 0x00000003
  1175. /*
  1176. * DDHAL_DDUMODEDRVPASSWD object callbacks
  1177. * This structure is used to query the usermode driver for its password GUID
  1178. * (GetDriverInfo with GUID_UserModeDriverPassword)
  1179. */
  1180. typedef struct _DDHAL_DDUMODEDRVPASSWD
  1181. {
  1182. DWORD dwSize;
  1183. DWORD dwFlags;
  1184. GUID passwdGuid;
  1185. } DDHAL_DDUMODEDRVPASSWD, *LPDDHAL_DDUMODEDRVPASSWD;
  1186. #define DDHAL_DDUMODEDRVPASSWDSIZE sizeof( DDHAL_DDUMODEDRVPASSWD )
  1187. #define DDHAL_UMODEDRV_GUID 0x00000001
  1188. /*
  1189. * This structure is used to store relevant information about the
  1190. * user-mode driver in DDRAW_GBL
  1191. */
  1192. typedef struct _DDUMODEDRVINFO
  1193. {
  1194. LPVOID lpszDllName; // need not be saved
  1195. HMODULE hUmodeDll;
  1196. GUID uniqueGuid; // need not be saved
  1197. LPDDHAL_GETDRIVERINFO GetDriverInfo;
  1198. } DDUMODEDRVINFO, *LPDDUMODEDRVINFO;
  1199. //
  1200. // DDOPTSURFACE
  1201. // Contains the callbacks and data required for supporting Optimized surfaces.
  1202. // This structure can be queried from the driver from DX6 onwards using:
  1203. // GetDriverInfo with GUID_OptSurfaceKmodeInfo and
  1204. // GetUmodeDriverInfo with GUID_OptSurfaceUmodeInfo.
  1205. //
  1206. typedef DWORD (FAR PASCAL *LPDDHALOPTSURFCB_CANOPTIMIZESURFACE)( LPDDHAL_CANOPTIMIZESURFACEDATA);
  1207. typedef DWORD (FAR PASCAL *LPDDHALOPTSURFCB_OPTIMIZESURFACE)( LPDDHAL_OPTIMIZESURFACEDATA);
  1208. typedef DWORD (FAR PASCAL *LPDDHALOPTSURFCB_UNOPTIMIZESURFACE)( LPDDHAL_UNOPTIMIZESURFACEDATA);
  1209. typedef DWORD (FAR PASCAL *LPDDHALOPTSURFCB_COPYOPTSURFACE)( LPDDHAL_COPYOPTSURFACEDATA);
  1210. typedef DWORD (FAR PASCAL *LPDDHALOPTSURFCB_KMODESVC)( LPDDHAL_KMODESVCDATA);
  1211. //
  1212. // This structure is used to store the Opt Surface information
  1213. // in DDRAWI_GBL
  1214. //
  1215. typedef struct _DDOPTSURFACEINFO
  1216. {
  1217. // Umode information
  1218. DWORD dwNumGuids;
  1219. LPGUID lpGuidArray;
  1220. LPDDHALOPTSURFCB_CANOPTIMIZESURFACE CanOptimizeSurface;
  1221. LPDDHALOPTSURFCB_OPTIMIZESURFACE OptimizeSurface;
  1222. LPDDHALOPTSURFCB_UNOPTIMIZESURFACE UnOptimizeSurface;
  1223. LPDDHALOPTSURFCB_COPYOPTSURFACE CopyOptSurface;
  1224. // Kmode information
  1225. LPDDHALOPTSURFCB_KMODESVC KmodeService;
  1226. } DDOPTSURFACEINFO, *LPDDOPTSURFACEINFO;
  1227. //
  1228. // This structure is used for obtaining Opt Surface kernel mode data
  1229. //
  1230. typedef struct _DDHAL_DDOPTSURFACEKMODEINFO
  1231. {
  1232. DWORD dwSize;
  1233. DWORD dwFlags;
  1234. LPDDHALOPTSURFCB_KMODESVC KmodeService;
  1235. ULONG_PTR dwReserved2;
  1236. } DDHAL_DDOPTSURFACEKMODEINFO, *LPDDHAL_DDOPTSURFACEKMODEINFO;
  1237. #define DDOPTSURFACEKMODEINFOSIZE sizeof( DDHAL_DDOPTSURFACEKMODEINFO )
  1238. #define DDHAL_OPTSURFKMODE_KMODESVC 0x00000001
  1239. #define DDHAL_OPTSURFKMODE_ALL 0x00000001
  1240. //
  1241. // This structure is used for obtaining Opt Surface user mode data
  1242. //
  1243. typedef struct _DDHAL_DDOPTSURFACEUMODEINFO
  1244. {
  1245. DWORD dwSize;
  1246. DWORD dwFlags;
  1247. DWORD dwNumGuids;
  1248. LPGUID lpGuidArray;
  1249. LPDDHALOPTSURFCB_CANOPTIMIZESURFACE CanOptimizeSurface;
  1250. LPDDHALOPTSURFCB_OPTIMIZESURFACE OptimizeSurface;
  1251. LPDDHALOPTSURFCB_UNOPTIMIZESURFACE UnOptimizeSurface;
  1252. LPDDHALOPTSURFCB_COPYOPTSURFACE CopyOptSurface;
  1253. ULONG_PTR dwReserved1;
  1254. ULONG_PTR dwReserved2;
  1255. } DDHAL_DDOPTSURFACEUMODEINFO, *LPDDHAL_DDOPTSURFACEUMODEINFO;
  1256. #define DDOPTSURFACEUMODEINFOSIZE sizeof( DDHAL_DDOPTSURFACEUMODEINFO )
  1257. #define DDHAL_OPTSURFUMODE_NUMGUIDS 0x00000001
  1258. #define DDHAL_OPTSURFUMODE_GUIDARRAY 0x00000002
  1259. #define DDHAL_OPTSURFUMODE_CANOPTIMIZESURFACE 0x00000004
  1260. #define DDHAL_OPTSURFUMODE_OPTIMIZESURFACE 0x00000008
  1261. #define DDHAL_OPTSURFUMODE_UNOPTIMIZESURFACE 0x00000010
  1262. #define DDHAL_OPTSURFUMODE_COPYOPTSURFACE 0x00000020
  1263. #define DDHAL_OPTSURFUMODE_ALL 0x0000003f
  1264. #endif //POSTPONED
  1265. //@@END_DDKSPLIT
  1266. /*
  1267. * CALLBACK RETURN VALUES
  1268. * * these are values returned by the driver from the above callback routines
  1269. */
  1270. /*
  1271. * indicates that the display driver didn't do anything with the call
  1272. */
  1273. #define DDHAL_DRIVER_NOTHANDLED 0x00000000l
  1274. /*
  1275. * indicates that the display driver handled the call; HRESULT value is valid
  1276. */
  1277. #define DDHAL_DRIVER_HANDLED 0x00000001l
  1278. /*
  1279. * indicates that the display driver couldn't handle the call because it
  1280. * ran out of color key hardware resources
  1281. */
  1282. #define DDHAL_DRIVER_NOCKEYHW 0x00000002l
  1283. /*
  1284. * Capabilities structure for non-local video memory
  1285. */
  1286. typedef struct _DDNONLOCALVIDMEMCAPS
  1287. {
  1288. DWORD dwSize;
  1289. DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts
  1290. DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts
  1291. DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts
  1292. DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts
  1293. DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
  1294. } DDNONLOCALVIDMEMCAPS;
  1295. typedef struct _DDNONLOCALVIDMEMCAPS FAR *LPDDNONLOCALVIDMEMCAPS;
  1296. /*
  1297. * More driver surface capabilities (in addition to those described in DDCORECAPS).
  1298. * This struct contains the caps bits added to the DDCAPS.ddsCaps structure in DX6.
  1299. */
  1300. typedef struct _DDMORESURFACECAPS
  1301. {
  1302. DWORD dwSize; // size of DDMORESURFACECAPS structure
  1303. DDSCAPSEX ddsCapsMore;
  1304. /*
  1305. * The DDMORESURFACECAPS struct is of variable size. The following list may be
  1306. * filled in by DX6-aware drivers (see DDVERSIONINFO) to restrict their
  1307. * video memory heaps (those which are exposed to DirectDraw) to
  1308. * certain sets of DDSCAPS_ bits. Thse entries are exactly analogous to
  1309. * the ddsCaps and ddsCapsAlt members of the VIDMEM structures listed in
  1310. * the VIDMEMINFO.pvmList member of DDHALINFO.vmiData. There should be
  1311. * exactly DDHALINFO.vmiData.dwNumHeaps copies of tagExtendedHeapRestrictions
  1312. * in this struct. The size of this struct is thus:
  1313. * DDMORESURFACECAPS.dwSize = sizeof(DDMORESURFACECAPS) +
  1314. * (DDHALINFO.vmiData.dwNumHeaps-1) * sizeof(DDSCAPSEX)*2;
  1315. * Note the -1 accounts for the fact that DDMORESURFACECAPS is declared to have 1
  1316. * tagExtendedHeapRestrictions member.
  1317. */
  1318. struct tagExtendedHeapRestrictions
  1319. {
  1320. DDSCAPSEX ddsCapsEx;
  1321. DDSCAPSEX ddsCapsExAlt;
  1322. } ddsExtendedHeapRestrictions[1];
  1323. } DDMORESURFACECAPS, FAR * LPDDMORESURFACECAPS;
  1324. // Stereo, driver returns DD_OK if mode is ok for stereo
  1325. typedef struct _DDSTEREOMODE
  1326. {
  1327. DWORD dwSize; // size of DDSTEREOMODECAPS structure
  1328. DWORD dwHeight;
  1329. DWORD dwWidth;
  1330. DWORD dwBpp;
  1331. DWORD dwRefreshRate;
  1332. BOOL bSupported; // driver supports this video mode...
  1333. } DDSTEREOMODE, FAR * LPDDSTEREOMODE;
  1334. //@@BEGIN_DDKSPLIT
  1335. // For DX7, we define more DDraw driver caps (in addition to those in DDCORECAPS).
  1336. typedef struct _DDMORECAPS
  1337. {
  1338. DWORD dwSize; // size of DDMORECAPS structure
  1339. DWORD dwAlphaCaps; // driver-specific alpha caps for overlays & Vmem->Vmem blts
  1340. DWORD dwSVBAlphaCaps; // driver-specific alpha capabilities for System->Vmem blts
  1341. DWORD dwVSBAlphaCaps; // driver-specific alpha capabilities for Vmem->System blts
  1342. DWORD dwSSBAlphaCaps; // driver-specific alpha capabilities for System->System blts
  1343. DWORD dwFilterCaps; // driver-specific filter caps for overlays & Vmem->Vmem blts
  1344. DWORD dwSVBFilterCaps; // driver-specific filter capabilities for System->Vmem blts
  1345. DWORD dwVSBFilterCaps; // driver-specific filter capabilities for Vmem->System blts
  1346. DWORD dwSSBFilterCaps; // driver-specific filter capabilities for System->System blts
  1347. #ifdef POSTPONED2
  1348. DWORD dwTransformCaps; // driver-specific transform caps for overlays & Vmem->Vmem blts
  1349. DWORD dwSVBTransformCaps; // driver-specific transform capabilities for System->Vmem blts
  1350. DWORD dwVSBTransformCaps; // driver-specific transform capabilities for Vmem->System blts
  1351. DWORD dwSSBTransformCaps; // driver-specific transformn capabilities for System->System blts
  1352. DWORD dwBltAffineMinifyLimit; // minification limit for affine-transformed blits
  1353. DWORD dwOverlayAffineMinifyLimit; // minification limit for affine-transformed overlays
  1354. #endif
  1355. } DDMORECAPS, FAR * LPDDMORECAPS;
  1356. //@@END_DDKSPLIT
  1357. //@@BEGIN_DDKSPLIT
  1358. /*
  1359. * Private:
  1360. * Client data list element and head pointer
  1361. */
  1362. typedef struct _PRIVATEDATANODE
  1363. {
  1364. GUID guid;
  1365. LPBYTE pData;
  1366. DWORD cbData;
  1367. DWORD dwFlags;
  1368. DWORD dwContentsStamp;
  1369. struct _PRIVATEDATANODE *pNext;
  1370. } PRIVATEDATANODE, FAR* LPPRIVATEDATANODE;
  1371. //@@END_DDKSPLIT
  1372. /*
  1373. * DDRAW palette interface struct
  1374. */
  1375. typedef struct _DDRAWI_DDRAWPALETTE_INT
  1376. {
  1377. LPVOID lpVtbl; // pointer to array of interface methods
  1378. LPDDRAWI_DDRAWPALETTE_LCL lpLcl; // pointer to interface data
  1379. LPDDRAWI_DDRAWPALETTE_INT lpLink; // link to next interface
  1380. DWORD dwIntRefCnt; // interface reference count
  1381. //@@BEGIN_DDKSPLIT
  1382. ULONG_PTR dwReserved1; // for DDrawEx
  1383. ULONG_PTR dwReserved2; // for DDrawEx
  1384. //@@END_DDKSPLIT
  1385. } DDRAWI_DDRAWPALETTE_INT;
  1386. /*
  1387. * DDRAW internal version of DIRECTDRAWPALETTE object; it has data after the vtable
  1388. */
  1389. typedef struct _DDRAWI_DDRAWPALETTE_GBL
  1390. {
  1391. DWORD dwRefCnt; // reference count
  1392. DWORD dwFlags; // flags
  1393. LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // PRIVATE: DIRECTDRAW object
  1394. DWORD dwProcessId; // owning process
  1395. LPPALETTEENTRY lpColorTable; // array of palette entries
  1396. union
  1397. {
  1398. ULONG_PTR dwReserved1; // reserved for use by display driver which created this object
  1399. HPALETTE hHELGDIPalette;
  1400. };
  1401. /*
  1402. * Fields added in version 5.0. Check if the ddraw version >= 5 (passed during
  1403. * driver initialization) to see if these fields will be present.
  1404. */
  1405. DWORD dwDriverReserved; // For use by HAL, regardless of who created object
  1406. DWORD dwContentsStamp; // Incremented when palette changes.
  1407. /*
  1408. * Fields added in version 6
  1409. */
  1410. DWORD dwSaveStamp; // Incremented when palette changes.
  1411. /*
  1412. * And in version 7
  1413. */
  1414. DWORD dwHandle; //Handle used in drawprim2 palette notification
  1415. } DDRAWI_DDRAWPALETTE_GBL;
  1416. //@@BEGIN_DDKSPLIT
  1417. /* Macro to bump the contents stamp so drivers can cheaply check for changed palette data.
  1418. * Zero means no information
  1419. */
  1420. #define BUMP_PALETTE_STAMP(pal_gbl) \
  1421. if ( pal_gbl->dwContentsStamp ) \
  1422. { \
  1423. pal_gbl->dwContentsStamp++; \
  1424. if ( 0 == pal_gbl->dwContentsStamp) \
  1425. pal_gbl->dwContentsStamp++; \
  1426. }
  1427. //@@END_DDKSPLIT
  1428. /*
  1429. * (CMcC) The palette no longer maintains a back pointer to the owning surface
  1430. * (there may now be many owning surfaces). So the lpDDSurface is now dwReserved0
  1431. * (this mod. assumes that sizeof(DWORD) == sizeof(LPDDRAWI_DDRAWSURFACE_LCL). A
  1432. * fairly safe assumption I think.
  1433. */
  1434. typedef struct _DDRAWI_DDRAWPALETTE_LCL
  1435. {
  1436. DWORD lpPalMore; // pointer to additional local data
  1437. LPDDRAWI_DDRAWPALETTE_GBL lpGbl; // pointer to data
  1438. ULONG_PTR dwUnused0; // not currently used.
  1439. DWORD dwLocalRefCnt; // local ref cnt
  1440. IUnknown FAR *pUnkOuter; // outer IUnknown
  1441. LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // pointer to owning local driver object
  1442. ULONG_PTR dwReserved1; // reserved for use by display driver
  1443. /*
  1444. * Added for DX6
  1445. */
  1446. //@@BEGIN_DDKSPLIT
  1447. #if 1
  1448. LPPRIVATEDATANODE pPrivateDataHead;
  1449. IUnknown * pAddrefedThisOwner; //This is the ddraw object that created this
  1450. //palette, if nonzero. Must Release it when palette
  1451. //is released.
  1452. LPDDRAWI_DIRECTDRAW_INT lpDD_Int; // pointer to owning int
  1453. #else //1
  1454. //@@END_DDKSPLIT
  1455. ULONG_PTR dwDDRAWReserved1;
  1456. ULONG_PTR dwDDRAWReserved2;
  1457. ULONG_PTR dwDDRAWReserved3;
  1458. //@@BEGIN_DDKSPLIT
  1459. #endif //1
  1460. //@@END_DDKSPLIT
  1461. } DDRAWI_DDRAWPALETTE_LCL;
  1462. // bit definition for dwFlags in DDRAWI_DDRAWPALETTE_GBL and
  1463. // dwPaletteFlags in D3DHAL_DP2SETPALETTE
  1464. #define DDRAWIPAL_256 0x00000001l // 256 entry palette
  1465. #define DDRAWIPAL_16 0x00000002l // 16 entry palette
  1466. #define DDRAWIPAL_GDI 0x00000004l // palette allocated through GDI
  1467. #define DDRAWIPAL_STORED_8 0x00000008l // palette stored as 8bpp/entry
  1468. #define DDRAWIPAL_STORED_16 0x00000010l // palette stored as 16bpp/entry
  1469. #define DDRAWIPAL_STORED_24 0x00000020l // palette stored as 24bpp/entry
  1470. #define DDRAWIPAL_EXCLUSIVE 0x00000040l // palette being used in exclusive mode
  1471. #define DDRAWIPAL_INHEL 0x00000080l // palette is done in the hel
  1472. #define DDRAWIPAL_DIRTY 0x00000100l // gdi palette out 'o sync
  1473. #define DDRAWIPAL_ALLOW256 0x00000200l // can fully update palette
  1474. #define DDRAWIPAL_4 0x00000400l // 4 entry palette
  1475. #define DDRAWIPAL_2 0x00000800l // 2 entry palette
  1476. #define DDRAWIPAL_STORED_8INDEX 0x00001000l // palette stored as 8-bit index into dst palette
  1477. #define DDRAWIPAL_ALPHA 0x00002000l // palette entries contain alpha
  1478. /*
  1479. * DDRAW clipper interface struct
  1480. */
  1481. typedef struct _DDRAWI_DDRAWCLIPPER_INT
  1482. {
  1483. LPVOID lpVtbl; // pointer to array of interface methods
  1484. LPDDRAWI_DDRAWCLIPPER_LCL lpLcl; // pointer to interface data
  1485. LPDDRAWI_DDRAWCLIPPER_INT lpLink; // link to next interface
  1486. DWORD dwIntRefCnt; // interface reference count
  1487. //@@BEGIN_DDKSPLIT
  1488. ULONG_PTR dwReserved1; // for DDrawEx
  1489. ULONG_PTR dwReserved2; // for DDrawEx
  1490. //@@END_DDKSPLIT
  1491. } DDRAWI_DDRAWCLIPPER_INT;
  1492. /*
  1493. * DDRAW internal version of DIRECTDRAWCLIPPER object; it has data after the vtable
  1494. */
  1495. typedef struct _DDRAWI_DDRAWCLIPPER_GBL
  1496. {
  1497. DWORD dwRefCnt; // reference count
  1498. DWORD dwFlags; // flags
  1499. LPDDRAWI_DIRECTDRAW_GBL lpDD; // PRIVATE: DIRECTDRAW object
  1500. DWORD dwProcessId; // owning process
  1501. ULONG_PTR dwReserved1; // reserved for use by display driver
  1502. ULONG_PTR hWnd; // window
  1503. LPRGNDATA lpStaticClipList; // clip list set by app
  1504. } DDRAWI_DDRAWCLIPPER_GBL;
  1505. /*
  1506. * (CMcC) As with palettes, the clipper no longer maintains a back pointer to the
  1507. * owning surface (there may now be many owning surfaces). So the lpDDSurface
  1508. * is now dwReserved0 (this mod. assumes that sizeof(DWORD) ==
  1509. * sizeof(LPDDRAWI_DDRAWSURFACE_LCL). A fairly safe assumption I think.
  1510. */
  1511. typedef struct _DDRAWI_DDRAWCLIPPER_LCL
  1512. {
  1513. DWORD lpClipMore; // pointer to additional local data
  1514. LPDDRAWI_DDRAWCLIPPER_GBL lpGbl; // pointer to data
  1515. LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // pointer to owning local DD object
  1516. DWORD dwLocalRefCnt; // local ref cnt
  1517. IUnknown FAR *pUnkOuter; // outer IUnknown
  1518. LPDDRAWI_DIRECTDRAW_INT lpDD_int; // pointer to owning DD object interface
  1519. ULONG_PTR dwReserved1; // reserved for use by display driver
  1520. IUnknown * pAddrefedThisOwner; //This is the ddraw object that created this
  1521. //clipper, if nonzero. Must Release it when clipper
  1522. //is released.
  1523. } DDRAWI_DDRAWCLIPPER_LCL;
  1524. #define DDRAWICLIP_WATCHWINDOW 0x00000001l
  1525. #define DDRAWICLIP_ISINITIALIZED 0x00000002l
  1526. #define DDRAWICLIP_INMASTERSPRITELIST 0x00000004l // clipper is referenced in master sprite list
  1527. /*
  1528. * ATTACHLIST - internally used to maintain list of attached surfaces
  1529. */
  1530. typedef struct _ATTACHLIST
  1531. {
  1532. DWORD dwFlags;
  1533. struct _ATTACHLIST FAR *lpLink; // link to next attached surface
  1534. struct _DDRAWI_DDRAWSURFACE_LCL FAR *lpAttached; // attached surface local obj
  1535. struct _DDRAWI_DDRAWSURFACE_INT FAR *lpIAttached; // attached surface interface
  1536. } ATTACHLIST;
  1537. typedef ATTACHLIST FAR *LPATTACHLIST;
  1538. #define DDAL_IMPLICIT 0x00000001l
  1539. /*
  1540. * DBLNODE - a node in a doubly-linked list of surface interfaces
  1541. */
  1542. typedef struct _DBLNODE
  1543. {
  1544. struct _DBLNODE FAR *next; // link to next node
  1545. struct _DBLNODE FAR *prev; // link to previous node
  1546. LPDDRAWI_DDRAWSURFACE_LCL object; // link to object
  1547. LPDDRAWI_DDRAWSURFACE_INT object_int; // object interface
  1548. } DBLNODE;
  1549. typedef DBLNODE FAR *LPDBLNODE;
  1550. /*
  1551. * ACCESSRECTLIST - internally used to all rectangles that are accessed on a surface
  1552. */
  1553. typedef struct _ACCESSRECTLIST
  1554. {
  1555. struct _ACCESSRECTLIST FAR *lpLink; // link to next attached surface
  1556. RECT rDest; // rectangle being used
  1557. LPDDRAWI_DIRECTDRAW_LCL lpOwner; // owning local object
  1558. LPVOID lpSurfaceData; // associated screen ptr
  1559. DWORD dwFlags; // PRIVATE: flags
  1560. LPHEAPALIASINFO lpHeapAliasInfo; // PRIVATE: aliased heaps being used by this lock
  1561. } ACCESSRECTLIST;
  1562. typedef ACCESSRECTLIST FAR *LPACCESSRECTLIST;
  1563. #define ACCESSRECT_VRAMSTYLE 0x00000001L // PRIVATE: this lock is vram style (vidmem or implict sysmem)
  1564. #define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002L // PRIVATE: this lock is not holding the Win16 lock
  1565. #define ACCESSRECT_BROKEN 0x00000004L // PRIVATE: this lock was broken by an invalidate - don't call HAL on unlock
  1566. #ifndef WIN95
  1567. /*
  1568. * Do not change the size of this struct. This will move various members of surface and ddraw
  1569. * structs and will prevent binaries from running on old win2k systems (or mismatched later NT builds)
  1570. */
  1571. typedef struct _DISPLAYMODEINFO
  1572. {
  1573. WORD wWidth;
  1574. WORD wHeight;
  1575. BYTE wBPP;
  1576. BYTE wMonitorsAttachedToDesktop;
  1577. WORD wRefreshRate;
  1578. } DISPLAYMODEINFO;
  1579. typedef struct _DISPLAYMODEINFO *LPDISPLAYMODEINFO;
  1580. #define EQUAL_DISPLAYMODE(a, b) (0 == memcmp(&(a), &(b), sizeof (DISPLAYMODEINFO)))
  1581. #endif
  1582. //@@BEGIN_DDKSPLIT
  1583. /*
  1584. * Interface addref/release tracking structs
  1585. */
  1586. //#define REFTRACKING
  1587. #ifdef REFTRACKING
  1588. typedef struct _DDRAWI_REFTRACKNODE
  1589. {
  1590. LPVOID pReturnAddress;
  1591. DWORD dwAddrefCount;
  1592. DWORD dwReleaseCount;
  1593. struct _DDRAWI_REFTRACKNODE FAR * pNext;
  1594. } DDRAWI_REFTRACKNODE, FAR * LPDDRAWI_REFTRACKNODE;
  1595. typedef struct _DDRAWI_REFTRACK
  1596. {
  1597. LPVOID pLastAddref;
  1598. LPVOID pLastRelease;
  1599. LPDDRAWI_REFTRACKNODE pHead;
  1600. } DDRAW_REFTRACK;
  1601. //in ddisunk.c:
  1602. extern void AddRefTrack(LPVOID * p);
  1603. extern void ReleaseTrack(LPVOID * p);
  1604. extern void DumpRefTrack(LPVOID p);
  1605. #define REFTRACKVAR DDRAW_REFTRACK RefTrack;
  1606. #define ADDREFTRACK(pInt) AddRefTrack(&pInt)
  1607. #define RELEASETRACK(pInt) ReleaseTrack(&pInt)
  1608. #define DUMPREFTRACK(pInt) DumpRefTrack(pInt)
  1609. #else
  1610. #define REFTRACKVAR
  1611. #define ADDREFTRACK(a)
  1612. #define RELEASETRACK(a)
  1613. #define DUMPREFTRACK(pInt)
  1614. #endif //REFTRACKING
  1615. //@@END_DDKSPLIT
  1616. /*
  1617. * DDRAW surface interface struct
  1618. */
  1619. typedef struct _DDRAWI_DDRAWSURFACE_INT
  1620. {
  1621. LPVOID lpVtbl; // pointer to array of interface methods
  1622. LPDDRAWI_DDRAWSURFACE_LCL lpLcl; // pointer to interface data
  1623. LPDDRAWI_DDRAWSURFACE_INT lpLink; // link to next interface
  1624. DWORD dwIntRefCnt; // interface reference count
  1625. //@@BEGIN_DDKSPLIT
  1626. ULONG_PTR dwReserved1; // for DDrawEx
  1627. ULONG_PTR dwReserved2; // for DDrawEx
  1628. REFTRACKVAR
  1629. //@@END_DDKSPLIT
  1630. } DDRAWI_DDRAWSURFACE_INT;
  1631. /*
  1632. * DDRAW internal version of DIRECTDRAWSURFACE struct
  1633. *
  1634. * the GBL structure is global data for all duplicate objects
  1635. */
  1636. typedef struct _DDRAWI_DDRAWSURFACE_GBL
  1637. {
  1638. DWORD dwRefCnt; // reference count
  1639. DWORD dwGlobalFlags; // global flags
  1640. union
  1641. {
  1642. LPACCESSRECTLIST lpRectList; // list of accesses
  1643. DWORD dwBlockSizeY; // block size that display driver requested (return)
  1644. LONG lSlicePitch; // slice pitch for volume textures
  1645. };
  1646. union
  1647. {
  1648. LPVMEMHEAP lpVidMemHeap; // heap vidmem was alloc'ed from
  1649. DWORD dwBlockSizeX; // block size that display driver requested (return)
  1650. };
  1651. union
  1652. {
  1653. LPDDRAWI_DIRECTDRAW_GBL lpDD; // internal DIRECTDRAW object
  1654. LPVOID lpDDHandle; // handle to internal DIRECTDRAW object
  1655. // for use by display driver
  1656. // when calling fns in DDRAW16.DLL
  1657. };
  1658. FLATPTR fpVidMem; // pointer to video memory
  1659. union
  1660. {
  1661. LONG lPitch; // pitch of surface
  1662. DWORD dwLinearSize; // linear size of non-rectangular surface
  1663. };
  1664. WORD wHeight; // height of surface
  1665. WORD wWidth; // width of surface
  1666. DWORD dwUsageCount; // number of access to this surface
  1667. ULONG_PTR dwReserved1; // reserved for use by display driver
  1668. //
  1669. // NOTE: this part of the structure is ONLY allocated if the pixel
  1670. // format differs from that of the primary display
  1671. //
  1672. DDPIXELFORMAT ddpfSurface; // pixel format of surface
  1673. } DDRAWI_DDRAWSURFACE_GBL;
  1674. /*
  1675. * This is an extender structure that is allocated off the end of the SURFACE_GBL
  1676. * structure. DO NOT place any structures whose size can change in here.
  1677. */
  1678. #define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \
  1679. (*(LPDDRAWI_DDRAWSURFACE_GBL_MORE *) \
  1680. ((BYTE *)psurf_gbl - sizeof(DWORD_PTR)))
  1681. /*
  1682. * Return the physical memory pointer for a given surface global object.
  1683. *
  1684. * NOTE: The physical memory pointer is ONLY valid for surfaces allocated from
  1685. * non-local video memory. This field will not be valid for system memory or
  1686. * local video memory surfaces.
  1687. */
  1688. #define SURFACE_PHYSICALVIDMEM( psurf_gbl ) \
  1689. ( GET_LPDDRAWSURFACE_GBL_MORE( psurf_gbl )->fpPhysicalVidMem )
  1690. /*
  1691. * NOTE: This structure contains a set of fields for describing linear to physical
  1692. * page mappings in the case of page locked system memory. It can also contain the
  1693. * physical surface pointer of a surface in non-local memory. As there is no point
  1694. * in having both a linear to physical page translation table and a physical memory
  1695. * pointer for the same surface they are placed in a union.
  1696. */
  1697. typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE
  1698. {
  1699. DWORD dwSize;
  1700. union
  1701. {
  1702. DWORD dwPhysicalPageTable; // Physical address of page table (array of physical addresses/one per 4K page)
  1703. FLATPTR fpPhysicalVidMem; // Physical address of surface (non-local video memory only)
  1704. };
  1705. LPDWORD pPageTable; // Linear address of page table
  1706. DWORD cPages; // Number of Pages
  1707. ULONG_PTR dwSavedDCContext; // PRIVATE: For use by DDSurface::GetDC
  1708. FLATPTR fpAliasedVidMem; // PRIVATE: Alias for original fpVidMem
  1709. ULONG_PTR dwDriverReserved; // Reserved for driver use (both system and video memory surfaces)
  1710. ULONG_PTR dwHELReserved; // PRIVATE: For HEL use only
  1711. DWORD cPageUnlocks; // Incremented whenever a surface is PageUnlocked
  1712. ULONG_PTR hKernelSurface; // Kernel handle for this surface
  1713. DWORD dwKernelRefCnt; // Ref count for kernel handle
  1714. LPDDCOLORCONTROL lpColorInfo; // PRIVATE: Initial color control settings
  1715. FLATPTR fpNTAlias; // PRIVATE: Used internally by NT DirectDraw
  1716. DWORD dwContentsStamp; // Changes when surface data may have changed. 0 means no information
  1717. LPVOID lpvUnswappedDriverReserved; // Reserved for use by display driver. Is not swapped when Flip is called on this surface
  1718. //@@BEGIN_DDKSPLIT
  1719. #if 1
  1720. LPVOID pvContents; // Persistent-content memory
  1721. DWORD dwBackupStamp; // Value of dwContentsStamp when contents restored
  1722. DWORD dwSaveStamp; // Value of dwContentsStamp when contents saved via IPersistX
  1723. #else //1
  1724. //@@END_DDKSPLIT
  1725. LPVOID lpDDRAWReserved2;
  1726. DWORD dwDDRAWReserved1;
  1727. DWORD dwDDRAWReserved2;
  1728. //@@BEGIN_DDKSPLIT
  1729. #endif //1
  1730. //@@END_DDKSPLIT
  1731. FLATPTR fpAliasOfVidMem; // PRIVATE: The original VidMem pointer of which fpAliasedVidMem is an alias of
  1732. // This is used to compare with a given fpVidMem to see if we can use the cached fpAliasedVidMem or
  1733. // if we need to call GetAliasedVidMem.
  1734. } DDRAWI_DDRAWSURFACE_GBL_MORE;
  1735. //@@BEGIN_DDKSPLIT
  1736. /* Macro to bump the contents stamp so drivers can cheaply check for changed surface data.
  1737. * Zero means no information
  1738. */
  1739. #define BUMP_SURFACE_STAMP(surf_gbl) \
  1740. if ( GET_LPDDRAWSURFACE_GBL_MORE(surf_gbl)->dwContentsStamp ) \
  1741. { \
  1742. GET_LPDDRAWSURFACE_GBL_MORE(surf_gbl)->dwContentsStamp++; \
  1743. if ( 0 ==GET_LPDDRAWSURFACE_GBL_MORE(surf_gbl)->dwContentsStamp) \
  1744. GET_LPDDRAWSURFACE_GBL_MORE(surf_gbl)->dwContentsStamp++; \
  1745. }
  1746. //@@END_DDKSPLIT
  1747. //@@BEGIN_DDKSPLIT
  1748. #define NUM_RECTS_IN_REGIONLIST 6
  1749. /* This holds the list of dirty regions for D3D texture managed surfaces */
  1750. typedef struct _REGIONLIST
  1751. {
  1752. RGNDATAHEADER rdh;
  1753. RECTL rect[NUM_RECTS_IN_REGIONLIST];
  1754. } REGIONLIST;
  1755. typedef REGIONLIST *LPREGIONLIST;
  1756. //@@END_DDKSPLIT
  1757. /*
  1758. * a structure holding additional LCL surface information (can't simply be appended
  1759. * to the LCL structure as that structure is of variable size).
  1760. */
  1761. typedef struct _DDRAWI_DDRAWSURFACE_MORE
  1762. {
  1763. DWORD dwSize;
  1764. IUNKNOWN_LIST FAR *lpIUnknowns; // IUnknowns aggregated by this surface
  1765. LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // Pointer to the DirectDraw local object
  1766. DWORD dwPageLockCount; // count of pagelocks
  1767. DWORD dwBytesAllocated; // size of sys mem allocated
  1768. LPDDRAWI_DIRECTDRAW_INT lpDD_int; // Pointer to the DirectDraw interface
  1769. DWORD dwMipMapCount; // Number of mip-map levels in the chain
  1770. LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper; // Interface to attached clipper object
  1771. //------- Fields added in Version 5.0 -------
  1772. LPHEAPALIASINFO lpHeapAliasInfo; // PRIVATE: Aliased heaps being referenced by this lock
  1773. DWORD dwOverlayFlags; // Current overlay flags
  1774. VOID *rgjunc; // Blitter function table for new blitter
  1775. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port currently writting data to this surface
  1776. LPDDOVERLAYFX lpddOverlayFX; // current overlay fx
  1777. DDSCAPSEX ddsCapsEx;
  1778. DWORD dwTextureStage; // stage in multitexture cascade
  1779. //@@BEGIN_DDKSPLIT
  1780. #if 1
  1781. LPVOID lpD3DDevIList;
  1782. LPPRIVATEDATANODE pPrivateDataHead;
  1783. IUnknown * pAddrefedThisOwner; //This is the ddraw object that created this
  1784. //surface, if nonzero. Must Release it when surface
  1785. //is released.
  1786. DWORD dwPFIndex; // pixel-format index (cached by AlphaBlt HEL)
  1787. BOOL * lpbDirty; //this bit is for D3D Texture Manage syncronization
  1788. //if it's set, D3D has to flush batched DPs
  1789. //and then refresh its video copy and clear it to
  1790. //FALSE. Blt,Lock,GetDC will set it.
  1791. #else //1
  1792. //@@END_DDKSPLIT
  1793. LPVOID lpDDRAWReserved;
  1794. LPVOID lpDDRAWReserved2;
  1795. LPVOID lpDDrawReserved3;
  1796. DWORD dwDDrawReserved4;
  1797. LPVOID lpDDrawReserved5;
  1798. //@@BEGIN_DDKSPLIT
  1799. #endif //1
  1800. //@@END_DDKSPLIT
  1801. LPDWORD lpGammaRamp;
  1802. LPDWORD lpOriginalGammaRamp;
  1803. //@@BEGIN_DDKSPLIT
  1804. #if 1
  1805. LPREGIONLIST lpRegionList;
  1806. #ifndef WIN95
  1807. DISPLAYMODEINFO dmiCreated; // NT: mode surface created in
  1808. #endif
  1809. // This is the new Surface handle generated by the ddraw runtime
  1810. // This is sent to the driver as a cookie to associate a particular
  1811. // surface by the CreateSurfaceEx DDI.
  1812. DWORD dwSurfaceHandle;
  1813. ULARGE_INTEGER qwBatch; // batch number that refers to this texture (D3D)
  1814. LPVOID lpTex;
  1815. #else //1
  1816. //@@END_DDKSPLIT
  1817. LPVOID lpDDrawReserved6;
  1818. #ifndef WIN95
  1819. DISPLAYMODEINFO dmiDDrawReserved7;
  1820. #endif
  1821. DWORD dwSurfaceHandle; // cookie for use with CreateSurfaceEx DDI
  1822. DWORD qwDDrawReserved8[2];
  1823. LPVOID lpDDrawReserved9;
  1824. //@@BEGIN_DDKSPLIT
  1825. #endif //1
  1826. //@@END_DDKSPLIT
  1827. DWORD cSurfaces; //PRIVATE
  1828. LPDDSURFACEDESC2 pCreatedDDSurfaceDesc2; //PRIVATE
  1829. LPDDRAWI_DDRAWSURFACE_LCL *slist; //PRIVATE
  1830. DWORD dwFVF; // saved FVF flags for exe bufs
  1831. LPVOID lpVB; //PRIVATE
  1832. } DDRAWI_DDRAWSURFACE_MORE;
  1833. /*
  1834. * Special values assigned to dwPFIndex member of DDRAWI_DDRAWSURFACE_MORE.
  1835. */
  1836. #define PFINDEX_UNINITIALIZED (0UL) // pixel-format index is in uninitialized state
  1837. #define PFINDEX_UNSUPPORTED (~0UL) // surface's pixel format is not supported by HEL
  1838. /*
  1839. * the LCL structure is local data for each individual surface object
  1840. */
  1841. struct _DDRAWI_DDRAWSURFACE_LCL
  1842. {
  1843. LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore; // pointer to additional local data
  1844. LPDDRAWI_DDRAWSURFACE_GBL lpGbl; // pointer to surface shared data
  1845. ULONG_PTR hDDSurface; // NT Kernel-mode handle was dwUnused0
  1846. LPATTACHLIST lpAttachList; // link to surfaces we attached to
  1847. LPATTACHLIST lpAttachListFrom;// link to surfaces that attached to this one
  1848. DWORD dwLocalRefCnt; // object refcnt
  1849. DWORD dwProcessId; // owning process
  1850. DWORD dwFlags; // flags
  1851. DDSCAPS ddsCaps; // capabilities of surface
  1852. union
  1853. {
  1854. LPDDRAWI_DDRAWPALETTE_INT lpDDPalette; // associated palette
  1855. LPDDRAWI_DDRAWPALETTE_INT lp16DDPalette; // 16-bit ptr to associated palette
  1856. };
  1857. union
  1858. {
  1859. LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper; // associated clipper
  1860. LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper; // 16-bit ptr to associated clipper
  1861. };
  1862. DWORD dwModeCreatedIn;
  1863. DWORD dwBackBufferCount; // number of back buffers created
  1864. DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
  1865. DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
  1866. // IUnknown FAR *pUnkOuter; // outer IUnknown
  1867. ULONG_PTR hDC; // owned dc
  1868. ULONG_PTR dwReserved1; // reserved for use by display driver
  1869. /*
  1870. * NOTE: this part of the structure is ONLY allocated if the surface
  1871. * can be used for overlays. ddckCKSrcOverlay MUST NOT BE MOVED
  1872. * from the start of this area.
  1873. */
  1874. DDCOLORKEY ddckCKSrcOverlay;// color key for source overlay use
  1875. DDCOLORKEY ddckCKDestOverlay;// color key for destination overlay use
  1876. LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying; // surface we are overlaying
  1877. DBLNODE dbnOverlayNode;
  1878. /*
  1879. * overlay rectangle, used by DDHEL
  1880. */
  1881. RECT rcOverlaySrc;
  1882. RECT rcOverlayDest;
  1883. /*
  1884. * the below values are kept here for ddhel. they're set by UpdateOverlay,
  1885. * they're used whenever the overlays are redrawn.
  1886. */
  1887. DWORD dwClrXparent; // the *actual* color key (override, colorkey, or CLR_INVALID)
  1888. DWORD dwAlpha; // the per surface alpha
  1889. /*
  1890. * overlay position
  1891. */
  1892. LONG lOverlayX; // current x position
  1893. LONG lOverlayY; // current y position
  1894. };
  1895. typedef struct _DDRAWI_DDRAWSURFACE_LCL DDRAWI_DDRAWSURFACE_LCL;
  1896. #define DDRAWISURFGBL_MEMFREE 0x00000001L // video memory has been freed
  1897. #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002L // surface is in system memory at request of user
  1898. #define DDRAWISURFGBL_ISGDISURFACE 0x00000004L // This surface represents what GDI thinks is front buffer
  1899. #define DDRAWISURFGBL_SOFTWAREAUTOFLIP 0x00000008L // This surface is autoflipped using software
  1900. #define DDRAWISURFGBL_LOCKNOTHOLDINGWIN16LOCK 0x00000010L // PRIVATE: a vram lock of the entire surface is not holding the Win16 lock
  1901. #define DDRAWISURFGBL_LOCKVRAMSTYLE 0x00000020L // PRIVATE: entire surface was locked with VRAM style lock
  1902. #define DDRAWISURFGBL_LOCKBROKEN 0x00000040L // PRIVATE: a lock of the entire surface was broken by an invalidate
  1903. #define DDRAWISURFGBL_IMPLICITHANDLE 0x00000080L // This dwKernelHandle was created implicitly
  1904. #define DDRAWISURFGBL_ISCLIENTMEM 0x00000100L // PRIVATE: the memory pointer to by fpVidMem was allocated by the client
  1905. #define DDRAWISURFGBL_HARDWAREOPSOURCE 0x00000200L // This surface was the source for an asynchronous hardware operation
  1906. #define DDRAWISURFGBL_HARDWAREOPDEST 0x00000400L // This surface was dest for an asynchronous hardware operation
  1907. #define DDRAWISURFGBL_HARDWAREOPSTARTED (DDRAWISURFGBL_HARDWAREOPSOURCE|DDRAWISURFGBL_HARDWAREOPDEST)
  1908. #define DDRAWISURFGBL_VPORTINTERLEAVED 0x00000800L // This surface contains interleaved video port data
  1909. #define DDRAWISURFGBL_VPORTDATA 0x00001000L // This surface received data from the video port
  1910. #define DDRAWISURFGBL_LATEALLOCATELINEAR 0x00002000L // Optimized surface was allocated as a formless chunk. lPitch invalid, dwLinearSize valid.
  1911. #define DDRAWISURFGBL_SYSMEMEXECUTEBUFFER 0x00004000L // Driver sets this flag to tell ddraw that the surface was allocated in system memory
  1912. #define DDRAWISURFGBL_FASTLOCKHELD 0x00008000L // PRIVATE: indicates that InternLock took the fast path
  1913. #define DDRAWISURFGBL_READONLYLOCKHELD 0x00010000L // PRIVATE: indicates that the application indicated read-only lock
  1914. #define DDRAWISURFGBL_DX8SURFACE 0x00080000L // PRIVATE: indicates that the surace was created using DX8
  1915. #define DDRAWISURFGBL_DDHELDONTFREE 0x00100000L // PRIVATE: indicates that the surace memory should not be freed by the HEL
  1916. #define DDRAWISURFGBL_NOTIFYWHENUNLOCKED 0x00200000L // PRIVATE: indicates that the this surface help a NOSYSLOCK lock when a mode change occured
  1917. /*
  1918. * NOTE: This flag was previously DDRAWISURFGBL_INVALID. This flags has been retired
  1919. * and replaced by DDRAWISURF_INVALID in the local object.
  1920. */
  1921. #define DDRAWISURFGBL_RESERVED0 0x80000000L // Reserved flag
  1922. #define DDRAWISURF_ATTACHED 0x00000001L // surface is attached to another
  1923. #define DDRAWISURF_IMPLICITCREATE 0x00000002L // surface implicitly created
  1924. #define DDRAWISURF_ISFREE 0x00000004L // surface already freed (temp flag)
  1925. #define DDRAWISURF_ATTACHED_FROM 0x00000008L // surface has others attached to it
  1926. #define DDRAWISURF_IMPLICITROOT 0x00000010L // surface root of implicit creation
  1927. #define DDRAWISURF_PARTOFPRIMARYCHAIN 0x00000020L // surface is part of primary chain
  1928. #define DDRAWISURF_DATAISALIASED 0x00000040L // used for thunking
  1929. #define DDRAWISURF_HASDC 0x00000080L // has a DC
  1930. #define DDRAWISURF_HASCKEYDESTOVERLAY 0x00000100L // surface has CKDestOverlay
  1931. #define DDRAWISURF_HASCKEYDESTBLT 0x00000200L // surface has CKDestBlt
  1932. #define DDRAWISURF_HASCKEYSRCOVERLAY 0x00000400L // surface has CKSrcOverlay
  1933. #define DDRAWISURF_HASCKEYSRCBLT 0x00000800L // surface has CKSrcBlt
  1934. #define DDRAWISURF_LOCKEXCLUDEDCURSOR 0x00001000L // surface was locked and excluded cursor
  1935. #define DDRAWISURF_HASPIXELFORMAT 0x00002000L // surface structure has pixel format data
  1936. #define DDRAWISURF_HASOVERLAYDATA 0x00004000L // surface structure has overlay data
  1937. #define DDRAWISURF_SETGAMMA 0x00008000L // gamma ramp for this surface is active
  1938. #define DDRAWISURF_SW_CKEYDESTOVERLAY 0x00010000L // surface expects to process colorkey in software
  1939. #define DDRAWISURF_SW_CKEYDESTBLT 0x00020000L // surface expects to process colorkey in software
  1940. #define DDRAWISURF_SW_CKEYSRCOVERLAY 0x00040000L // surface expects to process colorkey in software
  1941. #define DDRAWISURF_SW_CKEYSRCBLT 0x00080000L // surface expects to process colorkey in software
  1942. #define DDRAWISURF_HW_CKEYDESTOVERLAY 0x00100000L // surface expects to process colorkey in hardware
  1943. #define DDRAWISURF_HW_CKEYDESTBLT 0x00200000L // surface expects to process colorkey in hardware
  1944. #define DDRAWISURF_HW_CKEYSRCOVERLAY 0x00400000L // surface expects to process colorkey in hardware
  1945. #define DDRAWISURF_HW_CKEYSRCBLT 0x00800000L // surface expects to process colorkey in hardware
  1946. #define DDRAWISURF_INMASTERSPRITELIST 0x01000000l // surface is referenced in master sprite list
  1947. #define DDRAWISURF_HELCB 0x02000000L // surface is the ddhel cb. must call hel for lock/blt.
  1948. #define DDRAWISURF_FRONTBUFFER 0x04000000L // surface was originally a front buffer
  1949. #define DDRAWISURF_BACKBUFFER 0x08000000L // surface was originally backbuffer
  1950. #define DDRAWISURF_INVALID 0x10000000L // surface has been invalidated by mode set
  1951. #define DDRAWISURF_DCIBUSY 0x20000000L // HEL has turned off BUSY so DCI would work
  1952. #define DDRAWISURF_GETDCNULL 0x40000000L // getdc could not lock and so returned GetDC(NULL)
  1953. //#define DDRAWISURF_CANTLOCK 0x20000000L // surface cannot be locked (primary created by HEL)
  1954. #define DDRAWISURF_STEREOSURFACELEFT 0x20000000L // surface is left of stereo pair
  1955. #define DDRAWISURF_DRIVERMANAGED 0x40000000L // Surface is a driver managed texture (D3D)
  1956. #define DDRAWISURF_DCILOCK 0x80000000L // Surface was locked using DCIBeginAccess
  1957. /*
  1958. * rop stuff
  1959. */
  1960. #define ROP_HAS_SOURCE 0x00000001l
  1961. #define ROP_HAS_PATTERN 0x00000002l
  1962. #define ROP_HAS_SOURCEPATTERN ROP_HAS_SOURCE | ROP_HAS_PATTERN
  1963. /*
  1964. * mode information
  1965. */
  1966. typedef struct _DDHALMODEINFO
  1967. {
  1968. DWORD dwWidth; // width (in pixels) of mode
  1969. DWORD dwHeight; // height (in pixels) of mode
  1970. LONG lPitch; // pitch (in bytes) of mode
  1971. DWORD dwBPP; // bits per pixel
  1972. WORD wFlags; // flags
  1973. WORD wRefreshRate; // refresh rate
  1974. DWORD dwRBitMask; // red bit mask
  1975. DWORD dwGBitMask; // green bit mask
  1976. DWORD dwBBitMask; // blue bit mask
  1977. DWORD dwAlphaBitMask; // alpha bit mask
  1978. } DDHALMODEINFO;
  1979. typedef DDHALMODEINFO FAR *LPDDHALMODEINFO;
  1980. #define DDMODEINFO_PALETTIZED 0x0001 // mode is palettized
  1981. #define DDMODEINFO_MODEX 0x0002 // mode is a modex mode
  1982. #define DDMODEINFO_UNSUPPORTED 0x0004 // mode is not supported by driver
  1983. /*
  1984. * Note internally, standard VGA modes are tagged as MODEX and STANDARDVGA
  1985. */
  1986. #define DDMODEINFO_STANDARDVGA 0x0008 // mode is standard vga, e.g. mode 0x13
  1987. #define DDMODEINFO_MAXREFRESH 0x0010 // refresh rate specified is the max supported
  1988. #define DDMODEINFO_STEREO 0x0020 // mode can be switched to stereo
  1989. //@@BEGIN_DDKSPLIT
  1990. /*
  1991. * This means that the mode marked as 16bpp is really 555
  1992. */
  1993. #define DDMODEINFO_555MODE 0x0100
  1994. /*
  1995. * This mode should only be used with DX7 or higher interfaces.
  1996. */
  1997. #define DDMODEINFO_DX7ONLY 0x0200
  1998. #define DDMODEINFO_VALID 0x003C // valid
  1999. #define LISTGROWSIZE 1024
  2000. typedef struct _DDSURFACELISTENTRY
  2001. {
  2002. DWORD dwFlags;
  2003. DWORD nextentry;
  2004. LPDDRAWI_DDRAWSURFACE_LCL lpSurface;
  2005. } DDSURFACELISTENTRY;
  2006. typedef DDSURFACELISTENTRY FAR* LPDDSURFACELISTENTRY;
  2007. typedef struct _DWLIST
  2008. {
  2009. LPDDSURFACELISTENTRY dwList; // array to hold handles, dynamically allocated
  2010. // dwList[0] is the size of array dwList if allocated
  2011. DWORD dwFreeList; // point to the first unused slot in dwList
  2012. } DWLIST;
  2013. typedef DWLIST FAR* LPDWLIST;
  2014. #ifdef WIN95
  2015. #define SURFACEHANDLELIST(this_lcl) (this_lcl->SurfaceHandleList)
  2016. #else //WIN95
  2017. #define SURFACEHANDLELIST(this_lcl) (this_lcl->lpGbl->SurfaceHandleList)
  2018. #endif //WIN95
  2019. //@@END_DDKSPLIT
  2020. /*
  2021. * DDRAW interface struct
  2022. */
  2023. typedef struct _DDRAWI_DIRECTDRAW_INT
  2024. {
  2025. LPVOID lpVtbl; // pointer to array of interface methods
  2026. LPDDRAWI_DIRECTDRAW_LCL lpLcl; // pointer to interface data
  2027. LPDDRAWI_DIRECTDRAW_INT lpLink; // link to next interface
  2028. DWORD dwIntRefCnt; // interface reference count
  2029. //@@BEGIN_DDKSPLIT
  2030. ULONG_PTR dwReserved1; // for DDrawEx
  2031. ULONG_PTR dwReserved2; // for DDrawEx
  2032. //@@END_DDKSPLIT
  2033. } DDRAWI_DIRECTDRAW_INT;
  2034. /*
  2035. * DDRAW version of DirectDraw object; it has data after the vtable
  2036. *
  2037. * all entries marked as PRIVATE are not for use by the display driver
  2038. */
  2039. typedef struct _DDHAL_CALLBACKS
  2040. {
  2041. DDHAL_DDCALLBACKS cbDDCallbacks; // addresses in display driver for DIRECTDRAW object HAL
  2042. DDHAL_DDSURFACECALLBACKS cbDDSurfaceCallbacks; // addresses in display driver for DIRECTDRAWSURFACE object HAL
  2043. DDHAL_DDPALETTECALLBACKS cbDDPaletteCallbacks; // addresses in display driver for DIRECTDRAWPALETTE object HAL
  2044. DDHAL_DDCALLBACKS HALDD; // HAL for DIRECTDRAW object
  2045. DDHAL_DDSURFACECALLBACKS HALDDSurface; // HAL for DIRECTDRAWSURFACE object
  2046. DDHAL_DDPALETTECALLBACKS HALDDPalette; // HAL for DIRECTDRAWPALETTE object
  2047. DDHAL_DDCALLBACKS HELDD; // HEL for DIRECTDRAW object
  2048. DDHAL_DDSURFACECALLBACKS HELDDSurface; // HEL for DIRECTDRAWSURFACE object
  2049. DDHAL_DDPALETTECALLBACKS HELDDPalette; // HEL for DIRECTDRAWPALETTE object
  2050. DDHAL_DDEXEBUFCALLBACKS cbDDExeBufCallbacks; // addresses in display driver for DIRECTDRAWEXEBUF pseudo object HAL
  2051. DDHAL_DDEXEBUFCALLBACKS HALDDExeBuf; // HAL for DIRECTDRAWEXEBUF pseudo object
  2052. DDHAL_DDEXEBUFCALLBACKS HELDDExeBuf; // HEL for DIRECTDRAWEXEBUF preudo object
  2053. DDHAL_DDVIDEOPORTCALLBACKS cbDDVideoPortCallbacks; // addresses in display driver for VideoPort object HAL
  2054. DDHAL_DDVIDEOPORTCALLBACKS HALDDVideoPort; // HAL for DIRECTDRAWVIDEOPORT psuedo object
  2055. DDHAL_DDCOLORCONTROLCALLBACKS cbDDColorControlCallbacks; // addresses in display driver for color control object HAL
  2056. DDHAL_DDCOLORCONTROLCALLBACKS HALDDColorControl; // HAL for DIRECTDRAWCOLORCONTROL psuedo object
  2057. DDHAL_DDMISCELLANEOUSCALLBACKS cbDDMiscellaneousCallbacks;
  2058. DDHAL_DDMISCELLANEOUSCALLBACKS HALDDMiscellaneous;
  2059. DDHAL_DDKERNELCALLBACKS cbDDKernelCallbacks;
  2060. DDHAL_DDKERNELCALLBACKS HALDDKernel;
  2061. DDHAL_DDMOTIONCOMPCALLBACKS cbDDMotionCompCallbacks;
  2062. DDHAL_DDMOTIONCOMPCALLBACKS HALDDMotionComp;
  2063. //@@BEGIN_DDKSPLIT
  2064. #ifdef WINNT
  2065. DDHAL_DDNTCALLBACKS cbDDNTCallbacks;
  2066. DDHAL_DDNTCALLBACKS HALDDNT;
  2067. #endif
  2068. DDHAL_DDMISCELLANEOUS2CALLBACKS HELDDMiscellaneous2; // HEL
  2069. DDHAL_DDMISCELLANEOUS2CALLBACKS HALDDMiscellaneous2; // HAL (32-bit, no thunk)
  2070. #ifndef WINNT
  2071. DDHAL_DDNTCALLBACKS cbDDNTCallbacks;
  2072. DDHAL_DDNTCALLBACKS HALDDNT;
  2073. #endif
  2074. #ifdef WINNT
  2075. DDHAL_DDVPE2CALLBACKS cbDDVPE2Callbacks;
  2076. DDHAL_DDVPE2CALLBACKS HALDDVPE2;
  2077. #endif
  2078. //@@END_DDKSPLIT
  2079. } DDHAL_CALLBACKS, far *LPDDHAL_CALLBACKS;
  2080. //@@BEGIN_DDKSPLIT
  2081. /*
  2082. * READ THIS - READ THIS - READ THIS - READ THIS - READ THIS - READ THIS
  2083. *
  2084. * Why have this structure and the API visible DDCAPS? Well we want to grow
  2085. * DDCAPS so the application can get at new caps. but we can't grow the
  2086. * DDCAPS that the driver returns to us because it is embeded by value in
  2087. * DDCOREINFO and chaging is size would break drivers - sigh.Therefore this
  2088. * structure, DDCORECAPS, is the caps structure returned to us by the driver
  2089. * in DDHALINFO.
  2090. *
  2091. * IT HAS A FIXED SIZE AND MUST NEVER GROW OR SHRINK. Whereas the public
  2092. * DDCAPS will grow as new capabilities are added. If new caps are needed
  2093. * they should be returned through a GetDriverInfo call rather than
  2094. * through growing DDCORECAPS.
  2095. *
  2096. * The field names of this structure must be maintained in sync. with the
  2097. * those in the public DDCAPS structure. So if you rename a field at the
  2098. * API level rename it here also (but don't break drivers)
  2099. */
  2100. //@@END_DDKSPLIT
  2101. /*
  2102. * This structure mirrors the first entries of the DDCAPS but is of a fixed
  2103. * size and will not grow as DDCAPS grows. This is the structure your driver
  2104. * returns in DDCOREINFO. Additional caps will be requested via a GetDriverInfo
  2105. * call.
  2106. */
  2107. typedef struct _DDCORECAPS
  2108. {
  2109. DWORD dwSize; // size of the DDDRIVERCAPS structure
  2110. DWORD dwCaps; // driver specific capabilities
  2111. DWORD dwCaps2; // more driver specific capabilites
  2112. DWORD dwCKeyCaps; // color key capabilities of the surface
  2113. DWORD dwFXCaps; // driver specific stretching and effects capabilites
  2114. DWORD dwFXAlphaCaps; // alpha driver specific capabilities
  2115. DWORD dwPalCaps; // palette capabilities
  2116. DWORD dwSVCaps; // stereo vision capabilities
  2117. DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8
  2118. DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8
  2119. DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8
  2120. DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8
  2121. DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8
  2122. DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  2123. DWORD dwZBufferBitDepths; // DDBD_8,16,24,32
  2124. DWORD dwVidMemTotal; // total amount of video memory
  2125. DWORD dwVidMemFree; // amount of free video memory
  2126. DWORD dwMaxVisibleOverlays; // maximum number of visible overlays
  2127. DWORD dwCurrVisibleOverlays; // current number of visible overlays
  2128. DWORD dwNumFourCCCodes; // number of four cc codes
  2129. DWORD dwAlignBoundarySrc; // source rectangle alignment
  2130. DWORD dwAlignSizeSrc; // source rectangle byte size
  2131. DWORD dwAlignBoundaryDest; // dest rectangle alignment
  2132. DWORD dwAlignSizeDest; // dest rectangle byte size
  2133. DWORD dwAlignStrideAlign; // stride alignment
  2134. DWORD dwRops[DD_ROP_SPACE]; // ROPS supported
  2135. DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities
  2136. DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2137. DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2138. DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2139. DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2140. DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2141. DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  2142. DWORD dwReserved1; // reserved
  2143. DWORD dwReserved2; // reserved
  2144. DWORD dwReserved3; // reserved
  2145. DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts
  2146. DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts
  2147. DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts
  2148. DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  2149. DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts
  2150. DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts
  2151. DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts
  2152. DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  2153. DWORD dwSSBCaps; // driver specific capabilities for System->System blts
  2154. DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts
  2155. DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts
  2156. DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  2157. DWORD dwMaxVideoPorts; // maximum number of usable video ports
  2158. DWORD dwCurrVideoPorts; // current number of video ports used
  2159. DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts
  2160. } DDCORECAPS;
  2161. typedef DDCORECAPS FAR* LPDDCORECAPS;
  2162. typedef struct _DDRAWI_DIRECTDRAW_GBL
  2163. {
  2164. /* 0*/ DWORD dwRefCnt; // reference count
  2165. /* 4*/ DWORD dwFlags; // flags
  2166. /* 8*/ FLATPTR fpPrimaryOrig; // primary surf vid mem. ptr
  2167. /* c*/ DDCORECAPS ddCaps; // driver caps
  2168. /*148*/ DWORD dwInternal1; // Private to ddraw.dll
  2169. /*16c*/ DWORD dwUnused1[9]; // not currently used
  2170. /*170*/ LPDDHAL_CALLBACKS lpDDCBtmp; // HAL callbacks
  2171. /*174*/ LPDDRAWI_DDRAWSURFACE_INT dsList; // PRIVATE: list of all surfaces
  2172. /*178*/ LPDDRAWI_DDRAWPALETTE_INT palList; // PRIVATE: list of all palettes
  2173. /*17c*/ LPDDRAWI_DDRAWCLIPPER_INT clipperList; // PRIVATE: list of all clippers
  2174. /*180*/ LPDDRAWI_DIRECTDRAW_GBL lp16DD; // PRIVATE: 16-bit ptr to this struct
  2175. /*184*/ DWORD dwMaxOverlays; // maximum number of overlays
  2176. /*188*/ DWORD dwCurrOverlays; // current number of visible overlays
  2177. /*18c*/ DWORD dwMonitorFrequency; // monitor frequency in current mode
  2178. /*190*/ DDCORECAPS ddHELCaps; // HEL capabilities
  2179. /*2cc*/ DWORD dwUnused2[50]; // not currently used
  2180. /*394*/ DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use
  2181. /*39c*/ DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
  2182. /*3a4*/ VIDMEMINFO vmiData; // info about vid memory
  2183. /*3f4*/ LPVOID lpDriverHandle; // handle for use by display driver
  2184. /* */ // to call fns in DDRAW16.DLL
  2185. /*3f8*/ LPDDRAWI_DIRECTDRAW_LCL lpExclusiveOwner; // PRIVATE: exclusive local object
  2186. /*3fc*/ DWORD dwModeIndex; // current mode index
  2187. /*400*/ DWORD dwModeIndexOrig; // original mode index
  2188. /*404*/ DWORD dwNumFourCC; // number of fourcc codes supported
  2189. /*408*/ DWORD FAR *lpdwFourCC; // PRIVATE: fourcc codes supported
  2190. /*40c*/ DWORD dwNumModes; // number of modes supported
  2191. /*410*/ LPDDHALMODEINFO lpModeInfo; // PRIVATE: mode information
  2192. /*424*/ PROCESS_LIST plProcessList; // PRIVATE: list of processes using driver
  2193. /*428*/ DWORD dwSurfaceLockCount; // total number of outstanding locks
  2194. /*42c*/ DWORD dwAliasedLockCnt; // PRIVATE: number of outstanding aliased locks
  2195. /*430*/ ULONG_PTR dwReserved3; // reserved for use by display driver
  2196. /*434*/ ULONG_PTR hDD; // PRIVATE: NT Kernel-mode handle (was dwFree3).
  2197. /*438*/ char cObsolete[12]; // Obsolete field, do not use
  2198. /*444*/ DWORD dwReserved1; // reserved for use by display driver
  2199. /*448*/ DWORD dwReserved2; // reserved for use by display driver
  2200. /*44c*/ DBLNODE dbnOverlayRoot; // The root node of the doubly-
  2201. /* */ // linked list of overlay z orders.
  2202. /*45c*/ volatile LPWORD lpwPDeviceFlags; // driver physical device flags
  2203. /*460*/ DWORD dwPDevice; // driver physical device (16:16 pointer)
  2204. /*464*/ DWORD dwWin16LockCnt; // count on win16 holds
  2205. /*468*/ DWORD dwUnused3; // was lpWin16LockOwner
  2206. /*46c*/ DWORD hInstance; // instance handle of driver
  2207. /*470*/ DWORD dwEvent16; // 16-bit event
  2208. /*474*/ DWORD dwSaveNumModes; // saved number of modes supported
  2209. /* */ //------- Fields added in Version 2.0 -------
  2210. //@@BEGIN_DDKSPLIT
  2211. #if 1 //Masked for DDK
  2212. /*478*/ LPD3DHAL_GLOBALDRIVERDATA lpD3DGlobalDriverData; // Global D3D Data
  2213. /*47c*/ LPD3DHAL_CALLBACKS lpD3DHALCallbacks; // D3D HAL Callbacks
  2214. #else
  2215. //@@END_DDKSPLIT
  2216. /*478*/ ULONG_PTR lpD3DGlobalDriverData; // Global D3D Data
  2217. /*47c*/ ULONG_PTR lpD3DHALCallbacks; // D3D HAL Callbacks
  2218. //@@BEGIN_DDKSPLIT
  2219. #endif
  2220. //@@END_DDKSPLIT
  2221. /*480*/ DDCORECAPS ddBothCaps; // logical AND of driver and HEL caps
  2222. /* */ //------- Fields added in Version 5.0 -------
  2223. /*5bc*/ LPDDVIDEOPORTCAPS lpDDVideoPortCaps;// Info returned by the HAL (an array if more than one video port)
  2224. /*5c0*/ LPDDRAWI_DDVIDEOPORT_INT dvpList; // PRIVATE: list of all video ports
  2225. //@@BEGIN_DDKSPLIT
  2226. #if 1 //Masked for DDK
  2227. /*5c4*/ LPD3DHAL_CALLBACKS2 lpD3DHALCallbacks2; // Post-DX3 D3D HAL callbacks
  2228. #else
  2229. //@@END_DDKSPLIT
  2230. /*5c4*/ ULONG_PTR lpD3DHALCallbacks2; // Post-DX3 D3D HAL callbacks
  2231. //@@BEGIN_DDKSPLIT
  2232. #endif //1
  2233. //@@END_DDKSPLIT
  2234. /*5c8*/ RECT rectDevice; // rectangle (in desktop coord) for device
  2235. /*5d8*/ DWORD cMonitors; // number of monitors in the system
  2236. /*5dc*/ LPVOID gpbmiSrc; // PRIVATE: used by HEL
  2237. /*5e0*/ LPVOID gpbmiDest; // PRIVATE: used by HEL
  2238. /*5e4*/ LPHEAPALIASINFO phaiHeapAliases; // PRIVATE: video memory heap aliases
  2239. /*5e8*/ ULONG_PTR hKernelHandle;
  2240. /*5ec*/ ULONG_PTR pfnNotifyProc; // Notification proc registered w/ VDD
  2241. /*5f0*/ LPDDKERNELCAPS lpDDKernelCaps; // Capabilies of kernel mode interface
  2242. /*5f4*/ LPDDNONLOCALVIDMEMCAPS lpddNLVCaps; // hardware non-local to local vidmem caps
  2243. /*5f8*/ LPDDNONLOCALVIDMEMCAPS lpddNLVHELCaps; // emulation layer non-local to local vidmem caps
  2244. /*5fc*/ LPDDNONLOCALVIDMEMCAPS lpddNLVBothCaps; // logical AND of hardware and emulation non-local to local vidmem caps
  2245. //@@BEGIN_DDKSPLIT
  2246. #if 1 //Masked for DDK
  2247. /*600*/ LPD3DHAL_D3DEXTENDEDCAPS lpD3DExtendedCaps; // extended caps for D3D
  2248. #else
  2249. //@@END_DDKSPLIT
  2250. /*600*/ ULONG_PTR lpD3DExtendedCaps; // extended caps for D3D
  2251. //@@BEGIN_DDKSPLIT
  2252. #endif //1
  2253. //@@END_DDKSPLIT
  2254. /* */ //--------Fields added in Version 5.0A
  2255. /*604*/ DWORD dwDOSBoxEvent; // Event set when returning from a DOS box
  2256. /*608*/ RECT rectDesktop; // Desktop coordinates
  2257. /*618*/ char cDriverName[MAX_DRIVER_NAME]; // Display name
  2258. /* */ //------- Fields added in Version 6.0 -------
  2259. //@@BEGIN_DDKSPLIT
  2260. #if 1 //Masked for DDK
  2261. /*638*/ LPD3DHAL_CALLBACKS3 lpD3DHALCallbacks3; // DX6 D3D callbacks
  2262. #else
  2263. //@@END_DDKSPLIT
  2264. /*638*/ ULONG_PTR lpD3DHALCallbacks3; // DX6 D3D callbacks
  2265. //@@BEGIN_DDKSPLIT
  2266. #endif //1
  2267. //@@END_DDKSPLIT
  2268. /*63c*/ DWORD dwNumZPixelFormats; // Number of z-buffer+stencil pixel formats
  2269. /*640*/ LPDDPIXELFORMAT lpZPixelFormats; // Pointer to array of z-buffer pixel formats
  2270. /*644*/ LPDDRAWI_DDMOTIONCOMP_INT mcList; // PRIVATE: list of all motion comp objects
  2271. /*648*/ DWORD hDDVxd; // handle to ddraw.vxd
  2272. /*64c*/ DDSCAPSEX ddsCapsMore; // as queried via GUID_DDMoreSurfaceCaps
  2273. //@@BEGIN_DDKSPLIT
  2274. /*658*/ DWORD dwBusyDueToAliasedLock; // Almost identical semantics as dwAliasedLockCnt,
  2275. #ifndef WIN95
  2276. DISPLAYMODEINFO dmiCurrent; // NT: current display mode
  2277. #endif
  2278. /*65c*/ LPDDRAWI_DDRAWSURFACE_INT dsFreeList; // PRIVATE: freed interface list, moved from dsList and ready to be recycled
  2279. /*660*/ DD32BITDRIVERDATA dd32BitDriverData;
  2280. /*780*/ LPDDMORECAPS lpddMoreCaps; // more hardware caps bits for DX7
  2281. /*784*/ LPDDMORECAPS lpddHELMoreCaps; // more HEL caps bits for DX7
  2282. /*788*/ LPDDMORECAPS lpddBothMoreCaps; // bitwise AND of more hardware and HEL caps bits for DX7
  2283. /*78c*/ DDSCAPSEX ddsHELCapsMore; // as queried via GUID_DDMoreSurfaceCaps
  2284. /* */ LPDDMONITORINFO lpMonitorInfo; // What refresh rates the monitor/card support
  2285. /* */ LPDDHAL_GETDRIVERINFO pGetDriverInfo;
  2286. #ifdef WINNT
  2287. DWLIST SurfaceHandleList; // array to hold handles, dynamically allocated
  2288. #endif //WINNT
  2289. GUID guidDevice; // GUID specifying the hardware device
  2290. #ifdef WINNT
  2291. DDHALMODEINFO ModeInfo;
  2292. #endif //WINNT
  2293. #ifdef POSTPONED
  2294. /**/ LPDDUMODEDRVINFO lpDDUmodeDrvInfo; // Usermode driver info
  2295. /**/ LPDDOPTSURFACEINFO lpDDOptSurfaceInfo; //Optimized Surface Information
  2296. #endif //POSTPONED
  2297. #ifdef POSTPONED2
  2298. /**/ LPVOID lpMasterSpriteList; // master sprite list
  2299. #endif //POSTPONED2
  2300. //@@END_DDKSPLIT
  2301. } DDRAWI_DIRECTDRAW_GBL;
  2302. //@@BEGIN_DDKSPLIT
  2303. typedef void (FAR PASCAL * LPPALETTEUPDATENOTIFY)(IUnknown FAR * pD3DIUnknown, DWORD dwPaletteHandle, DWORD dwStartIndex, DWORD dwNumberOfIndices, LPPALETTEENTRY pFirstIndex);
  2304. // For D3DIM700, we send a pointer as the last parameter
  2305. typedef void (FAR PASCAL * LPPALETTEASSOCIATENOTIFY7)(IUnknown FAR * pD3DIUnknown, DWORD dwPaletteHandle, DWORD dwPaletteFlags, LPDDRAWI_DDRAWSURFACE_LCL surf_lcl );
  2306. // For D3DIM, we just send the handle. (MB-41840)
  2307. typedef void (FAR PASCAL * LPPALETTEASSOCIATENOTIFY)(IUnknown FAR * pD3DIUnknown, DWORD dwPaletteHandle, DWORD dwPaletteFlags, DWORD dwSurfaceHandle);
  2308. typedef void (FAR PASCAL * LPSURFACEFLIPNOTIFY)(IUnknown FAR * pD3DIUnknown);
  2309. typedef HRESULT (FAR PASCAL * FLUSHD3DDEVICES) (LPDDRAWI_DDRAWSURFACE_LCL surf_lcl);
  2310. typedef void (FAR PASCAL * D3DTEXTUREUPDATE) (IUnknown FAR * pD3DIUnknown);
  2311. typedef HRESULT (FAR PASCAL * D3DCREATETEXTURE)(LPDIRECTDRAWSURFACE7 pDDS);
  2312. typedef void (FAR PASCAL * D3DDESTROYTEXTURE)(LPVOID pTex);
  2313. typedef void (FAR PASCAL * LPBREAKVBLOCK)(LPVOID lpVB);
  2314. typedef HRESULT (FAR PASCAL * D3DSETPRIORITY)(LPVOID lpTexI, DWORD dwPriority);
  2315. typedef HRESULT (FAR PASCAL * D3DGETPRIORITY)(LPVOID lpTexI, LPDWORD lpdwPriority);
  2316. typedef HRESULT (FAR PASCAL * D3DSETLOD)(LPVOID lpTexI, DWORD dwLOD);
  2317. typedef HRESULT (FAR PASCAL * D3DGETLOD)(LPVOID lpTexI, LPDWORD lpdwLOD);
  2318. #define PALETTEUPDATENOTIFY_NAME "PaletteUpdateNotify"
  2319. #define PALETTEASSOCIATENOTIFY_NAME "PaletteAssociateNotify"
  2320. #define SURFACEFLIPNOTIFY_NAME "SurfaceFlipNotify"
  2321. #define FLUSHD3DDEVICES_NAME "FlushD3DDevices"
  2322. #define FLUSHD3DDEVICES2_NAME "FlushD3DDevices2"
  2323. #define D3DTEXTUREUPDATE_NAME "D3DTextureUpdate"
  2324. #define D3DCREATETEXTURE_NAME "CreateTexture"
  2325. #define D3DDESTROYTEXTURE_NAME "DestroyTexture"
  2326. #define D3DSETPRIORITY_NAME "SetPriority"
  2327. #define D3DGETPRIORITY_NAME "GetPriority"
  2328. #define D3DSETLOD_NAME "SetLOD"
  2329. #define D3DGETLOD_NAME "GetLOD"
  2330. #define BREAKVBLOCK_NAME "D3DBreakVBLock"
  2331. //@@END_DDKSPLIT
  2332. typedef struct _DDRAWI_DIRECTDRAW_LCL
  2333. {
  2334. DWORD lpDDMore; // pointer to additional local data
  2335. LPDDRAWI_DIRECTDRAW_GBL lpGbl; // pointer to data
  2336. DWORD dwUnused0; // not currently used
  2337. DWORD dwLocalFlags; // local flags (DDRAWILCL_)
  2338. DWORD dwLocalRefCnt; // local ref cnt
  2339. DWORD dwProcessId; // owning process id
  2340. IUnknown FAR *pUnkOuter; // outer IUnknown
  2341. DWORD dwObsolete1;
  2342. ULONG_PTR hWnd;
  2343. ULONG_PTR hDC;
  2344. DWORD dwErrorMode;
  2345. LPDDRAWI_DDRAWSURFACE_INT lpPrimary;
  2346. LPDDRAWI_DDRAWSURFACE_INT lpCB;
  2347. DWORD dwPreferredMode;
  2348. //------- Fields added in Version 2.0 -------
  2349. HINSTANCE hD3DInstance; // Handle of Direct3D's DLL.
  2350. IUnknown FAR *pD3DIUnknown; // Direct3D's aggregated IUnknown.
  2351. LPDDHAL_CALLBACKS lpDDCB; // HAL callbacks
  2352. ULONG_PTR hDDVxd; // handle to ddraw.vxd
  2353. //------- Fields added in Version 5.0 -------
  2354. DWORD dwAppHackFlags; // app compatibilty flags
  2355. //------- Fields added in Version 5.A -------
  2356. ULONG_PTR hFocusWnd; // Focus window set via SetCoopLevel
  2357. DWORD dwHotTracking; // Reactive menu etc setting cached while fullscreen
  2358. DWORD dwIMEState; // IME toolbar setting cached while fullscreen
  2359. //------- Fields added in Version 6.0 -------
  2360. ULONG_PTR hWndPopup;
  2361. ULONG_PTR hDD; // PRIVATE: NT Kernel-mode handle
  2362. //@@BEGIN_DDKSPLIT
  2363. #ifdef SHAREDZ
  2364. LPDDRAWI_DDRAWSURFACE_INT lpSharedZ; // Shared z-buffer (if any).
  2365. LPDDRAWI_DDRAWSURFACE_INT lpSharedBack; // Shared back-buffer (if any).
  2366. #endif
  2367. #ifndef WIN95
  2368. DISPLAYMODEINFO dmiPreferred; // NT: preferred display mode
  2369. #endif
  2370. //@@END_DDKSPLIT
  2371. ULONG_PTR hGammaCalibrator; // Private
  2372. LPDDGAMMACALIBRATORPROC lpGammaCalibrator; // Private
  2373. //@@BEGIN_DDKSPLIT
  2374. #ifdef WIN95
  2375. DWLIST SurfaceHandleList; // array to hold handles, dynamically allocated
  2376. #endif //WIN95
  2377. LPDDRAWI_DIRECTDRAW_LCL lpLink; // link to next local
  2378. LPPALETTEUPDATENOTIFY pPaletteUpdateNotify;
  2379. LPPALETTEASSOCIATENOTIFY pPaletteAssociateNotify;
  2380. LPSURFACEFLIPNOTIFY pSurfaceFlipNotify;
  2381. DWORD cbitsPaletteBitfieldBitCount;
  2382. LPDWORD pPaletteHandleUsedBitfield;
  2383. FLUSHD3DDEVICES pFlushD3DDevices;
  2384. FLUSHD3DDEVICES pFlushD3DDevices2;
  2385. D3DTEXTUREUPDATE pD3DTextureUpdate;
  2386. D3DCREATETEXTURE pD3DCreateTexture;
  2387. D3DDESTROYTEXTURE pD3DDestroyTexture;
  2388. D3DSETPRIORITY pD3DSetPriority;
  2389. D3DGETPRIORITY pD3DGetPriority;
  2390. D3DSETLOD pD3DSetLOD;
  2391. D3DGETLOD pD3DGetLOD;
  2392. LPDIRECTDRAWSURFACECALLBACKS pddSurfaceCallbacks;
  2393. LPMODETESTCONTEXT lpModeTestContext; // Keeps track of current mode test
  2394. DWORD dwNumTexLocks; // D3D texturing stats counter
  2395. DWORD dwNumTexGetDCs; // D3D texturing stats counter
  2396. #ifndef WIN95
  2397. DWORD dwCursorShadow; // Cursor shadow turned off while fullscreen
  2398. #endif
  2399. LPBREAKVBLOCK pBreakVBLock; // Private
  2400. //@@END_DDKSPLIT
  2401. } DDRAWI_DIRECTDRAW_LCL;
  2402. #define DDRAWILCL_HASEXCLUSIVEMODE 0x00000001l
  2403. #define DDRAWILCL_ISFULLSCREEN 0x00000002l
  2404. #define DDRAWILCL_SETCOOPCALLED 0x00000004l
  2405. #define DDRAWILCL_ACTIVEYES 0x00000008l
  2406. #define DDRAWILCL_ACTIVENO 0x00000010l
  2407. #define DDRAWILCL_HOOKEDHWND 0x00000020l
  2408. #define DDRAWILCL_ALLOWMODEX 0x00000040l
  2409. #define DDRAWILCL_V1SCLBEHAVIOUR 0x00000080l
  2410. #define DDRAWILCL_MODEHASBEENCHANGED 0x00000100l
  2411. #define DDRAWILCL_CREATEDWINDOW 0x00000200l
  2412. #define DDRAWILCL_DIRTYDC 0x00000400l // Set on ChangeDisplaySettings, cleared when device DC is reinited
  2413. #define DDRAWILCL_DISABLEINACTIVATE 0x00000800l
  2414. #define DDRAWILCL_CURSORCLIPPED 0x00001000l
  2415. #define DDRAWILCL_EXPLICITMONITOR 0x00002000l // device was chosen explicitly i.e. not DDrawCreate(NULL)
  2416. #define DDRAWILCL_MULTITHREADED 0x00004000l // App threaten to be multithreaded
  2417. #define DDRAWILCL_FPUSETUP 0x00008000l // D3D does not need to switch to single prec/exceptions disabled each time
  2418. #define DDRAWILCL_POWEREDDOWN 0x00010000l // Private: indicates that screen saver is powered down
  2419. #define DDRAWILCL_DIRECTDRAW7 0x00020000l // PRIVATE: Marks if this is a IDirectDraw7 object
  2420. #define DDRAWILCL_ATTEMPTEDD3DCONTEXT 0x00040000l // PRIVATE: Marks if this ddraw local has attempted to create a d3d context
  2421. #define DDRAWILCL_FPUPRESERVE 0x00080000l // D3D needs to switch to single prec/exceptions disabled each time
  2422. #define DDRAWILCL_DX8DRIVER 0x00100000l // PRIVATE: Set if this drvier can handle lightweight surfaces
  2423. #define DDRAWILCL_DIRECTDRAW8 0x00200000l // PRIVATE: Marks if this is a IDirectDraw8 object
  2424. #define DDRAWI_xxxxxxxxx1 0x00000001l // unused
  2425. #define DDRAWI_xxxxxxxxx2 0x00000002l // unused
  2426. #define DDRAWI_VIRTUALDESKTOP 0x00000008l // driver is really a multi-monitor virtual desktop
  2427. #define DDRAWI_MODEX 0x00000010l // driver is using modex
  2428. #define DDRAWI_DISPLAYDRV 0x00000020l // driver is display driver
  2429. #define DDRAWI_FULLSCREEN 0x00000040l // driver in fullscreen mode
  2430. #define DDRAWI_MODECHANGED 0x00000080l // display mode has been changed
  2431. #define DDRAWI_NOHARDWARE 0x00000100l // no driver hardware at all
  2432. #define DDRAWI_PALETTEINIT 0x00000200l // GDI palette stuff has been initalized
  2433. #define DDRAWI_NOEMULATION 0x00000400l // no emulation at all
  2434. #define DDRAWI_HASCKEYDESTOVERLAY 0x00000800l // driver has CKDestOverlay
  2435. #define DDRAWI_HASCKEYSRCOVERLAY 0x00001000l // driver has CKSrcOverlay
  2436. #define DDRAWI_HASGDIPALETTE 0x00002000l // GDI palette exists on primary surface
  2437. #define DDRAWI_EMULATIONINITIALIZED 0x00004000l // emulation is initialized
  2438. #define DDRAWI_HASGDIPALETTE_EXCLUSIVE 0x00008000l // exclusive mode palette
  2439. #define DDRAWI_MODEXILLEGAL 0x00010000l // modex is not supported by this hardware
  2440. #define DDRAWI_FLIPPEDTOGDI 0x00020000l // driver has been flipped to show GDI surface
  2441. #define DDRAWI_NEEDSWIN16FORVRAMLOCK 0x00040000l // PRIVATE: Win16 lock must be taken when locking a VRAM surface
  2442. #define DDRAWI_PDEVICEVRAMBITCLEARED 0x00080000l // PRIVATE: the PDEVICE's VRAM bit was cleared by a lock
  2443. #define DDRAWI_STANDARDVGA 0x00100000l // Device is using standard VGA mode (DDRAWI_MODEX will be set)
  2444. #define DDRAWI_EXTENDEDALIGNMENT 0x00200000l // At least one heap has extended alignment. Ignore alignment in VIDMEMINFO
  2445. #define DDRAWI_CHANGINGMODE 0x00400000l // Currently in the middle of a mode change
  2446. #define DDRAWI_GDIDRV 0x00800000l // Driver is a GDI driver
  2447. #define DDRAWI_ATTACHEDTODESKTOP 0x01000000l // Device is attached to the desktop
  2448. #define DDRAWI_UMODELOADED 0x02000000l // User mode driver dll is loaded
  2449. #define DDRAWI_DDRAWDATANOTFETCHED 0x04000000l // PRIVATE: Marks mode-change data fetched (NT)
  2450. #define DDRAWI_SECONDARYDRIVERLOADED 0x08000000l // PRIVATE: Marks if a secndary PVR-style HAL was loaded
  2451. #define DDRAWI_TESTINGMODES 0x10000000l // PRIVATE: A mode test in is progress
  2452. #define DDRAWI_DRIVERINFO2 0x20000000l // PRIVATE: Driver supports GetDriverInfo2
  2453. //@@BEGIN_DDKSPLIT
  2454. #ifdef IS_16
  2455. __inline BOOL IsD3DManaged(psurf_lcl)
  2456. LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl;
  2457. #else
  2458. __inline BOOL IsD3DManaged(LPDDRAWI_DDRAWSURFACE_LCL psurf_lcl)
  2459. #endif
  2460. {
  2461. if(psurf_lcl->dwFlags & DDRAWISURF_DRIVERMANAGED)
  2462. {
  2463. return FALSE;
  2464. }
  2465. else
  2466. {
  2467. return ((psurf_lcl->lpSurfMore->ddsCapsEx.dwCaps2 & (DDSCAPS2_TEXTUREMANAGE | DDSCAPS2_D3DTEXTUREMANAGE)) ? TRUE : FALSE);
  2468. }
  2469. }
  2470. #ifdef IS_16
  2471. __inline void MarkDirty(surf_lcl)
  2472. LPDDRAWI_DDRAWSURFACE_LCL surf_lcl;
  2473. #else
  2474. __inline void MarkDirty(LPDDRAWI_DDRAWSURFACE_LCL surf_lcl)
  2475. #endif // IS_16
  2476. {
  2477. if(surf_lcl->lpSurfMore->lpbDirty)
  2478. {
  2479. *(surf_lcl->lpSurfMore->lpbDirty) = TRUE;
  2480. if(surf_lcl->lpSurfMore->lpDD_lcl->dwLocalFlags & DDRAWILCL_DIRECTDRAW7)
  2481. {
  2482. #ifdef DDASSERT
  2483. DDASSERT(surf_lcl->lpSurfMore->lpDD_lcl->pD3DTextureUpdate);
  2484. DDASSERT(surf_lcl->lpSurfMore->lpDD_lcl->pD3DIUnknown);
  2485. #endif
  2486. surf_lcl->lpSurfMore->lpDD_lcl->pD3DTextureUpdate(surf_lcl->lpSurfMore->lpDD_lcl->pD3DIUnknown);
  2487. }
  2488. }
  2489. }
  2490. /* Flush all batched D3D drawprimitives that's using this surface */
  2491. #ifdef IS_16
  2492. __inline void FlushD3DStates(surf_lcl)
  2493. LPDDRAWI_DDRAWSURFACE_LCL surf_lcl;
  2494. #else
  2495. __inline void FlushD3DStates(LPDDRAWI_DDRAWSURFACE_LCL surf_lcl)
  2496. #endif // IS_16
  2497. {
  2498. if(surf_lcl->lpSurfMore->lpDD_lcl->pD3DIUnknown)
  2499. surf_lcl->lpSurfMore->lpDD_lcl->pFlushD3DDevices(surf_lcl);
  2500. }
  2501. #ifdef IS_16
  2502. __inline BOOL IsToplevel(surf_lcl)
  2503. LPDDRAWI_DDRAWSURFACE_LCL surf_lcl;
  2504. #else
  2505. __inline BOOL IsToplevel(LPDDRAWI_DDRAWSURFACE_LCL surf_lcl)
  2506. #endif // IS_16
  2507. {
  2508. return !((surf_lcl->lpSurfMore->ddsCapsEx.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL) ||
  2509. ((surf_lcl->lpSurfMore->ddsCapsEx.dwCaps2 & DDSCAPS2_CUBEMAP) &&
  2510. (surf_lcl->lpAttachListFrom != NULL)));
  2511. }
  2512. //@@END_DDKSPLIT
  2513. /*
  2514. * VideoPort object interface
  2515. */
  2516. typedef struct _DDRAWI_DDVIDEOPORT_INT
  2517. {
  2518. LPVOID lpVtbl; // pointer to array of interface methods
  2519. LPDDRAWI_DDVIDEOPORT_LCL lpLcl; // pointer to interface data
  2520. LPDDRAWI_DDVIDEOPORT_INT lpLink; // link to next interface
  2521. DWORD dwIntRefCnt; // interface reference count
  2522. DWORD dwFlags; // Private
  2523. } DDRAWI_DDVIDEOPORT_INT;
  2524. typedef struct _DDRAWI_DDVIDEOPORT_LCL
  2525. {
  2526. LPDDRAWI_DIRECTDRAW_LCL lpDD; // pointer to DIRECTDRAW_LCL
  2527. DDVIDEOPORTDESC ddvpDesc; // description used at create time
  2528. DDVIDEOPORTINFO ddvpInfo; // most recent video port info
  2529. LPDDRAWI_DDRAWSURFACE_INT lpSurface; // surface receiving the data
  2530. LPDDRAWI_DDRAWSURFACE_INT lpVBISurface; // surface receiving the VBI data
  2531. LPDDRAWI_DDRAWSURFACE_INT *lpFlipInts; // PRIVATE: surfaces currently being autoflipped
  2532. DWORD dwNumAutoflip; // Number of current autoflip surfaces
  2533. DWORD dwProcessID; // ID of process owning this video port
  2534. DWORD dwStateFlags;
  2535. DWORD dwFlags;
  2536. DWORD dwRefCnt;
  2537. FLATPTR fpLastFlip; // Location from which we last flipped
  2538. ULONG_PTR dwReserved1; // Reserved for display driver
  2539. ULONG_PTR dwReserved2; // Reserved for display driver
  2540. HANDLE hDDVideoPort; // NT Kernel-mode handle
  2541. DWORD dwNumVBIAutoflip;//Number of VBI surfaces currently being autoflipped
  2542. LPDDVIDEOPORTDESC lpVBIDesc; // PRIVATE
  2543. LPDDVIDEOPORTDESC lpVideoDesc; // PRIVATE
  2544. LPDDVIDEOPORTINFO lpVBIInfo; // PRIVATE
  2545. LPDDVIDEOPORTINFO lpVideoInfo; // PRIVATE
  2546. DWORD dwVBIProcessID; // ID of process owning this video port
  2547. LPDDRAWI_DDVIDEOPORT_INT lpVPNotify;
  2548. } DDRAWI_DDVIDEOPORT_LCL;
  2549. #define DDRAWIVPORT_ON 0x00000001 // Video port is pumping data
  2550. #define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 // Video port cannot use hardware autoflip
  2551. #define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 // Overlay cannot bob and colorkey at same time
  2552. #define DDRAWIVPORT_NOKERNELHANDLES 0x00000008 // Unable to allocate kernel resources
  2553. #define DDRAWIVPORT_SOFTWARE_BOB 0x00000010 // All bobbing must be performed in software
  2554. #define DDRAWIVPORT_VBION 0x00000020 // Video is on for the VBI region
  2555. #define DDRAWIVPORT_VIDEOON 0x00000040 // Video is on for the video region
  2556. /*
  2557. * MotionComp object interface
  2558. */
  2559. typedef struct _DDRAWI_DDMOTIONCOMP_INT
  2560. {
  2561. LPVOID lpVtbl;
  2562. LPDDRAWI_DDMOTIONCOMP_LCL lpLcl;
  2563. LPDDRAWI_DDMOTIONCOMP_INT lpLink;
  2564. DWORD dwIntRefCnt;
  2565. } DDRAWI_DDMOTIONCOMP_INT;
  2566. typedef struct _DDRAWI_DDMOTIONCOMP_LCL
  2567. {
  2568. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  2569. GUID guid;
  2570. DWORD dwUncompWidth;
  2571. DWORD dwUncompHeight;
  2572. DDPIXELFORMAT ddUncompPixelFormat;
  2573. DWORD dwInternalFlags;
  2574. DWORD dwRefCnt;
  2575. DWORD dwProcessId;
  2576. HANDLE hMoComp;
  2577. DWORD dwDriverReserved1;
  2578. DWORD dwDriverReserved2;
  2579. DWORD dwDriverReserved3;
  2580. LPVOID lpDriverReserved1;
  2581. LPVOID lpDriverReserved2;
  2582. LPVOID lpDriverReserved3;
  2583. } DDRAWI_DDMOTIONCOMP_LCL;
  2584. //@@BEGIN_DDKSPLIT
  2585. /*
  2586. * The following structure is equivalent to the DDHALINFO structure defined in DirectDraw 1.0.
  2587. * It is used by DirectDraw internally to interpret the DDHALINFO information passed from drivers written
  2588. * prior to DirectDraw 2.0. New applications and drivers should use the DDHALINFO structure defined after
  2589. * this one. DirectDraw distinguishes between the structures via the dwSize field.
  2590. */
  2591. typedef struct _DDHALINFO_V1
  2592. {
  2593. DWORD dwSize;
  2594. LPDDHAL_DDCALLBACKS lpDDCallbacks; // direct draw object callbacks
  2595. LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks; // surface object callbacks
  2596. LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks; // palette object callbacks
  2597. VIDMEMINFO vmiData; // video memory info
  2598. DDCAPS_DX1 ddCaps; // hw specific caps
  2599. DWORD dwMonitorFrequency; // monitor frequency in current mode
  2600. DWORD hWndListBox; // list box for debug output
  2601. DWORD dwModeIndex; // current mode: index into array
  2602. LPDWORD lpdwFourCC; // fourcc codes supported
  2603. DWORD dwNumModes; // number of modes supported
  2604. LPDDHALMODEINFO lpModeInfo; // mode information
  2605. DWORD dwFlags; // create flags
  2606. LPVOID lpPDevice; // physical device ptr
  2607. DWORD hInstance; // instance handle of driver
  2608. } DDHALINFO_V1;
  2609. typedef DDHALINFO_V1 FAR *LPDDHALINFO_V1;
  2610. #define DDHALINFOSIZE_V1 sizeof( DDHALINFO_V1)
  2611. //@@END_DDKSPLIT
  2612. /*
  2613. * structure for display driver to call DDHAL_Create with
  2614. */
  2615. typedef struct _DDHALINFO
  2616. {
  2617. DWORD dwSize;
  2618. LPDDHAL_DDCALLBACKS lpDDCallbacks; // direct draw object callbacks
  2619. LPDDHAL_DDSURFACECALLBACKS lpDDSurfaceCallbacks; // surface object callbacks
  2620. LPDDHAL_DDPALETTECALLBACKS lpDDPaletteCallbacks; // palette object callbacks
  2621. VIDMEMINFO vmiData; // video memory info
  2622. DDCORECAPS ddCaps; // core hw specific caps
  2623. DWORD dwMonitorFrequency; // monitor frequency in current mode
  2624. LPDDHAL_GETDRIVERINFO GetDriverInfo; // callback to get arbitrary vtable from driver
  2625. DWORD dwModeIndex; // current mode: index into array
  2626. LPDWORD lpdwFourCC; // fourcc codes supported
  2627. DWORD dwNumModes; // number of modes supported
  2628. LPDDHALMODEINFO lpModeInfo; // mode information
  2629. DWORD dwFlags; // create flags
  2630. LPVOID lpPDevice; // physical device ptr
  2631. DWORD hInstance; // instance handle of driver
  2632. //------- Fields added in Version 2.0 -------
  2633. //@@BEGIN_DDKSPLIT
  2634. #if 1 //Masked for DDK
  2635. LPD3DHAL_GLOBALDRIVERDATA lpD3DGlobalDriverData; // D3D global Data
  2636. LPD3DHAL_CALLBACKS lpD3DHALCallbacks; // D3D callbacks
  2637. #else //1
  2638. //@@END_DDKSPLIT
  2639. ULONG_PTR lpD3DGlobalDriverData; // D3D global Data
  2640. ULONG_PTR lpD3DHALCallbacks; // D3D callbacks
  2641. //@@BEGIN_DDKSPLIT
  2642. #endif //1
  2643. // For backward compatibility with pre-DX5 runtimes, must not
  2644. // add fields to this structure. Use GetDriverInfo instead.
  2645. //@@END_DDKSPLIT
  2646. LPDDHAL_DDEXEBUFCALLBACKS lpDDExeBufCallbacks; // Execute buffer pseudo object callbacks
  2647. } DDHALINFO;
  2648. typedef DDHALINFO FAR *LPDDHALINFO;
  2649. #define DDHALINFOSIZE_V2 sizeof( DDHALINFO )
  2650. #define DDHALINFO_ISPRIMARYDISPLAY 0x00000001l // indicates driver is primary display driver
  2651. #define DDHALINFO_MODEXILLEGAL 0x00000002l // indicates this hardware does not support modex modes
  2652. #define DDHALINFO_GETDRIVERINFOSET 0x00000004l // indicates that GetDriverInfo is set
  2653. #define DDHALINFO_GETDRIVERINFO2 0x00000008l // indicates driver support GetDriverInfo2 variant
  2654. // of GetDriverInfo. New for DX 8.0
  2655. /*
  2656. * DDRAW16.DLL entry points
  2657. */
  2658. typedef BOOL (DDAPI *LPDDHAL_SETINFO)( LPDDHALINFO lpDDHalInfo, BOOL reset );
  2659. typedef FLATPTR (DDAPI *LPDDHAL_VIDMEMALLOC)( LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, DWORD dwWidth, DWORD dwHeight );
  2660. typedef void (DDAPI *LPDDHAL_VIDMEMFREE)( LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, FLATPTR fpMem );
  2661. extern BOOL DDAPI DDHAL_SetInfo( LPDDHALINFO lpDDHALInfo, BOOL reset );
  2662. extern FLATPTR DDAPI DDHAL_VidMemAlloc( LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, DWORD dwWidth, DWORD dwHeight );
  2663. extern void DDAPI DDHAL_VidMemFree( LPDDRAWI_DIRECTDRAW_GBL lpDD, int heap, FLATPTR fpMem );
  2664. typedef struct
  2665. {
  2666. DWORD dwSize;
  2667. LPDDHAL_SETINFO lpSetInfo;
  2668. LPDDHAL_VIDMEMALLOC lpVidMemAlloc;
  2669. LPDDHAL_VIDMEMFREE lpVidMemFree;
  2670. } DDHALDDRAWFNS;
  2671. typedef DDHALDDRAWFNS FAR *LPDDHALDDRAWFNS;
  2672. /****************************************************************************
  2673. *
  2674. * DDHAL structures for Surface Object callbacks
  2675. *
  2676. ***************************************************************************/
  2677. //@@BEGIN_DDKSPLIT
  2678. /*
  2679. * This special flag is seen only by drivers. The DD runtime sets this
  2680. * bit in DDHAL_BLTDATA.dwFlags if the dwAFlags and ddargbScaleFactors
  2681. * members at the end of the DDHAL_BLTDATA structure are valid.
  2682. * The flag is always set if the DDHAL_BLTDATA structure is passed to
  2683. * the driver via the AlphaBlt HAL callback; otherwise, the flag is zero.
  2684. */
  2685. #define DDBLT_AFLAGS 0x80000000L
  2686. /*
  2687. * This flag will be set in DDHAL_BLTDATA.dwAFlags if the call was originated
  2688. * by the AlphaBlt API method. If the call was originated by the Blt API,
  2689. * this flag will not be set.
  2690. * Drivers which have a unified Blt/AlphaBlt DDI can use this flag to distinguish
  2691. * between the two API calls.
  2692. */
  2693. #define DDABLT_SRCOVERDEST 0x00000001L
  2694. //@@END_DDKSPLIT
  2695. /*
  2696. * structure for passing information to DDHAL Blt and AlphaBlt fns
  2697. */
  2698. typedef struct _DDHAL_BLTDATA
  2699. {
  2700. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2701. LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;// dest surface
  2702. RECTL rDest; // dest rect
  2703. LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; // src surface
  2704. RECTL rSrc; // src rect
  2705. DWORD dwFlags; // blt flags
  2706. DWORD dwROPFlags; // ROP flags (valid for ROPS only)
  2707. DDBLTFX bltFX; // blt FX
  2708. HRESULT ddRVal; // return value
  2709. LPDDHALSURFCB_BLT Blt; // PRIVATE: ptr to callback
  2710. BOOL IsClipped; // clipped blt?
  2711. RECTL rOrigDest; // unclipped dest rect
  2712. // (only valid if IsClipped)
  2713. RECTL rOrigSrc; // unclipped src rect
  2714. // (only valid if IsClipped)
  2715. DWORD dwRectCnt; // count of dest rects
  2716. // (only valid if IsClipped)
  2717. LPRECT prDestRects; // array of dest rects
  2718. //@@BEGIN_DDKSPLIT
  2719. DWORD dwAFlags; // DDABLT_ flags (for AlphaBlt DDI)
  2720. DDARGB ddargbScaleFactors; // RGBA scaling factors (AlphaBlt)
  2721. //@@END_DDKSPLIT
  2722. } DDHAL_BLTDATA;
  2723. /*
  2724. * structure for passing information to DDHAL Lock fn
  2725. */
  2726. typedef struct _DDHAL_LOCKDATA
  2727. {
  2728. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2729. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2730. DWORD bHasRect; // rArea is valid
  2731. RECTL rArea; // area being locked
  2732. LPVOID lpSurfData; // pointer to screen memory (return value)
  2733. HRESULT ddRVal; // return value
  2734. LPDDHALSURFCB_LOCK Lock; // PRIVATE: ptr to callback
  2735. DWORD dwFlags; // DDLOCK flags
  2736. } DDHAL_LOCKDATA;
  2737. /*
  2738. * structure for passing information to DDHAL Unlock fn
  2739. */
  2740. typedef struct _DDHAL_UNLOCKDATA
  2741. {
  2742. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2743. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2744. HRESULT ddRVal; // return value
  2745. LPDDHALSURFCB_UNLOCK Unlock; // PRIVATE: ptr to callback
  2746. } DDHAL_UNLOCKDATA;
  2747. /*
  2748. * structure for passing information to DDHAL UpdateOverlay fn
  2749. */
  2750. typedef struct _DDHAL_UPDATEOVERLAYDATA
  2751. {
  2752. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2753. LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;// dest surface
  2754. RECTL rDest; // dest rect
  2755. LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; // src surface
  2756. RECTL rSrc; // src rect
  2757. DWORD dwFlags; // flags
  2758. DDOVERLAYFX overlayFX; // overlay FX
  2759. HRESULT ddRVal; // return value
  2760. LPDDHALSURFCB_UPDATEOVERLAY UpdateOverlay; // PRIVATE: ptr to callback
  2761. } DDHAL_UPDATEOVERLAYDATA;
  2762. /*
  2763. * structure for passing information to DDHAL UpdateOverlay fn
  2764. */
  2765. typedef struct _DDHAL_SETOVERLAYPOSITIONDATA
  2766. {
  2767. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2768. LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface; // src surface
  2769. LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface;// dest surface
  2770. LONG lXPos; // x position
  2771. LONG lYPos; // y position
  2772. HRESULT ddRVal; // return value
  2773. LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition; // PRIVATE: ptr to callback
  2774. } DDHAL_SETOVERLAYPOSITIONDATA;
  2775. /*
  2776. * structure for passing information to DDHAL SetPalette fn
  2777. */
  2778. typedef struct _DDHAL_SETPALETTEDATA
  2779. {
  2780. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2781. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2782. LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; // palette to set to surface
  2783. HRESULT ddRVal; // return value
  2784. LPDDHALSURFCB_SETPALETTE SetPalette; // PRIVATE: ptr to callback
  2785. BOOL Attach; // attach this palette?
  2786. } DDHAL_SETPALETTEDATA;
  2787. /*
  2788. * structure for passing information to DDHAL Flip fn
  2789. */
  2790. typedef struct _DDHAL_FLIPDATA
  2791. {
  2792. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2793. LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr; // current surface
  2794. LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg; // target surface (to flip to)
  2795. DWORD dwFlags; // flags
  2796. HRESULT ddRVal; // return value
  2797. LPDDHALSURFCB_FLIP Flip; // PRIVATE: ptr to callback
  2798. LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurrLeft; // current surface
  2799. LPDDRAWI_DDRAWSURFACE_LCL lpSurfTargLeft; // target surface (to flip to)
  2800. } DDHAL_FLIPDATA;
  2801. /*
  2802. * structure for passing information to DDHAL DestroySurface fn
  2803. */
  2804. typedef struct _DDHAL_DESTROYSURFACEDATA
  2805. {
  2806. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2807. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2808. HRESULT ddRVal; // return value
  2809. LPDDHALSURFCB_DESTROYSURFACE DestroySurface;// PRIVATE: ptr to callback
  2810. } DDHAL_DESTROYSURFACEDATA;
  2811. /*
  2812. * structure for passing information to DDHAL SetClipList fn
  2813. */
  2814. typedef struct _DDHAL_SETCLIPLISTDATA
  2815. {
  2816. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2817. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2818. HRESULT ddRVal; // return value
  2819. LPDDHALSURFCB_SETCLIPLIST SetClipList; // PRIVATE: ptr to callback
  2820. } DDHAL_SETCLIPLISTDATA;
  2821. /*
  2822. * structure for passing information to DDHAL AddAttachedSurface fn
  2823. */
  2824. typedef struct _DDHAL_ADDATTACHEDSURFACEDATA
  2825. {
  2826. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2827. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2828. LPDDRAWI_DDRAWSURFACE_LCL lpSurfAttached; // surface to attach
  2829. HRESULT ddRVal; // return value
  2830. LPDDHALSURFCB_ADDATTACHEDSURFACE AddAttachedSurface; // PRIVATE: ptr to callback
  2831. } DDHAL_ADDATTACHEDSURFACEDATA;
  2832. /*
  2833. * structure for passing information to DDHAL SetColorKey fn
  2834. */
  2835. typedef struct _DDHAL_SETCOLORKEYDATA
  2836. {
  2837. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2838. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2839. DWORD dwFlags; // flags
  2840. DDCOLORKEY ckNew; // new color key
  2841. HRESULT ddRVal; // return value
  2842. LPDDHALSURFCB_SETCOLORKEY SetColorKey; // PRIVATE: ptr to callback
  2843. } DDHAL_SETCOLORKEYDATA;
  2844. /*
  2845. * structure for passing information to DDHAL GetBltStatus fn
  2846. */
  2847. typedef struct _DDHAL_GETBLTSTATUSDATA
  2848. {
  2849. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2850. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2851. DWORD dwFlags; // flags
  2852. HRESULT ddRVal; // return value
  2853. LPDDHALSURFCB_GETBLTSTATUS GetBltStatus; // PRIVATE: ptr to callback
  2854. } DDHAL_GETBLTSTATUSDATA;
  2855. /*
  2856. * structure for passing information to DDHAL GetFlipStatus fn
  2857. */
  2858. typedef struct _DDHAL_GETFLIPSTATUSDATA
  2859. {
  2860. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2861. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2862. DWORD dwFlags; // flags
  2863. HRESULT ddRVal; // return value
  2864. LPDDHALSURFCB_GETFLIPSTATUS GetFlipStatus; // PRIVATE: ptr to callback
  2865. } DDHAL_GETFLIPSTATUSDATA;
  2866. /****************************************************************************
  2867. *
  2868. * DDHAL structures for Palette Object callbacks
  2869. *
  2870. ***************************************************************************/
  2871. /*
  2872. * structure for passing information to DDHAL DestroyPalette fn
  2873. */
  2874. typedef struct _DDHAL_DESTROYPALETTEDATA
  2875. {
  2876. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2877. LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; // palette struct
  2878. HRESULT ddRVal; // return value
  2879. LPDDHALPALCB_DESTROYPALETTE DestroyPalette; // PRIVATE: ptr to callback
  2880. } DDHAL_DESTROYPALETTEDATA;
  2881. /*
  2882. * structure for passing information to DDHAL SetEntries fn
  2883. */
  2884. typedef struct _DDHAL_SETENTRIESDATA
  2885. {
  2886. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2887. LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; // palette struct
  2888. DWORD dwBase; // base palette index
  2889. DWORD dwNumEntries; // number of palette entries
  2890. LPPALETTEENTRY lpEntries; // color table
  2891. HRESULT ddRVal; // return value
  2892. LPDDHALPALCB_SETENTRIES SetEntries; // PRIVATE: ptr to callback
  2893. } DDHAL_SETENTRIESDATA;
  2894. /****************************************************************************
  2895. *
  2896. * DDHAL structures for Driver Object callbacks
  2897. *
  2898. ***************************************************************************/
  2899. /*
  2900. * structure for passing information to DDHAL CreateSurface fn
  2901. */
  2902. typedef struct _DDHAL_CREATESURFACEDATA
  2903. {
  2904. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2905. LPDDSURFACEDESC lpDDSurfaceDesc;// description of surface being created
  2906. LPDDRAWI_DDRAWSURFACE_LCL FAR *lplpSList; // list of created surface objects
  2907. DWORD dwSCnt; // number of surfaces in SList
  2908. HRESULT ddRVal; // return value
  2909. LPDDHAL_CREATESURFACE CreateSurface; // PRIVATE: ptr to callback
  2910. } DDHAL_CREATESURFACEDATA;
  2911. /*
  2912. * structure for passing information to DDHAL CanCreateSurface fn
  2913. */
  2914. typedef struct _DDHAL_CANCREATESURFACEDATA
  2915. {
  2916. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2917. LPDDSURFACEDESC lpDDSurfaceDesc; // description of surface being created
  2918. DWORD bIsDifferentPixelFormat;// pixel format differs from primary surface
  2919. HRESULT ddRVal; // return value
  2920. LPDDHAL_CANCREATESURFACE CanCreateSurface; // PRIVATE: ptr to callback
  2921. } DDHAL_CANCREATESURFACEDATA;
  2922. /*
  2923. * structure for passing information to DDHAL CreatePalette fn
  2924. */
  2925. typedef struct _DDHAL_CREATEPALETTEDATA
  2926. {
  2927. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2928. LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette; // ddraw palette struct
  2929. LPPALETTEENTRY lpColorTable; // colors to go in palette
  2930. HRESULT ddRVal; // return value
  2931. LPDDHAL_CREATEPALETTE CreatePalette; // PRIVATE: ptr to callback
  2932. BOOL is_excl; // process has exclusive mode
  2933. } DDHAL_CREATEPALETTEDATA;
  2934. /*
  2935. * Return if the vertical blank is in progress
  2936. */
  2937. #define DDWAITVB_I_TESTVB 0x80000006l
  2938. /*
  2939. * structure for passing information to DDHAL WaitForVerticalBlank fn
  2940. */
  2941. typedef struct _DDHAL_WAITFORVERTICALBLANKDATA
  2942. {
  2943. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2944. DWORD dwFlags; // flags
  2945. DWORD bIsInVB; // is in vertical blank
  2946. ULONG_PTR hEvent; // event
  2947. HRESULT ddRVal; // return value
  2948. LPDDHAL_WAITFORVERTICALBLANK WaitForVerticalBlank; // PRIVATE: ptr to callback
  2949. } DDHAL_WAITFORVERTICALBLANKDATA;
  2950. /*
  2951. * structure for passing information to DDHAL DestroyDriver fn
  2952. */
  2953. typedef struct _DDHAL_DESTROYDRIVERDATA
  2954. {
  2955. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2956. HRESULT ddRVal; // return value
  2957. LPDDHAL_DESTROYDRIVER DestroyDriver; // PRIVATE: ptr to callback
  2958. } DDHAL_DESTROYDRIVERDATA;
  2959. /*
  2960. * structure for passing information to DDHAL SetMode fn
  2961. */
  2962. typedef struct _DDHAL_SETMODEDATA
  2963. {
  2964. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2965. DWORD dwModeIndex; // new mode
  2966. HRESULT ddRVal; // return value
  2967. LPDDHAL_SETMODE SetMode; // PRIVATE: ptr to callback
  2968. BOOL inexcl; // in exclusive mode
  2969. BOOL useRefreshRate; // use the refresh rate data in the mode info
  2970. } DDHAL_SETMODEDATA;
  2971. /*
  2972. * structure for passing information to DDHAL driver SetColorKey fn
  2973. */
  2974. typedef struct _DDHAL_DRVSETCOLORKEYDATA
  2975. {
  2976. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface struct
  2977. DWORD dwFlags; // flags
  2978. DDCOLORKEY ckNew; // new color key
  2979. HRESULT ddRVal; // return value
  2980. LPDDHAL_SETCOLORKEY SetColorKey; // PRIVATE: ptr to callback
  2981. } DDHAL_DRVSETCOLORKEYDATA;
  2982. /*
  2983. * structure for passing information to DDHAL GetScanLine fn
  2984. */
  2985. typedef struct _DDHAL_GETSCANLINEDATA
  2986. {
  2987. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2988. DWORD dwScanLine; // returned scan line
  2989. HRESULT ddRVal; // return value
  2990. LPDDHAL_GETSCANLINE GetScanLine; // PRIVATE: ptr to callback
  2991. } DDHAL_GETSCANLINEDATA;
  2992. /*
  2993. * structure for passing information to DDHAL SetExclusiveMode fn
  2994. */
  2995. typedef struct _DDHAL_SETEXCLUSIVEMODEDATA
  2996. {
  2997. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  2998. DWORD dwEnterExcl; // TRUE if entering exclusive mode, FALSE is leaving
  2999. DWORD dwReserved; // reserved for future use
  3000. HRESULT ddRVal; // return value
  3001. LPDDHAL_SETEXCLUSIVEMODE SetExclusiveMode; // PRIVATE: ptr to callback
  3002. } DDHAL_SETEXCLUSIVEMODEDATA;
  3003. /*
  3004. * structure for passing information to DDHAL FlipToGDISurface fn
  3005. */
  3006. typedef struct _DDHAL_FLIPTOGDISURFACEDATA
  3007. {
  3008. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3009. DWORD dwToGDI; // TRUE if flipping to the GDI surface, FALSE if flipping away
  3010. DWORD dwReserved; // reserved for future use
  3011. HRESULT ddRVal; // return value
  3012. LPDDHAL_FLIPTOGDISURFACE FlipToGDISurface; // PRIVATE: ptr to callback
  3013. } DDHAL_FLIPTOGDISURFACEDATA;
  3014. /****************************************************************************
  3015. *
  3016. * DDHAL structures for VideoPort callbacks
  3017. *
  3018. ***************************************************************************/
  3019. /*
  3020. * structure for passing information to DDHAL CanCreateVideoPort fn
  3021. */
  3022. typedef struct _DDHAL_CANCREATEVPORTDATA
  3023. {
  3024. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3025. LPDDVIDEOPORTDESC lpDDVideoPortDesc;
  3026. HRESULT ddRVal; // return value
  3027. LPDDHALVPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort; // PRIVATE: ptr to callback
  3028. } DDHAL_CANCREATEVPORTDATA;
  3029. /*
  3030. * structure for passing information to DDHAL CreateVideoPort fn
  3031. */
  3032. typedef struct _DDHAL_CREATEVPORTDATA
  3033. {
  3034. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3035. LPDDVIDEOPORTDESC lpDDVideoPortDesc;
  3036. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port created
  3037. HRESULT ddRVal; // return value
  3038. LPDDHALVPORTCB_CREATEVIDEOPORT CreateVideoPort; // PRIVATE: ptr to callback
  3039. } DDHAL_CREATEVPORTDATA;
  3040. /*
  3041. * structure for passing information to DDHAL FlipVideoPort fn
  3042. */
  3043. typedef struct _DDHAL_FLIPVPORTDATA
  3044. {
  3045. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3046. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3047. LPDDRAWI_DDRAWSURFACE_LCL lpSurfCurr; // current surface
  3048. LPDDRAWI_DDRAWSURFACE_LCL lpSurfTarg; // target surface
  3049. HRESULT ddRVal; // return value
  3050. LPDDHALVPORTCB_FLIP FlipVideoPort; // PRIVATE: ptr to callback
  3051. } DDHAL_FLIPVPORTDATA;
  3052. /*
  3053. * structure for passing information to DDHAL GetVideoPortBandwidth fn
  3054. */
  3055. typedef struct _DDHAL_GETVPORTBANDWIDTHDATA
  3056. {
  3057. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3058. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3059. LPDDPIXELFORMAT lpddpfFormat; // Format for bandwidth
  3060. DWORD dwWidth;
  3061. DWORD dwHeight;
  3062. DWORD dwFlags; // Prescale factor for bandwidth
  3063. LPDDVIDEOPORTBANDWIDTH lpBandwidth; // Returned bandwidth parameters
  3064. HRESULT ddRVal; // return value
  3065. LPDDHALVPORTCB_GETBANDWIDTH GetVideoPortBandwidth; // PRIVATE: ptr to callback
  3066. } DDHAL_GETVPORTBANDWIDTHDATA;
  3067. /*
  3068. * structure for passing information to DDHAL GetVideoPortInputFormats fn
  3069. */
  3070. typedef struct _DDHAL_GETVPORTINPUTFORMATDATA
  3071. {
  3072. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3073. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3074. DWORD dwFlags; // VBI, regular, or both
  3075. LPDDPIXELFORMAT lpddpfFormat; // Array of formats
  3076. DWORD dwNumFormats; // # of formats in array
  3077. HRESULT ddRVal; // return value
  3078. LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats; // PRIVATE: ptr to callback
  3079. } DDHAL_GETVPORTINPUTFORMATDATA;
  3080. /*
  3081. * structure for passing information to DDHAL GetVideoPortOutputFormats fn
  3082. */
  3083. typedef struct _DDHAL_GETVPORTOUTPUTFORMATDATA
  3084. {
  3085. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3086. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3087. DWORD dwFlags; // VBI, regular, or both
  3088. LPDDPIXELFORMAT lpddpfInputFormat; // Input format
  3089. LPDDPIXELFORMAT lpddpfOutputFormats; // Array of output formats
  3090. DWORD dwNumFormats; // # of formats in array
  3091. HRESULT ddRVal; // return value
  3092. LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats; // PRIVATE: ptr to callback
  3093. } DDHAL_GETVPORTOUTPUTFORMATDATA;
  3094. /*
  3095. * structure for passing information to DDHAL GetVideoPortField fn
  3096. */
  3097. typedef struct _DDHAL_GETVPORTFIELDDATA
  3098. {
  3099. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3100. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3101. BOOL bField; // TRUE if even
  3102. HRESULT ddRVal; // return value
  3103. LPDDHALVPORTCB_GETFIELD GetVideoPortField; // PRIVATE: ptr to callback
  3104. } DDHAL_GETVPORTFIELDDATA;
  3105. /*
  3106. * structure for passing information to DDHAL GetVideoPortLine fn
  3107. */
  3108. typedef struct _DDHAL_GETVPORTLINEDATA
  3109. {
  3110. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3111. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3112. DWORD dwLine; // Current line counter
  3113. HRESULT ddRVal; // return value
  3114. LPDDHALVPORTCB_GETLINE GetVideoPortLine; // PRIVATE: ptr to callback
  3115. } DDHAL_GETVPORTLINEDATA;
  3116. /*
  3117. * structure for passing information to DDHAL GetVideoPortConnectInfo fn
  3118. */
  3119. typedef struct _DDHAL_GETVPORTCONNECTDATA
  3120. {
  3121. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3122. DWORD dwPortId; // ID of desired video port
  3123. LPDDVIDEOPORTCONNECT lpConnect; // Array of DDVIDEOPORTCONNECT structures
  3124. DWORD dwNumEntries; // # of structures in array
  3125. HRESULT ddRVal; // return value
  3126. LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo; // PRIVATE: ptr to callback
  3127. } DDHAL_GETVPORTCONNECTDATA;
  3128. /*
  3129. * structure for passing information to DDHAL DestroyVideoPort fn
  3130. */
  3131. typedef struct _DDHAL_DESTROYVPORTDATA
  3132. {
  3133. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3134. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3135. HRESULT ddRVal; // return value
  3136. LPDDHALVPORTCB_DESTROYVPORT DestroyVideoPort; // PRIVATE: ptr to callback
  3137. } DDHAL_DESTROYVPORTDATA;
  3138. /*
  3139. * structure for passing information to DDHAL GetVideoPortFlipStatus fn
  3140. */
  3141. typedef struct _DDHAL_GETVPORTFLIPSTATUSDATA
  3142. {
  3143. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3144. FLATPTR fpSurface; // surface struct
  3145. HRESULT ddRVal; // return value
  3146. LPDDHALVPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus; // PRIVATE: ptr to callback
  3147. } DDHAL_GETVPORTFLIPSTATUSDATA;
  3148. /*
  3149. * structure for passing information to DDHAL UpdateVideoPort fn
  3150. */
  3151. typedef struct _DDHAL_UPDATEVPORTDATA
  3152. {
  3153. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3154. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3155. LPDDRAWI_DDRAWSURFACE_INT *lplpDDSurface; // surface struct
  3156. LPDDRAWI_DDRAWSURFACE_INT *lplpDDVBISurface; // VBI surface structure
  3157. LPDDVIDEOPORTINFO lpVideoInfo; // Video information
  3158. DWORD dwFlags; // DDRAWI_VPORTSTART, DDRAWI_VPORTSTOP, DDRAWI_VPORTUPDATE
  3159. DWORD dwNumAutoflip; // # of autoflip surfaces. If > 1, lpDDSurface and lpDDVBISurface are arrays.
  3160. DWORD dwNumVBIAutoflip; // # of autoflip surfaces. If > 1, lpDDSurface and lpDDVBISurface are arrays.
  3161. HRESULT ddRVal; // return value
  3162. LPDDHALVPORTCB_UPDATE UpdateVideoPort; // PRIVATE: ptr to callback
  3163. } DDHAL_UPDATEVPORTDATA;
  3164. #define DDRAWI_VPORTSTART 0x0001
  3165. #define DDRAWI_VPORTSTOP 0x0002
  3166. #define DDRAWI_VPORTUPDATE 0x0003
  3167. /*
  3168. * structure for passing information to DDHAL WaitForVideoPortSync fn
  3169. */
  3170. typedef struct _DDHAL_WAITFORVPORTSYNCDATA
  3171. {
  3172. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3173. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3174. DWORD dwFlags; // DDVPEVENT_XXXX
  3175. DWORD dwLine;
  3176. DWORD dwTimeOut; // Max time to wait before returning
  3177. HRESULT ddRVal; // return value
  3178. LPDDHALVPORTCB_WAITFORSYNC WaitForVideoPortSync; // PRIVATE: ptr to callback
  3179. } DDHAL_WAITFORVPORTSYNCDATA;
  3180. /*
  3181. * structure for passing information to DDHAL GetVideoSignalStatus fn
  3182. */
  3183. typedef struct _DDHAL_GETVPORTSIGNALDATA
  3184. {
  3185. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3186. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3187. DWORD dwStatus; // Video signal status
  3188. HRESULT ddRVal; // return value
  3189. LPDDHALVPORTCB_GETSIGNALSTATUS GetVideoSignalStatus;// PRIVATE: ptr to callback
  3190. } DDHAL_GETVPORTSIGNALDATA;
  3191. /*
  3192. * structure for passing information to DDHAL GetVideoSignalStatus fn
  3193. */
  3194. typedef struct _DDHAL_VPORTCOLORDATA
  3195. {
  3196. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3197. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3198. DWORD dwFlags; // Video signal status
  3199. LPDDCOLORCONTROL lpColorData;
  3200. HRESULT ddRVal; // return value
  3201. LPDDHALVPORTCB_COLORCONTROL ColorControl; // PRIVATE: ptr to callback
  3202. } DDHAL_VPORTCOLORDATA;
  3203. #define DDRAWI_VPORTGETCOLOR 0x0001
  3204. #define DDRAWI_VPORTSETCOLOR 0x0002
  3205. /****************************************************************************
  3206. *
  3207. * DDHAL structures for Color Control callbacks
  3208. *
  3209. ***************************************************************************/
  3210. /*
  3211. * structure for passing information to DDHAL ColorControl fn
  3212. */
  3213. typedef struct _DDHAL_COLORCONTROLDATA
  3214. {
  3215. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3216. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // surface
  3217. LPDDCOLORCONTROL lpColorData; // color control information
  3218. DWORD dwFlags; // DDRAWI_GETCOLOR/DDRAWI_SETCOLOR
  3219. HRESULT ddRVal; // return value
  3220. LPDDHALCOLORCB_COLORCONTROL ColorControl; // PRIVATE: ptr to callback
  3221. } DDHAL_COLORCONTROLDATA;
  3222. #define DDRAWI_GETCOLOR 0x0001
  3223. #define DDRAWI_SETCOLOR 0x0002
  3224. /****************************************************************************
  3225. *
  3226. * DDHAL structure for GetDriverData callback
  3227. *
  3228. ***************************************************************************/
  3229. typedef struct _DDHAL_GETDRIVERINFODATA {
  3230. // Input fields filled in by DirectDraw
  3231. DWORD dwSize; // Size of this structure
  3232. DWORD dwFlags; // Flags
  3233. GUID guidInfo; // GUID that DirectX is querying for
  3234. DWORD dwExpectedSize; // Size of callbacks structure expected by DirectDraw.
  3235. LPVOID lpvData; // Buffer that will receive the requested data
  3236. // Output fields filled in by driver
  3237. DWORD dwActualSize; // Size of callbacks structure expected by driver
  3238. HRESULT ddRVal; // Return value from driver
  3239. // Input field: Context information for driver
  3240. // On Win95, this is the dwReserved3 field of the DIRECTDRAW_GBL
  3241. // On NT, this is the hDD field of DIRECTDRAW_GBL
  3242. ULONG_PTR dwContext; // Context Information
  3243. } DDHAL_GETDRIVERINFODATA;
  3244. /****************************************************************************
  3245. *
  3246. * DDHAL structure for misc. driver callbacks
  3247. *
  3248. ***************************************************************************/
  3249. /*
  3250. * structure for passing information to DDHAL GetAvailDriverMemory fn
  3251. */
  3252. typedef struct _DDHAL_GETAVAILDRIVERMEMORYDATA
  3253. {
  3254. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3255. DDSCAPS DDSCaps; // caps for type of surface memory
  3256. DWORD dwTotal; // total memory for this kind of surface
  3257. DWORD dwFree; // free memory for this kind of surface
  3258. HRESULT ddRVal; // return value
  3259. LPDDHAL_GETAVAILDRIVERMEMORY GetAvailDriverMemory; // PRIVATE: ptr to callback
  3260. DDSCAPSEX ddsCapsEx; // Added in V6. Driver should check DDVERSION info
  3261. // to see if this field is present.
  3262. } DDHAL_GETAVAILDRIVERMEMORYDATA;
  3263. /*
  3264. * structure for passing information to DDHEL UpdateNonLocalHeap
  3265. */
  3266. typedef struct _DDHAL_UPDATENONLOCALHEAPDATA
  3267. {
  3268. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3269. DWORD dwHeap; // heap index
  3270. FLATPTR fpGARTLin; // linear GART address of start of heap
  3271. FLATPTR fpGARTDev; // high physical GART address of start of heap
  3272. ULONG_PTR ulPolicyMaxBytes; // maximum amount of AGP memory to use
  3273. HRESULT ddRVal; // return value
  3274. LPDDHAL_UPDATENONLOCALHEAP UpdateNonLocalHeap; // PRIVATE: ptr to callback
  3275. } DDHAL_UPDATENONLOCALHEAPDATA;
  3276. /*
  3277. * Heap Alignment Data Structures
  3278. */
  3279. typedef struct _DDHAL_GETHEAPALIGNMENTDATA
  3280. {
  3281. ULONG_PTR dwInstance; // driver context as returned from 32-bit driver init routine
  3282. DWORD dwHeap; // heap index passed by DirectDraw
  3283. HRESULT ddRVal; // return value
  3284. LPDDHAL_GETHEAPALIGNMENT GetHeapAlignment; // PRIVATE: ptr to callback.
  3285. HEAPALIGNMENT Alignment; // Filled in by driver. Defined in dmemmgr.h
  3286. } DDHAL_GETHEAPALIGNMENTDATA;
  3287. /*
  3288. * These are the only caps you can set in DDHAL_GETHEAPALIGNMENTDATA.Alignment.ddsCaps.
  3289. * Any other caps will be rejected by DirectDraw.
  3290. */
  3291. #define DDHAL_ALIGNVALIDCAPS (DDSCAPS_OFFSCREENPLAIN | \
  3292. DDSCAPS_EXECUTEBUFFER | \
  3293. DDSCAPS_OVERLAY | \
  3294. DDSCAPS_TEXTURE | \
  3295. DDSCAPS_ZBUFFER | \
  3296. DDSCAPS_ALPHA | \
  3297. DDSCAPS_FLIP )
  3298. /*
  3299. * Note that GetSysmemBltStatus uses the same parameter block as GetBltStatus,
  3300. * namely DDHAL_GETBLTSTATUSDATA
  3301. */
  3302. //@@BEGIN_DDKSPLIT
  3303. #ifdef POSTPONED2
  3304. /****************************************************************************
  3305. *
  3306. * DDHAL structures for Miscellaneous2 callbacks
  3307. *
  3308. ***************************************************************************/
  3309. /*
  3310. * Structure that contains the information describing a sprite in the
  3311. * display list that is passed to SetSpriteDisplayList(). This is
  3312. * similar to the DDSPRITE structure used by applications, except
  3313. * that the ddckDestKey, ddckSrcKey, dwRectCnt, and lpRect members
  3314. * below are "reserved" in the DDSPRITE structure.
  3315. */
  3316. typedef struct _DDSPRITEI {
  3317. RECT rcDest; // destination rectangle
  3318. LPDIRECTDRAWSURFACE lpDDSSrc; // source surface
  3319. RECT rcSrc; // source rectangle
  3320. DWORD dwFlags; // DDSPRITE_ flags
  3321. DWORD dwRectCnt; // no. of rects in clip region
  3322. LPRECT lpRect; // array of clip rects
  3323. DDSPRITEFX ddSpriteFX; // sprite special FX
  3324. } DDSPRITEI, *LPDDSPRITEI;
  3325. /*
  3326. * Structure for passing information to DDHAL SetSpriteDisplayList function
  3327. */
  3328. typedef struct _DDHAL_SETSPRITEDISPLAYLISTDATA {
  3329. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3330. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // dest surface struct
  3331. LPDDSPRITEI *lplpDDSprite; // sprite display list
  3332. DWORD dwCount; // number of sprites in list
  3333. DWORD dwSize; // size of each struct in list
  3334. DWORD dwFlags; // flags
  3335. LPDDRAWI_DDRAWSURFACE_LCL lpDDTargetSurface; // target surface (to flip to)
  3336. DWORD dwRectCnt; // no. of rects in clip region
  3337. LPRECT lpRect; // array of clip rects
  3338. HRESULT ddRVal; // return value
  3339. //LPDDHAL_SETSPRITEDISPLAYLIST SetSpriteDisplayList; // PRIVATE: ptr to callback
  3340. } DDHAL_SETSPRITEDISPLAYLISTDATA;
  3341. /*
  3342. * Structure for passing information to DDHAL Resize function
  3343. */
  3344. typedef struct _DDHAL_RESIZEDATA {
  3345. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3346. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // target surface struct
  3347. DWORD dwFlags; // flags
  3348. DWORD dwWidth; // new width of surface
  3349. DWORD dwHeight; // new height of surface
  3350. HRESULT ddRVal; // return value
  3351. //LPDDHAL_RESIZE Resize; // PRIVATE: ptr to callback
  3352. } DDHAL_RESIZEDATA;
  3353. /*
  3354. * Structure for passing information to DDHAL CaptureComposionBuffer function
  3355. */
  3356. typedef struct _DDHAL_CAPTURECOMPOSITIONBUFFERDATA {
  3357. LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3358. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // dest surface struct
  3359. DWORD dwFlags; // flags
  3360. HRESULT ddRVal; // return value
  3361. //LPDDHAL_CAPTURECOMPOSITIONBUFFER CaptureCompostionBuffer; // PRIVATE: ptr to callback
  3362. } DDHAL_CAPTURECOMPOSITIONBUFFERDATA;
  3363. #endif //POSTPONED2
  3364. //@@END_DDKSPLIT
  3365. typedef struct _DDHAL_CREATESURFACEEXDATA {
  3366. DWORD dwFlags; // Currently always 0 and not used
  3367. LPDDRAWI_DIRECTDRAW_LCL lpDDLcl; // driver struct
  3368. LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; // list of created surface objects
  3369. HRESULT ddRVal; // return value
  3370. } DDHAL_CREATESURFACEEXDATA;
  3371. typedef struct _DDHAL_GETDRIVERSTATEDATA {
  3372. DWORD dwFlags; // Flags to indicate the data
  3373. // required
  3374. union
  3375. {
  3376. // LPDDRAWI_DIRECTDRAW_GBL lpDD; // driver struct
  3377. ULONG_PTR dwhContext; // d3d context
  3378. };
  3379. LPDWORD lpdwStates; // ptr to the state data
  3380. // to be filled in by the
  3381. // driver
  3382. DWORD dwLength;
  3383. HRESULT ddRVal; // return value
  3384. } DDHAL_GETDRIVERSTATEDATA;
  3385. typedef struct _DDHAL_DESTROYDDLOCALDATA
  3386. {
  3387. DWORD dwFlags;
  3388. LPDDRAWI_DIRECTDRAW_LCL pDDLcl;
  3389. HRESULT ddRVal;
  3390. } DDHAL_DESTROYDDLOCALDATA;
  3391. /****************************************************************************
  3392. *
  3393. * DDHAL structure for kernel callbacks
  3394. *
  3395. ***************************************************************************/
  3396. /*
  3397. * structure for passing information to DDHAL SyncSurfaceData fn
  3398. */
  3399. typedef struct _DDHAL_SYNCSURFACEDATA
  3400. {
  3401. DWORD dwSize; // Size of this structure
  3402. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3403. LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface; // Surface to sync with
  3404. DWORD dwSurfaceOffset; // Offset in frame buffer of surface
  3405. ULONG_PTR fpLockPtr; // Surface lock ptr
  3406. LONG lPitch; // Surface pitch
  3407. DWORD dwOverlayOffset; // Added to dwSurfaceOffset for origin, clipping, etc.
  3408. DWORD dwOverlaySrcWidth; // Src width of overlay
  3409. DWORD dwOverlaySrcHeight; // Src height of overlay
  3410. DWORD dwOverlayDestWidth; // Dest width of overlay
  3411. DWORD dwOverlayDestHeight; // Dest height of overlay
  3412. ULONG_PTR dwDriverReserved1; // Reserved for the HAL
  3413. ULONG_PTR dwDriverReserved2; // Reserved for the HAL
  3414. ULONG_PTR dwDriverReserved3; // Reserved for the HAL
  3415. HRESULT ddRVal;
  3416. } DDHAL_SYNCSURFACEDATA;
  3417. /*
  3418. * structure for passing information to DDHAL SyncVideoPortData fn
  3419. */
  3420. typedef struct _DDHAL_SYNCVIDEOPORTDATA
  3421. {
  3422. DWORD dwSize; // Size of this structure
  3423. LPDDRAWI_DIRECTDRAW_LCL lpDD; // driver struct
  3424. LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port object
  3425. DWORD dwOriginOffset; // Start address relative to surface
  3426. DWORD dwHeight; // Height of total video region (per field)
  3427. DWORD dwVBIHeight; // Height of VBI region (per field)
  3428. ULONG_PTR dwDriverReserved1; // Reserved for the HAL
  3429. ULONG_PTR dwDriverReserved2; // Reserved for the HAL
  3430. ULONG_PTR dwDriverReserved3; // Reserved for the HAL
  3431. HRESULT ddRVal;
  3432. } DDHAL_SYNCVIDEOPORTDATA;
  3433. //@@BEGIN_DDKSPLIT
  3434. #ifdef POSTPONED
  3435. /****************************************************************************
  3436. *
  3437. * DDHAL structures for Optimized Surface callbacks
  3438. *
  3439. ***************************************************************************/
  3440. typedef struct _DDHAL_CANOPTIMIZESURFACEDATA
  3441. {
  3442. DWORD dwFlags; //in: Not used
  3443. DWORD dwSize; //in: For future expansion
  3444. LPDDRAWI_DIRECTDRAW_LCL lpDD; //in: Driver Struct
  3445. DDOPTSURFACEDESC ddOptSurfDesc; //in: OptSurf description
  3446. DDSURFACEDESC2 ddSurfaceDesc; //in: Surface Description
  3447. DWORD bCanOptimize; //out: Can optimize or not
  3448. ULONG_PTR dwReserved1; //in: Not used
  3449. HRESULT ddRVal; //out: Returned value
  3450. } DDHAL_CANOPTIMIZESURFACEDATA;
  3451. typedef struct _DDHAL_OPTIMIZESURFACEDATA
  3452. {
  3453. DWORD dwFlags; //in: Not used
  3454. DWORD dwSize; //in: For future expansion
  3455. LPDDRAWI_DIRECTDRAW_LCL lpDD; //in: Driver Struct
  3456. DDOPTSURFACEDESC ddOptSurfDesc; //in-out: OptSurf description
  3457. LPDDRAWI_DDRAWSURFACE_LCL lpDDSSrc; //in: Source surface
  3458. LPDDRAWI_DDRAWSURFACE_LCL lpDDSDest; //in: Destination surface
  3459. ULONG_PTR dwReserved1; //in: Not used
  3460. HRESULT ddRVal; //out: Returned value
  3461. } DDHAL_OPTIMIZESURFACEDATA;
  3462. typedef struct _DDHAL_UNOPTIMIZESURFACEDATA
  3463. {
  3464. DWORD dwFlags; //in: Not used
  3465. DWORD dwSize; //in: For future expansion
  3466. LPDDRAWI_DIRECTDRAW_LCL lpDD; //in: Driver Struct
  3467. LPDDRAWI_DDRAWSURFACE_LCL lpDDSSrc; //in: Source surface
  3468. LPDDRAWI_DDRAWSURFACE_LCL lpDDSDest; //in: Destination surface
  3469. ULONG_PTR dwReserved1; //in: Not used
  3470. HRESULT ddRVal; //out: Returned value
  3471. } DDHAL_UNOPTIMIZESURFACEDATA;
  3472. typedef struct _DDHAL_COPYOPTSURFACEDATA
  3473. {
  3474. DWORD dwFlags; //in: Not used
  3475. DWORD dwSize; //in: For future expansion
  3476. LPDDRAWI_DIRECTDRAW_LCL lpDD; //in: Driver Struct
  3477. LPDDRAWI_DDRAWSURFACE_LCL lpDDSSrc; //in: Source surface
  3478. LPDDRAWI_DDRAWSURFACE_LCL lpDDSDest; //in: Destination surface
  3479. ULONG_PTR dwReserved1; //in: Not used
  3480. HRESULT ddRVal; //out: Returned value
  3481. } DDHAL_COPYOPTSURFACEDATA;
  3482. typedef struct _DDHAL_KMODESVCDATA
  3483. {
  3484. DWORD dwFlags; //in-out:
  3485. DWORD dwSize; //in: For future expansion
  3486. LPDDRAWI_DIRECTDRAW_LCL lpDD; //in: Driver Struct
  3487. DWORD dwNumBytes; //in-out: Number of bytes
  3488. // communicated
  3489. LPVOID lpData; //in-out: The actual data
  3490. // communicated
  3491. ULONG_PTR dwReserved1; //in: Not used
  3492. HRESULT ddRVal; //out: Returned value
  3493. } DDHAL_OPTSURFKMODESVCDATA;
  3494. #endif //POSTPONED
  3495. //@@END_DDKSPLIT
  3496. /****************************************************************************
  3497. *
  3498. * DDHAL structure for motion comp callbacks
  3499. *
  3500. ***************************************************************************/
  3501. /*
  3502. * structure for passing information to DDHAL GetMoCompGuids
  3503. */
  3504. typedef struct _DDHAL_GETMOCOMPGUIDSDATA
  3505. {
  3506. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3507. DWORD dwNumGuids;
  3508. LPGUID lpGuids;
  3509. HRESULT ddRVal;
  3510. LPDDHALMOCOMPCB_GETGUIDS GetMoCompGuids;
  3511. } DDHAL_GETMOCOMPGUIDSDATA;
  3512. /*
  3513. * structure for passing information to DDHAL GetMoCompFormats
  3514. */
  3515. typedef struct _DDHAL_GETMOCOMPFORMATSDATA
  3516. {
  3517. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3518. LPGUID lpGuid;
  3519. DWORD dwNumFormats;
  3520. LPDDPIXELFORMAT lpFormats;
  3521. HRESULT ddRVal;
  3522. LPDDHALMOCOMPCB_GETFORMATS GetMoCompFormats;
  3523. } DDHAL_GETMOCOMPFORMATSDATA;
  3524. /*
  3525. * structure for passing information to DDHAL CreateMoComp
  3526. */
  3527. typedef struct _DDHAL_CREATEMOCOMPDATA
  3528. {
  3529. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3530. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3531. LPGUID lpGuid;
  3532. DWORD dwUncompWidth;
  3533. DWORD dwUncompHeight;
  3534. DDPIXELFORMAT ddUncompPixelFormat;
  3535. LPVOID lpData;
  3536. DWORD dwDataSize;
  3537. HRESULT ddRVal;
  3538. LPDDHALMOCOMPCB_CREATE CreateMoComp;
  3539. } DDHAL_CREATEMOCOMPDATA;
  3540. /*
  3541. * structure for passing information to DDHAL GetMoCompBuffInfo
  3542. */
  3543. typedef struct _DDMCCOMPBUFFERINFO
  3544. {
  3545. DWORD dwSize; // [in] size of the struct
  3546. DWORD dwNumCompBuffers; // [out] number of buffers required for compressed data
  3547. DWORD dwWidthToCreate; // [out] Width of surface to create
  3548. DWORD dwHeightToCreate; // [out] Height of surface to create
  3549. DWORD dwBytesToAllocate; // [out] Total number of bytes used by each surface
  3550. DDSCAPS2 ddCompCaps; // [out] caps to create surfaces to store compressed data
  3551. DDPIXELFORMAT ddPixelFormat; // [out] format to create surfaces to store compressed data
  3552. } DDMCCOMPBUFFERINFO, *LPDDMCCOMPBUFFERINFO;
  3553. typedef struct _DDHAL_GETMOCOMPCOMPBUFFDATA
  3554. {
  3555. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3556. LPGUID lpGuid;
  3557. DWORD dwWidth; // [in] width of uncompressed data
  3558. DWORD dwHeight; // [in] height of uncompressed data
  3559. DDPIXELFORMAT ddPixelFormat; // [in] pixel-format of uncompressed data
  3560. DWORD dwNumTypesCompBuffs;// [in/out] number of memory types required for comp buffers
  3561. LPDDMCCOMPBUFFERINFO lpCompBuffInfo; // [in] driver supplied info regarding comp buffers (allocated by client)
  3562. HRESULT ddRVal; // [out]
  3563. LPDDHALMOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
  3564. } DDHAL_GETMOCOMPCOMPBUFFDATA;
  3565. /*
  3566. * structure for passing information to DDHAL GetMoCompBuffInfo
  3567. */
  3568. typedef struct _DDHAL_GETINTERNALMOCOMPDATA
  3569. {
  3570. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3571. LPGUID lpGuid;
  3572. DWORD dwWidth; // [in] width of uncompressed data
  3573. DWORD dwHeight; // [in] height of uncompressed data
  3574. DDPIXELFORMAT ddPixelFormat; // [in] pixel-format of uncompressed data
  3575. DWORD dwScratchMemAlloc; // [out] amount of scratch memory will the hal allocate for its private use
  3576. HRESULT ddRVal; // [out]
  3577. LPDDHALMOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
  3578. } DDHAL_GETINTERNALMOCOMPDATA;
  3579. /*
  3580. * structure for passing information to DDHAL BeginMoCompFrame
  3581. */
  3582. typedef struct _DDHAL_BEGINMOCOMPFRAMEDATA
  3583. {
  3584. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3585. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3586. LPDDRAWI_DDRAWSURFACE_LCL lpDestSurface; // [in] destination buffer in which to decoding this frame
  3587. DWORD dwInputDataSize; // [in] size of other misc input data to begin frame
  3588. LPVOID lpInputData; // [in] pointer to misc input data
  3589. DWORD dwOutputDataSize; // [in] size of other misc output data to begin frame
  3590. LPVOID lpOutputData; // [in] pointer to output misc data (allocated by client)
  3591. HRESULT ddRVal; // [out]
  3592. LPDDHALMOCOMPCB_BEGINFRAME BeginMoCompFrame;
  3593. } DDHAL_BEGINMOCOMPFRAMEDATA;
  3594. /*
  3595. * structure for passing information to DDHAL EndMoCompFrame
  3596. */
  3597. typedef struct _DDHAL_ENDMOCOMPFRAMEDATA
  3598. {
  3599. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3600. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3601. LPVOID lpInputData;
  3602. DWORD dwInputDataSize;
  3603. HRESULT ddRVal;
  3604. LPDDHALMOCOMPCB_ENDFRAME EndMoCompFrame;
  3605. } DDHAL_ENDMOCOMPFRAMEDATA;
  3606. /*
  3607. * structure for passing information to DDHAL RenderMoComp
  3608. */
  3609. typedef struct _DDMCBUFFERINFO
  3610. {
  3611. DWORD dwSize; // [in] size of the struct
  3612. LPDDRAWI_DDRAWSURFACE_LCL lpCompSurface; // [in] pointer to buffer containing compressed data
  3613. DWORD dwDataOffset; // [in] offset of relevant data from the beginning of buffer
  3614. DWORD dwDataSize; // [in] size of relevant data
  3615. LPVOID lpPrivate; // Reserved for DirectDraw;
  3616. } DDMCBUFFERINFO, *LPDDMCBUFFERINFO;
  3617. typedef struct _DDHAL_RENDERMOCOMPDATA
  3618. {
  3619. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3620. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3621. DWORD dwNumBuffers; // [in] Number of entries in the lpMacroBlockInfo array
  3622. LPDDMCBUFFERINFO lpBufferInfo; // [in] Surfaces containing macro block info
  3623. DWORD dwFunction; // [in] Function
  3624. LPVOID lpInputData;
  3625. DWORD dwInputDataSize;
  3626. LPVOID lpOutputData;
  3627. DWORD dwOutputDataSize;
  3628. HRESULT ddRVal; // [out]
  3629. LPDDHALMOCOMPCB_RENDER RenderMoComp;
  3630. } DDHAL_RENDERMOCOMPDATA;
  3631. /*
  3632. * structure for passing information to DDHAL QueryMoCompStatus
  3633. */
  3634. typedef struct _DDHAL_QUERYMOCOMPSTATUSDATA
  3635. {
  3636. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3637. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3638. LPDDRAWI_DDRAWSURFACE_LCL lpSurface; // [in] Surface being queried
  3639. DWORD dwFlags; // [in] DDMCQUERY_XXX falgs
  3640. HRESULT ddRVal; // [out]
  3641. LPDDHALMOCOMPCB_QUERYSTATUS QueryMoCompStatus;
  3642. } DDHAL_QUERYMOCOMPSTATUSDATA;
  3643. #define DDMCQUERY_READ 0x00000001
  3644. //@@BEGIN_DDKSPLIT
  3645. #define DDMCQUERY_VALID 0x00000001
  3646. //@@END_DDKSPLIT
  3647. /*
  3648. * structure for passing information to DDHAL DestroyVideo
  3649. */
  3650. typedef struct _DDHAL_DESTROYMOCOMPDATA
  3651. {
  3652. LPDDRAWI_DIRECTDRAW_LCL lpDD;
  3653. LPDDRAWI_DDMOTIONCOMP_LCL lpMoComp;
  3654. HRESULT ddRVal;
  3655. LPDDHALMOCOMPCB_DESTROY DestroyMoComp;
  3656. } DDHAL_DESTROYMOCOMPDATA;
  3657. #ifdef __cplusplus
  3658. };
  3659. #endif
  3660. #endif