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.

1951 lines
87 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. ddrawint.h
  5. Abstract:
  6. Private entry points, defines and types for Windows NT DirectDraw
  7. driver interface. Corresponds to Windows' 'ddrawi.h' file.
  8. The structure names for NT are different from that of Win95. Use
  9. dx95type.h to aid in porting DirectX code from Win95 to NT.
  10. --*/
  11. #ifndef __DD_INCLUDED__
  12. #define __DD_INCLUDED__
  13. /*
  14. * These GUIDs are used to identify driver info structures, not interfaces,
  15. * so the prefix GUID_ is used instead of IID_.
  16. */
  17. DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a);
  18. DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A);
  19. DEFINE_GUID( GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a);
  20. DEFINE_GUID( GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a);
  21. DEFINE_GUID( GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e);
  22. DEFINE_GUID( GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a);
  23. DEFINE_GUID( GUID_D3DCaps, 0x7bf06991, 0x8794, 0x11d0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xd2, 0xef, 0x02);
  24. DEFINE_GUID( GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29);
  25. DEFINE_GUID( GUID_D3DCallbacks, 0x7bf06990, 0x8794, 0x11d0, 0x91, 0x39, 0x08, 0x00, 0x36, 0xd2, 0xef, 0x02);
  26. DEFINE_GUID( GUID_D3DCallbacks2, 0xba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x0, 0xaa, 0x0, 0xbb, 0xb7, 0x6a);
  27. DEFINE_GUID( GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
  28. DEFINE_GUID( GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37);
  29. DEFINE_GUID( GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
  30. DEFINE_GUID( GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
  31. DEFINE_GUID( GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae);
  32. DEFINE_GUID( GUID_DDMoreCaps, 0x880baf30, 0xb030, 0x11d0, 0x8e, 0xa7, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b);
  33. DEFINE_GUID( GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
  34. DEFINE_GUID( GUID_NTCallbacks, 0x6fe9ecde, 0xdf89, 0x11d1, 0x9d, 0xb0, 0x00, 0x60, 0x08, 0x27, 0x71, 0xba);
  35. DEFINE_GUID( GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
  36. DEFINE_GUID( GUID_GetHeapAlignment, 0x42e02f16, 0x7b41, 0x11d2, 0x8b, 0xff, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
  37. DEFINE_GUID( GUID_UpdateNonLocalHeap, 0x42e02f17, 0x7b41, 0x11d2, 0x8b, 0xff, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
  38. DEFINE_GUID( GUID_NTPrivateDriverCaps, 0xfad16a23, 0x7b66, 0x11d2, 0x83, 0xd7, 0x0, 0xc0, 0x4f, 0x7c, 0xe5, 0x8c);
  39. DEFINE_GUID( GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
  40. DEFINE_GUID( GUID_VPE2Callbacks, 0x52882147, 0x2d47, 0x469a, 0xa0, 0xd1, 0x3, 0x45, 0x58, 0x90, 0xf6, 0xc8);
  41. #ifndef GUID_DEFS_ONLY
  42. #ifndef _NO_DDRAWINT_NO_COM
  43. #ifndef _NO_COM
  44. #define _NO_COM
  45. #include "ddraw.h"
  46. #include "dvp.h"
  47. #undef _NO_COM
  48. #else
  49. #include "ddraw.h"
  50. #include "dvp.h"
  51. #endif
  52. #else
  53. #include "ddraw.h"
  54. #include "dvp.h"
  55. #endif
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59. #define MAKE_HRESULT(sev,fac,code) \
  60. ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
  61. /*
  62. * offset into video meory
  63. */
  64. typedef ULONG_PTR FLATPTR;
  65. /*
  66. * maximum number of surfaces that can be autoflipped between
  67. */
  68. #define MAX_AUTOFLIP_BUFFERS 10
  69. /*
  70. * Indicates the surface is D3D buffer, i.e., a linear chunk of
  71. * memory that holds a Direct3D structure. A driver reports this
  72. * cap to indicate that it can create buffers in video memory and
  73. * Direct3D uses this bit to request buffers. However, it is not
  74. * visible to the API.
  75. */
  76. #define DDSCAPS_EXECUTEBUFFER DDSCAPS_RESERVED2
  77. #define DDSCAPS_COMMANDBUFFER DDSCAPS_RESERVED3
  78. #define DDSCAPS_VERTEXBUFFER DDSCAPS_RESERVED4
  79. /*
  80. * This DDPF flag is used to indicate a DX8+ format capability entry in
  81. * the texture format list. It is not visible to applications.
  82. */
  83. #define DDPF_D3DFORMAT 0x00200000l
  84. /*
  85. * List of operations supported on formats in DX8+ texture list.
  86. * See the DX8 DDK for a complete description of these flags.
  87. */
  88. #define D3DFORMAT_OP_TEXTURE 0x00000001L
  89. #define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L
  90. #define D3DFORMAT_OP_CUBETEXTURE 0x00000004L
  91. #define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L
  92. #define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L
  93. #define D3DFORMAT_OP_ZSTENCIL 0x00000040L
  94. #define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L
  95. // This format can be used as a render target if the current display mode
  96. // is the same depth if the alpha channel is ignored. e.g. if the device
  97. // can render to A8R8G8B8 when the display mode is X8R8G8B8, then the
  98. // format op list entry for A8R8G8B8 should have this cap.
  99. #define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L
  100. // This format contains DirectDraw support (including Flip). This flag
  101. // should not to be set on alpha formats.
  102. #define D3DFORMAT_OP_DISPLAYMODE 0x00000400L
  103. // The rasterizer can support some level of Direct3D support in this format
  104. // and implies that the driver can create a Context in this mode (for some
  105. // render target format). When this flag is set, the D3DFORMAT_OP_DISPLAYMODE
  106. // flag must also be set.
  107. #define D3DFORMAT_OP_3DACCELERATION 0x00000800L
  108. /*
  109. * pre-declare pointers to structs containing data for DDHAL driver fns
  110. */
  111. typedef struct _DD_CREATEPALETTEDATA *PDD_CREATEPALETTEDATA;
  112. typedef struct _DD_CREATESURFACEDATA *PDD_CREATESURFACEDATA;
  113. typedef struct _DD_CANCREATESURFACEDATA *PDD_CANCREATESURFACEDATA;
  114. typedef struct _DD_WAITFORVERTICALBLANKDATA *PDD_WAITFORVERTICALBLANKDATA;
  115. typedef struct _DD_DESTROYDRIVERDATA *PDD_DESTROYDRIVERDATA;
  116. typedef struct _DD_SETMODEDATA *PDD_SETMODEDATA;
  117. typedef struct _DD_DRVSETCOLORKEYDATA *PDD_DRVSETCOLORKEYDATA;
  118. typedef struct _DD_GETSCANLINEDATA *PDD_GETSCANLINEDATA;
  119. typedef struct _DD_MAPMEMORYDATA *PDD_MAPMEMORYDATA;
  120. typedef struct _DD_DESTROYPALETTEDATA *PDD_DESTROYPALETTEDATA;
  121. typedef struct _DD_SETENTRIESDATA *PDD_SETENTRIESDATA;
  122. typedef struct _DD_BLTDATA *PDD_BLTDATA;
  123. typedef struct _DD_LOCKDATA *PDD_LOCKDATA;
  124. typedef struct _DD_UNLOCKDATA *PDD_UNLOCKDATA;
  125. typedef struct _DD_UPDATEOVERLAYDATA *PDD_UPDATEOVERLAYDATA;
  126. typedef struct _DD_SETOVERLAYPOSITIONDATA *PDD_SETOVERLAYPOSITIONDATA;
  127. typedef struct _DD_SETPALETTEDATA *PDD_SETPALETTEDATA;
  128. typedef struct _DD_FLIPDATA *PDD_FLIPDATA;
  129. typedef struct _DD_DESTROYSURFACEDATA *PDD_DESTROYSURFACEDATA;
  130. typedef struct _DD_SETCLIPLISTDATA *PDD_SETCLIPLISTDATA;
  131. typedef struct _DD_ADDATTACHEDSURFACEDATA *PDD_ADDATTACHEDSURFACEDATA;
  132. typedef struct _DD_SETCOLORKEYDATA *PDD_SETCOLORKEYDATA;
  133. typedef struct _DD_GETBLTSTATUSDATA *PDD_GETBLTSTATUSDATA;
  134. typedef struct _DD_GETFLIPSTATUSDATA *PDD_GETFLIPSTATUSDATA;
  135. typedef struct _DD_CANCREATEVPORTDATA *PDD_CANCREATEVPORTDATA;
  136. typedef struct _DD_CREATEVPORTDATA *PDD_CREATEVPORTDATA;
  137. typedef struct _DD_FLIPVPORTDATA *PDD_FLIPVPORTDATA;
  138. typedef struct _DD_GETVPORTCONNECTDATA *PDD_GETVPORTCONNECTDATA;
  139. typedef struct _DD_GETVPORTBANDWIDTHDATA *PDD_GETVPORTBANDWIDTHDATA;
  140. typedef struct _DD_GETVPORTINPUTFORMATDATA *PDD_GETVPORTINPUTFORMATDATA;
  141. typedef struct _DD_GETVPORTOUTPUTFORMATDATA *PDD_GETVPORTOUTPUTFORMATDATA;
  142. typedef struct _DD_GETVPORTAUTOFLIPSURFACEDATA *PDD_GETVPORTAUTOFLIPSURFACEDATA;
  143. typedef struct _DD_GETVPORTFIELDDATA *PDD_GETVPORTFIELDDATA;
  144. typedef struct _DD_GETVPORTLINEDATA *PDD_GETVPORTLINEDATA;
  145. typedef struct _DD_DESTROYVPORTDATA *PDD_DESTROYVPORTDATA;
  146. typedef struct _DD_GETVPORTFLIPSTATUSDATA *PDD_GETVPORTFLIPSTATUSDATA;
  147. typedef struct _DD_UPDATEVPORTDATA *PDD_UPDATEVPORTDATA;
  148. typedef struct _DD_WAITFORVPORTSYNCDATA *PDD_WAITFORVPORTSYNCDATA;
  149. typedef struct _DD_GETVPORTSIGNALDATA *PDD_GETVPORTSIGNALDATA;
  150. typedef struct _DD_VPORTCOLORDATA *PDD_VPORTCOLORDATA;
  151. typedef struct _DD_COLORCONTROLDATA *PDD_COLORCONTROLDATA;
  152. typedef struct _DD_GETAVAILDRIVERMEMORYDATA *PDD_GETAVAILDRIVERMEMORYDATA;
  153. typedef struct _DD_FREEDRIVERMEMORYDATA *PDD_FREEDRIVERMEMORYDATA;
  154. typedef struct _DD_SETEXCLUSIVEMODEDATA *PDD_SETEXCLUSIVEMODEDATA;
  155. typedef struct _DD_FLIPTOGDISURFACEDATA *PDD_FLIPTOGDISURFACEDATA;
  156. typedef struct _DD_GETDRIVERINFODATA *PDD_GETDRIVERINFODATA;
  157. typedef struct _DD_SYNCSURFACEDATA *PDD_SYNCSURFACEDATA;
  158. typedef struct _DD_SYNCVIDEOPORTDATA *PDD_SYNCVIDEOPORTDATA;
  159. typedef struct _DD_GETMOCOMPGUIDSDATA *PDD_GETMOCOMPGUIDSDATA;
  160. typedef struct _DD_GETMOCOMPFORMATSDATA *PDD_GETMOCOMPFORMATSDATA;
  161. typedef struct _DD_CREATEMOCOMPDATA *PDD_CREATEMOCOMPDATA;
  162. typedef struct _DD_GETMOCOMPCOMPBUFFDATA *PDD_GETMOCOMPCOMPBUFFDATA;
  163. typedef struct _DD_GETINTERNALMOCOMPDATA *PDD_GETINTERNALMOCOMPDATA;
  164. typedef struct _DD_BEGINMOCOMPFRAMEDATA *PDD_BEGINMOCOMPFRAMEDATA;
  165. typedef struct _DD_ENDMOCOMPFRAMEDATA *PDD_ENDMOCOMPFRAMEDATA;
  166. typedef struct _DD_RENDERMOCOMPDATA *PDD_RENDERMOCOMPDATA;
  167. typedef struct _DD_QUERYMOCOMPSTATUSDATA *PDD_QUERYMOCOMPSTATUSDATA;
  168. typedef struct _DD_DESTROYMOCOMPDATA *PDD_DESTROYMOCOMPDATA;
  169. // Miscelleneous2 callbacks
  170. typedef struct _DD_CREATESURFACEEXDATA *PDD_CREATESURFACEEXDATA;
  171. typedef struct _DD_GETDRIVERSTATEDATA *PDD_GETDRIVERSTATEDATA;
  172. typedef struct _DD_DESTROYDDLOCALDATA *PDD_DESTROYDDLOCALDATA;
  173. typedef struct _DD_MORESURFACECAPS *PDD_MORESURFACECAPS;
  174. typedef struct _DD_STEREOMODE *PDD_STEREOMODE;
  175. typedef struct _DD_UPDATENONLOCALHEAPDATA *PDD_UPDATENONLOCALHEAPDATA;
  176. /*
  177. * The following structure is defined in dmemmgr.h
  178. */
  179. struct _DD_GETHEAPALIGNMENTDATA;
  180. typedef struct _DD_GETHEAPALIGNMENTDATA *PDD_GETHEAPALIGNMENTDATA;
  181. /*
  182. * value in the fpVidMem; indicates dwBlockSize is valid (surface object)
  183. */
  184. #define DDHAL_PLEASEALLOC_BLOCKSIZE 0x00000002l
  185. #define DDHAL_PLEASEALLOC_USERMEM 0x00000004l
  186. /*
  187. * video memory data structures (passed in DD_HALINFO)
  188. */
  189. typedef struct _VIDEOMEMORY
  190. {
  191. DWORD dwFlags; // flags
  192. FLATPTR fpStart; // start of memory chunk
  193. union
  194. {
  195. FLATPTR fpEnd; // end of memory chunk
  196. DWORD dwWidth; // width of chunk (rectanglar memory)
  197. };
  198. DDSCAPS ddsCaps; // what this memory CANNOT be used for
  199. DDSCAPS ddsCapsAlt; // what this memory CANNOT be used for if it must
  200. union
  201. {
  202. struct _VMEMHEAP *lpHeap; // heap pointer, used by DDRAW
  203. DWORD dwHeight; // height of chunk (rectanguler memory)
  204. };
  205. } VIDEOMEMORY;
  206. typedef VIDEOMEMORY *LPVIDEOMEMORY;
  207. /*
  208. * flags for vidmem struct
  209. */
  210. #define VIDMEM_ISLINEAR 0x00000001l // heap is linear
  211. #define VIDMEM_ISRECTANGULAR 0x00000002l // heap is rectangular
  212. #define VIDMEM_ISHEAP 0x00000004l // heap is preallocated by driver
  213. #define VIDMEM_ISNONLOCAL 0x00000008l // heap populated with non-local video memory
  214. #define VIDMEM_ISWC 0x00000010l // heap populated with write combining memory
  215. #define VIDMEM_HEAPDISABLED 0x00000020l // heap disabled
  216. typedef struct _VIDEOMEMORYINFO
  217. {
  218. FLATPTR fpPrimary; // offset to primary surface
  219. DWORD dwFlags; // flags
  220. DWORD dwDisplayWidth; // current display width
  221. DWORD dwDisplayHeight; // current display height
  222. LONG lDisplayPitch; // current display pitch
  223. DDPIXELFORMAT ddpfDisplay; // pixel format of display
  224. DWORD dwOffscreenAlign; // byte alignment for offscreen surfaces
  225. DWORD dwOverlayAlign; // byte alignment for overlays
  226. DWORD dwTextureAlign; // byte alignment for textures
  227. DWORD dwZBufferAlign; // byte alignment for z buffers
  228. DWORD dwAlphaAlign; // byte alignment for alpha
  229. PVOID pvPrimary; // kernel-mode pointer to primary surface
  230. } VIDEOMEMORYINFO;
  231. typedef VIDEOMEMORYINFO *LPVIDEOMEMORYINFO;
  232. /*
  233. * These structures contain the entry points in the display driver that
  234. * DDRAW will call. Entries that the display driver does not care about
  235. * should be NULL. Passed to DDRAW in DD_HALINFO.
  236. */
  237. typedef struct _DD_DIRECTDRAW_GLOBAL *PDD_DIRECTDRAW_GLOBAL;
  238. typedef struct _DD_SURFACE_GLOBAL *PDD_SURFACE_GLOBAL;
  239. typedef struct _DD_PALETTE_GLOBAL *PDD_PALETTE_GLOBAL;
  240. typedef struct _DD_CLIPPER_GLOBAL *PDD_CLIPPER_GLOBAL;
  241. typedef struct _DD_DIRECTDRAW_LOCAL *PDD_DIRECTDRAW_LOCAL;
  242. typedef struct _DD_SURFACE_LOCAL *PDD_SURFACE_LOCAL;
  243. typedef struct _DD_SURFACE_MORE *PDD_SURFACE_MORE;
  244. typedef struct _DD_SURFACE_INT *PDD_SURFACE_INT;
  245. typedef struct _DD_VIDEOPORT_LOCAL *PDD_VIDEOPORT_LOCAL;
  246. typedef struct _DD_PALETTE_LOCAL *PDD_PALETTE_LOCAL;
  247. typedef struct _DD_CLIPPER_LOCAL *PDD_CLIPPER_LOCAL;
  248. typedef struct _DD_MOTIONCOMP_LOCAL *PDD_MOTIONCOMP_LOCAL;
  249. /*
  250. * DIRECTDRAW object callbacks
  251. */
  252. typedef DWORD (APIENTRY *PDD_SETCOLORKEY)(PDD_DRVSETCOLORKEYDATA );
  253. typedef DWORD (APIENTRY *PDD_CANCREATESURFACE)(PDD_CANCREATESURFACEDATA );
  254. typedef DWORD (APIENTRY *PDD_WAITFORVERTICALBLANK)(PDD_WAITFORVERTICALBLANKDATA );
  255. typedef DWORD (APIENTRY *PDD_CREATESURFACE)(PDD_CREATESURFACEDATA);
  256. typedef DWORD (APIENTRY *PDD_DESTROYDRIVER)(PDD_DESTROYDRIVERDATA);
  257. typedef DWORD (APIENTRY *PDD_SETMODE)(PDD_SETMODEDATA);
  258. typedef DWORD (APIENTRY *PDD_CREATEPALETTE)(PDD_CREATEPALETTEDATA);
  259. typedef DWORD (APIENTRY *PDD_GETSCANLINE)(PDD_GETSCANLINEDATA);
  260. typedef DWORD (APIENTRY *PDD_MAPMEMORY)(PDD_MAPMEMORYDATA);
  261. typedef DWORD (APIENTRY *PDD_GETDRIVERINFO)(PDD_GETDRIVERINFODATA);
  262. typedef struct DD_CALLBACKS
  263. {
  264. DWORD dwSize;
  265. DWORD dwFlags;
  266. PDD_DESTROYDRIVER DestroyDriver;
  267. PDD_CREATESURFACE CreateSurface;
  268. PDD_SETCOLORKEY SetColorKey;
  269. PDD_SETMODE SetMode;
  270. PDD_WAITFORVERTICALBLANK WaitForVerticalBlank;
  271. PDD_CANCREATESURFACE CanCreateSurface;
  272. PDD_CREATEPALETTE CreatePalette;
  273. PDD_GETSCANLINE GetScanLine;
  274. PDD_MAPMEMORY MapMemory;
  275. } DD_CALLBACKS;
  276. typedef DD_CALLBACKS *PDD_CALLBACKS;
  277. #define DDHAL_CB32_DESTROYDRIVER 0x00000001l
  278. #define DDHAL_CB32_CREATESURFACE 0x00000002l
  279. #define DDHAL_CB32_SETCOLORKEY 0x00000004l
  280. #define DDHAL_CB32_SETMODE 0x00000008l
  281. #define DDHAL_CB32_WAITFORVERTICALBLANK 0x00000010l
  282. #define DDHAL_CB32_CANCREATESURFACE 0x00000020l
  283. #define DDHAL_CB32_CREATEPALETTE 0x00000040l
  284. #define DDHAL_CB32_GETSCANLINE 0x00000080l
  285. #define DDHAL_CB32_MAPMEMORY 0x80000000l
  286. // This structure can be queried from the driver from NT5 onward
  287. // using GetDriverInfo with GUID_MiscellaneousCallbacks
  288. typedef DWORD (APIENTRY *PDD_GETAVAILDRIVERMEMORY)(PDD_GETAVAILDRIVERMEMORYDATA);
  289. typedef struct _DD_MISCELLANEOUSCALLBACKS {
  290. DWORD dwSize;
  291. DWORD dwFlags;
  292. PDD_GETAVAILDRIVERMEMORY GetAvailDriverMemory;
  293. } DD_MISCELLANEOUSCALLBACKS, *PDD_MISCELLANEOUSCALLBACKS;
  294. #define DDHAL_MISCCB32_GETAVAILDRIVERMEMORY 0x00000001l
  295. // DDHAL_DDMISCELLANEOUS2CALLBACKS:
  296. // This structure can be queried from the driver from DX7 onward
  297. // using GetDriverInfo with GUID_Miscellaneous2Callbacks
  298. typedef DWORD (APIENTRY *PDD_ALPHABLT)(PDD_BLTDATA);
  299. typedef DWORD (APIENTRY *PDD_CREATESURFACEEX)(PDD_CREATESURFACEEXDATA);
  300. typedef DWORD (APIENTRY *PDD_GETDRIVERSTATE)(PDD_GETDRIVERSTATEDATA);
  301. typedef DWORD (APIENTRY *PDD_DESTROYDDLOCAL)(PDD_DESTROYDDLOCALDATA);
  302. typedef struct _DD_MISCELLANEOUS2CALLBACKS {
  303. DWORD dwSize;
  304. DWORD dwFlags;
  305. PDD_ALPHABLT AlphaBlt;
  306. PDD_CREATESURFACEEX CreateSurfaceEx;
  307. PDD_GETDRIVERSTATE GetDriverState;
  308. PDD_DESTROYDDLOCAL DestroyDDLocal;
  309. } DD_MISCELLANEOUS2CALLBACKS, *PDD_MISCELLANEOUS2CALLBACKS;
  310. #define DDHAL_MISC2CB32_ALPHABLT 0x00000001l
  311. #define DDHAL_MISC2CB32_CREATESURFACEEX 0x00000002l
  312. #define DDHAL_MISC2CB32_GETDRIVERSTATE 0x00000004l
  313. #define DDHAL_MISC2CB32_DESTROYDDLOCAL 0x00000008l
  314. // This is used in the CreateSurfaceEx callback to indicate that the
  315. // SwapHandle emulation is being done
  316. #define DDHAL_CREATESURFACEEX_SWAPHANDLES 0x00000001l
  317. // This structure can be queried from the driver from NT5 onward
  318. // using GetDriverInfo with GUID_NTCallbacks
  319. typedef DWORD (APIENTRY *PDD_FREEDRIVERMEMORY)(PDD_FREEDRIVERMEMORYDATA);
  320. typedef DWORD (APIENTRY *PDD_SETEXCLUSIVEMODE)(PDD_SETEXCLUSIVEMODEDATA);
  321. typedef DWORD (APIENTRY *PDD_FLIPTOGDISURFACE)(PDD_FLIPTOGDISURFACEDATA);
  322. typedef struct _DD_NTCALLBACKS {
  323. DWORD dwSize;
  324. DWORD dwFlags;
  325. PDD_FREEDRIVERMEMORY FreeDriverMemory;
  326. PDD_SETEXCLUSIVEMODE SetExclusiveMode;
  327. PDD_FLIPTOGDISURFACE FlipToGDISurface;
  328. } DD_NTCALLBACKS, *PDD_NTCALLBACKS;
  329. #define DDHAL_NTCB32_FREEDRIVERMEMORY 0x00000001l
  330. #define DDHAL_NTCB32_SETEXCLUSIVEMODE 0x00000002l
  331. #define DDHAL_NTCB32_FLIPTOGDISURFACE 0x00000004l
  332. /*
  333. * DIRECTDRAWPALETTE object callbacks
  334. */
  335. typedef DWORD (APIENTRY *PDD_PALCB_DESTROYPALETTE)(PDD_DESTROYPALETTEDATA );
  336. typedef DWORD (APIENTRY *PDD_PALCB_SETENTRIES)(PDD_SETENTRIESDATA );
  337. typedef struct DD_PALETTECALLBACKS
  338. {
  339. DWORD dwSize;
  340. DWORD dwFlags;
  341. PDD_PALCB_DESTROYPALETTE DestroyPalette;
  342. PDD_PALCB_SETENTRIES SetEntries;
  343. } DD_PALETTECALLBACKS;
  344. typedef DD_PALETTECALLBACKS *PDD_PALETTECALLBACKS;
  345. #define DDHAL_PALCB32_DESTROYPALETTE 0x00000001l
  346. #define DDHAL_PALCB32_SETENTRIES 0x00000002l
  347. /*
  348. * DIRECTDRAWSURFACE object callbacks
  349. */
  350. typedef DWORD (APIENTRY *PDD_SURFCB_LOCK)(PDD_LOCKDATA);
  351. typedef DWORD (APIENTRY *PDD_SURFCB_UNLOCK)(PDD_UNLOCKDATA);
  352. typedef DWORD (APIENTRY *PDD_SURFCB_BLT)(PDD_BLTDATA);
  353. typedef DWORD (APIENTRY *PDD_SURFCB_UPDATEOVERLAY)(PDD_UPDATEOVERLAYDATA);
  354. typedef DWORD (APIENTRY *PDD_SURFCB_SETOVERLAYPOSITION)(PDD_SETOVERLAYPOSITIONDATA);
  355. typedef DWORD (APIENTRY *PDD_SURFCB_SETPALETTE)(PDD_SETPALETTEDATA);
  356. typedef DWORD (APIENTRY *PDD_SURFCB_FLIP)(PDD_FLIPDATA);
  357. typedef DWORD (APIENTRY *PDD_SURFCB_DESTROYSURFACE)(PDD_DESTROYSURFACEDATA);
  358. typedef DWORD (APIENTRY *PDD_SURFCB_SETCLIPLIST)(PDD_SETCLIPLISTDATA);
  359. typedef DWORD (APIENTRY *PDD_SURFCB_ADDATTACHEDSURFACE)(PDD_ADDATTACHEDSURFACEDATA);
  360. typedef DWORD (APIENTRY *PDD_SURFCB_SETCOLORKEY)(PDD_SETCOLORKEYDATA);
  361. typedef DWORD (APIENTRY *PDD_SURFCB_GETBLTSTATUS)(PDD_GETBLTSTATUSDATA);
  362. typedef DWORD (APIENTRY *PDD_SURFCB_GETFLIPSTATUS)(PDD_GETFLIPSTATUSDATA);
  363. typedef struct DD_SURFACECALLBACKS
  364. {
  365. DWORD dwSize;
  366. DWORD dwFlags;
  367. PDD_SURFCB_DESTROYSURFACE DestroySurface;
  368. PDD_SURFCB_FLIP Flip;
  369. PDD_SURFCB_SETCLIPLIST SetClipList;
  370. PDD_SURFCB_LOCK Lock;
  371. PDD_SURFCB_UNLOCK Unlock;
  372. PDD_SURFCB_BLT Blt;
  373. PDD_SURFCB_SETCOLORKEY SetColorKey;
  374. PDD_SURFCB_ADDATTACHEDSURFACE AddAttachedSurface;
  375. PDD_SURFCB_GETBLTSTATUS GetBltStatus;
  376. PDD_SURFCB_GETFLIPSTATUS GetFlipStatus;
  377. PDD_SURFCB_UPDATEOVERLAY UpdateOverlay;
  378. PDD_SURFCB_SETOVERLAYPOSITION SetOverlayPosition;
  379. LPVOID reserved4;
  380. PDD_SURFCB_SETPALETTE SetPalette;
  381. } DD_SURFACECALLBACKS;
  382. typedef DD_SURFACECALLBACKS *PDD_SURFACECALLBACKS;
  383. #define DDHAL_SURFCB32_DESTROYSURFACE 0x00000001l
  384. #define DDHAL_SURFCB32_FLIP 0x00000002l
  385. #define DDHAL_SURFCB32_SETCLIPLIST 0x00000004l
  386. #define DDHAL_SURFCB32_LOCK 0x00000008l
  387. #define DDHAL_SURFCB32_UNLOCK 0x00000010l
  388. #define DDHAL_SURFCB32_BLT 0x00000020l
  389. #define DDHAL_SURFCB32_SETCOLORKEY 0x00000040l
  390. #define DDHAL_SURFCB32_ADDATTACHEDSURFACE 0x00000080l
  391. #define DDHAL_SURFCB32_GETBLTSTATUS 0x00000100l
  392. #define DDHAL_SURFCB32_GETFLIPSTATUS 0x00000200l
  393. #define DDHAL_SURFCB32_UPDATEOVERLAY 0x00000400l
  394. #define DDHAL_SURFCB32_SETOVERLAYPOSITION 0x00000800l
  395. #define DDHAL_SURFCB32_RESERVED4 0x00001000l
  396. #define DDHAL_SURFCB32_SETPALETTE 0x00002000l
  397. /*
  398. * DIRECTVIDEOPORT object callbacks
  399. */
  400. typedef DWORD (APIENTRY *PDD_VPORTCB_CANCREATEVIDEOPORT)(PDD_CANCREATEVPORTDATA);
  401. typedef DWORD (APIENTRY *PDD_VPORTCB_CREATEVIDEOPORT)(PDD_CREATEVPORTDATA);
  402. typedef DWORD (APIENTRY *PDD_VPORTCB_FLIP)(PDD_FLIPVPORTDATA);
  403. typedef DWORD (APIENTRY *PDD_VPORTCB_GETBANDWIDTH)(PDD_GETVPORTBANDWIDTHDATA);
  404. typedef DWORD (APIENTRY *PDD_VPORTCB_GETINPUTFORMATS)(PDD_GETVPORTINPUTFORMATDATA);
  405. typedef DWORD (APIENTRY *PDD_VPORTCB_GETOUTPUTFORMATS)(PDD_GETVPORTOUTPUTFORMATDATA);
  406. typedef DWORD (APIENTRY *PDD_VPORTCB_GETAUTOFLIPSURF)(PDD_GETVPORTAUTOFLIPSURFACEDATA);
  407. typedef DWORD (APIENTRY *PDD_VPORTCB_GETFIELD)(PDD_GETVPORTFIELDDATA);
  408. typedef DWORD (APIENTRY *PDD_VPORTCB_GETLINE)(PDD_GETVPORTLINEDATA);
  409. typedef DWORD (APIENTRY *PDD_VPORTCB_GETVPORTCONNECT)(PDD_GETVPORTCONNECTDATA);
  410. typedef DWORD (APIENTRY *PDD_VPORTCB_DESTROYVPORT)(PDD_DESTROYVPORTDATA);
  411. typedef DWORD (APIENTRY *PDD_VPORTCB_GETFLIPSTATUS)(PDD_GETVPORTFLIPSTATUSDATA);
  412. typedef DWORD (APIENTRY *PDD_VPORTCB_UPDATE)(PDD_UPDATEVPORTDATA);
  413. typedef DWORD (APIENTRY *PDD_VPORTCB_WAITFORSYNC)(PDD_WAITFORVPORTSYNCDATA);
  414. typedef DWORD (APIENTRY *PDD_VPORTCB_GETSIGNALSTATUS)(PDD_GETVPORTSIGNALDATA);
  415. typedef DWORD (APIENTRY *PDD_VPORTCB_COLORCONTROL)(PDD_VPORTCOLORDATA);
  416. typedef struct DD_VIDEOPORTCALLBACKS
  417. {
  418. DWORD dwSize;
  419. DWORD dwFlags;
  420. PDD_VPORTCB_CANCREATEVIDEOPORT CanCreateVideoPort;
  421. PDD_VPORTCB_CREATEVIDEOPORT CreateVideoPort;
  422. PDD_VPORTCB_FLIP FlipVideoPort;
  423. PDD_VPORTCB_GETBANDWIDTH GetVideoPortBandwidth;
  424. PDD_VPORTCB_GETINPUTFORMATS GetVideoPortInputFormats;
  425. PDD_VPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats;
  426. LPVOID lpReserved1;
  427. PDD_VPORTCB_GETFIELD GetVideoPortField;
  428. PDD_VPORTCB_GETLINE GetVideoPortLine;
  429. PDD_VPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo;
  430. PDD_VPORTCB_DESTROYVPORT DestroyVideoPort;
  431. PDD_VPORTCB_GETFLIPSTATUS GetVideoPortFlipStatus;
  432. PDD_VPORTCB_UPDATE UpdateVideoPort;
  433. PDD_VPORTCB_WAITFORSYNC WaitForVideoPortSync;
  434. PDD_VPORTCB_GETSIGNALSTATUS GetVideoSignalStatus;
  435. PDD_VPORTCB_COLORCONTROL ColorControl;
  436. } DD_VIDEOPORTCALLBACKS;
  437. typedef DD_VIDEOPORTCALLBACKS *PDD_VIDEOPORTCALLBACKS;
  438. #define DDHAL_VPORT32_CANCREATEVIDEOPORT 0x00000001l
  439. #define DDHAL_VPORT32_CREATEVIDEOPORT 0x00000002l
  440. #define DDHAL_VPORT32_FLIP 0x00000004l
  441. #define DDHAL_VPORT32_GETBANDWIDTH 0x00000008l
  442. #define DDHAL_VPORT32_GETINPUTFORMATS 0x00000010l
  443. #define DDHAL_VPORT32_GETOUTPUTFORMATS 0x00000020l
  444. #define DDHAL_VPORT32_GETAUTOFLIPSURF 0x00000040l
  445. #define DDHAL_VPORT32_GETFIELD 0x00000080l
  446. #define DDHAL_VPORT32_GETLINE 0x00000100l
  447. #define DDHAL_VPORT32_GETCONNECT 0x00000200l
  448. #define DDHAL_VPORT32_DESTROY 0x00000400l
  449. #define DDHAL_VPORT32_GETFLIPSTATUS 0x00000800l
  450. #define DDHAL_VPORT32_UPDATE 0x00001000l
  451. #define DDHAL_VPORT32_WAITFORSYNC 0x00002000l
  452. #define DDHAL_VPORT32_GETSIGNALSTATUS 0x00004000l
  453. #define DDHAL_VPORT32_COLORCONTROL 0x00008000l
  454. /*
  455. * DIRECTDRAWCOLORCONTROL object callbacks
  456. */
  457. typedef DWORD (APIENTRY *PDD_COLORCB_COLORCONTROL)(PDD_COLORCONTROLDATA);
  458. typedef struct _DD_COLORCONTROLCALLBACKS
  459. {
  460. DWORD dwSize;
  461. DWORD dwFlags;
  462. PDD_COLORCB_COLORCONTROL ColorControl;
  463. } DD_COLORCONTROLCALLBACKS;
  464. typedef DD_COLORCONTROLCALLBACKS *PDD_COLORCONTROLCALLBACKS;
  465. #define DDHAL_COLOR_COLORCONTROL 0x00000001l
  466. /*
  467. * DIRECTDRAWSURFACEKERNEL object callbacks
  468. * This structure can be queried from the driver from DX5 onward
  469. * using GetDriverInfo with GUID_KernelCallbacks
  470. */
  471. typedef DWORD (APIENTRY *PDD_KERNELCB_SYNCSURFACE)(PDD_SYNCSURFACEDATA);
  472. typedef DWORD (APIENTRY *PDD_KERNELCB_SYNCVIDEOPORT)(PDD_SYNCVIDEOPORTDATA);
  473. typedef struct DD_KERNELCALLBACKS
  474. {
  475. DWORD dwSize;
  476. DWORD dwFlags;
  477. PDD_KERNELCB_SYNCSURFACE SyncSurfaceData;
  478. PDD_KERNELCB_SYNCVIDEOPORT SyncVideoPortData;
  479. } DD_KERNELCALLBACKS, *PDD_KERNELCALLBACKS;
  480. #define DDHAL_KERNEL_SYNCSURFACEDATA 0x00000001l
  481. #define DDHAL_KERNEL_SYNCVIDEOPORTDATA 0x00000002l
  482. /*
  483. * DIRECTDRAWVIDEO object callbacks
  484. */
  485. typedef DWORD (APIENTRY *PDD_MOCOMPCB_GETGUIDS)( PDD_GETMOCOMPGUIDSDATA);
  486. typedef DWORD (APIENTRY *PDD_MOCOMPCB_GETFORMATS)( PDD_GETMOCOMPFORMATSDATA);
  487. typedef DWORD (APIENTRY *PDD_MOCOMPCB_CREATE)( PDD_CREATEMOCOMPDATA);
  488. typedef DWORD (APIENTRY *PDD_MOCOMPCB_GETCOMPBUFFINFO)( PDD_GETMOCOMPCOMPBUFFDATA);
  489. typedef DWORD (APIENTRY *PDD_MOCOMPCB_GETINTERNALINFO)( PDD_GETINTERNALMOCOMPDATA);
  490. typedef DWORD (APIENTRY *PDD_MOCOMPCB_BEGINFRAME)( PDD_BEGINMOCOMPFRAMEDATA);
  491. typedef DWORD (APIENTRY *PDD_MOCOMPCB_ENDFRAME)( PDD_ENDMOCOMPFRAMEDATA);
  492. typedef DWORD (APIENTRY *PDD_MOCOMPCB_RENDER)( PDD_RENDERMOCOMPDATA);
  493. typedef DWORD (APIENTRY *PDD_MOCOMPCB_QUERYSTATUS)( PDD_QUERYMOCOMPSTATUSDATA);
  494. typedef DWORD (APIENTRY *PDD_MOCOMPCB_DESTROY)( PDD_DESTROYMOCOMPDATA);
  495. typedef struct DD_MOTIONCOMPCALLBACKS
  496. {
  497. DWORD dwSize;
  498. DWORD dwFlags;
  499. PDD_MOCOMPCB_GETGUIDS GetMoCompGuids;
  500. PDD_MOCOMPCB_GETFORMATS GetMoCompFormats;
  501. PDD_MOCOMPCB_CREATE CreateMoComp;
  502. PDD_MOCOMPCB_GETCOMPBUFFINFO GetMoCompBuffInfo;
  503. PDD_MOCOMPCB_GETINTERNALINFO GetInternalMoCompInfo;
  504. PDD_MOCOMPCB_BEGINFRAME BeginMoCompFrame;
  505. PDD_MOCOMPCB_ENDFRAME EndMoCompFrame;
  506. PDD_MOCOMPCB_RENDER RenderMoComp;
  507. PDD_MOCOMPCB_QUERYSTATUS QueryMoCompStatus;
  508. PDD_MOCOMPCB_DESTROY DestroyMoComp;
  509. } DD_MOTIONCOMPCALLBACKS;
  510. typedef DD_MOTIONCOMPCALLBACKS *PDD_MOTIONCOMPCALLBACKS;
  511. #define DDHAL_MOCOMP32_GETGUIDS 0x00000001
  512. #define DDHAL_MOCOMP32_GETFORMATS 0x00000002
  513. #define DDHAL_MOCOMP32_CREATE 0x00000004
  514. #define DDHAL_MOCOMP32_GETCOMPBUFFINFO 0x00000008
  515. #define DDHAL_MOCOMP32_GETINTERNALINFO 0x00000010
  516. #define DDHAL_MOCOMP32_BEGINFRAME 0x00000020
  517. #define DDHAL_MOCOMP32_ENDFRAME 0x00000040
  518. #define DDHAL_MOCOMP32_RENDER 0x00000080
  519. #define DDHAL_MOCOMP32_QUERYSTATUS 0x00000100
  520. #define DDHAL_MOCOMP32_DESTROY 0x00000200
  521. /*
  522. * CALLBACK RETURN VALUES
  523. *
  524. * these are values returned by the driver from the above callback routines
  525. */
  526. /*
  527. * indicates that the display driver didn't do anything with the call
  528. */
  529. #define DDHAL_DRIVER_NOTHANDLED 0x00000000l
  530. /*
  531. * indicates that the display driver handled the call; HRESULT value is valid
  532. */
  533. #define DDHAL_DRIVER_HANDLED 0x00000001l
  534. /*
  535. * indicates that the display driver couldn't handle the call because it
  536. * ran out of color key hardware resources
  537. */
  538. #define DDHAL_DRIVER_NOCKEYHW 0x00000002l
  539. /*
  540. * Capabilities structure for non-local video memory
  541. */
  542. typedef struct _DD_NONLOCALVIDMEMCAPS
  543. {
  544. DWORD dwSize;
  545. DWORD dwNLVBCaps; // driver specific capabilities for non-local->local vidmem blts
  546. DWORD dwNLVBCaps2; // more driver specific capabilities non-local->local vidmem blts
  547. DWORD dwNLVBCKeyCaps; // driver color key capabilities for non-local->local vidmem blts
  548. DWORD dwNLVBFXCaps; // driver FX capabilities for non-local->local blts
  549. DWORD dwNLVBRops[DD_ROP_SPACE]; // ROPS supported for non-local->local blts
  550. } DD_NONLOCALVIDMEMCAPS;
  551. typedef struct _DD_NONLOCALVIDMEMCAPS *PDD_NONLOCALVIDMEMCAPS;
  552. /*
  553. * DDRAW internal version of DIRECTDRAWPALETTE object; it has data after the vtable
  554. */
  555. typedef struct _DD_PALETTE_GLOBAL
  556. {
  557. ULONG_PTR dwReserved1; // reserved for use by display driver
  558. } DD_PALETTE_GLOBAL;
  559. typedef struct _DD_PALETTE_LOCAL
  560. {
  561. ULONG dwReserved0; // reserved for future expansion
  562. ULONG_PTR dwReserved1; // reserved for use by display driver
  563. } DD_PALETTE_LOCAL;
  564. /*
  565. * DDRAW internal version of DIRECTDRAWCLIPPER object; it has data after the vtable
  566. */
  567. typedef struct _DD_CLIPPER_GLOBAL
  568. {
  569. ULONG_PTR dwReserved1; // reserved for use by display driver
  570. } DD_CLIPPER_GLOBAL;
  571. typedef struct _DD_CLIPPER_LOCAL
  572. {
  573. ULONG_PTR dwReserved1; // reserved for use by display driver
  574. } DD_CLIPPER_LOCAL;
  575. typedef struct _DD_ATTACHLIST *PDD_ATTACHLIST;
  576. typedef struct _DD_ATTACHLIST
  577. {
  578. PDD_ATTACHLIST lpLink; // link to next attached surface
  579. PDD_SURFACE_LOCAL lpAttached; // attached surface local object
  580. } DD_ATTACHLIST;
  581. /*
  582. * DDRAW surface interface struct
  583. */
  584. typedef struct _DD_SURFACE_INT
  585. {
  586. PDD_SURFACE_LOCAL lpLcl; // pointer to interface data
  587. } DD_SURFACE_INT;
  588. /*
  589. * DDRAW internal version of DIRECTDRAWSURFACE struct
  590. *
  591. * the GBL structure is global data for all duplicate objects
  592. */
  593. typedef struct _DD_SURFACE_GLOBAL
  594. {
  595. union
  596. {
  597. DWORD dwBlockSizeY; // block size that display driver requested (return)
  598. LONG lSlicePitch; // slice pitch for volume textures
  599. };
  600. union
  601. {
  602. LPVIDEOMEMORY lpVidMemHeap; // heap vidmem was alloc'ed from
  603. DWORD dwBlockSizeX; // block size that display driver requested (return)
  604. DWORD dwUserMemSize; // user-mode memory size that display driver requested (return)
  605. };
  606. FLATPTR fpVidMem; // pointer to video memory
  607. union
  608. {
  609. LONG lPitch; // pitch of surface
  610. DWORD dwLinearSize; // linear size of non-rectangular surface
  611. };
  612. LONG yHint; // y-coordinate of surface
  613. LONG xHint; // x-coordinate of surface
  614. DWORD wHeight; // height of surface
  615. DWORD wWidth; // width of surface
  616. ULONG_PTR dwReserved1; // reserved for use by display driver
  617. DDPIXELFORMAT ddpfSurface; // pixel format of surface
  618. FLATPTR fpHeapOffset; // raw offset in source heap
  619. HANDLE hCreatorProcess;// opaque identifier for creating process
  620. } DD_SURFACE_GLOBAL;
  621. /*
  622. * a structure holding additional LCL surface information (to maintain some
  623. * compatibility with Win95).
  624. */
  625. typedef struct _DD_SURFACE_MORE
  626. {
  627. DWORD dwMipMapCount; // number of mip-map levels
  628. PDD_VIDEOPORT_LOCAL lpVideoPort; // video port currently writing data to this surface
  629. DWORD dwOverlayFlags; // current overlay flags
  630. DDSCAPSEX ddsCapsEx; // more surface capabilities
  631. DWORD dwSurfaceHandle; // cookie for use with CreateSurfaceEx DDI
  632. } DD_SURFACE_MORE, *PDD_SURFACE_MORE;
  633. /*
  634. * the LCL structure is local data for each individual surface object
  635. */
  636. typedef struct _DD_SURFACE_LOCAL
  637. {
  638. PDD_SURFACE_GLOBAL lpGbl; // pointer to surface shared data
  639. DWORD dwFlags; // flags
  640. DDSCAPS ddsCaps; // capabilities of surface
  641. ULONG_PTR dwReserved1; // reserved for use by display driver
  642. union
  643. {
  644. DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
  645. DDCOLORKEY ddckCKSrcBlt; // color key for source blt and texture use
  646. };
  647. union
  648. {
  649. DDCOLORKEY ddckCKDestOverlay;// color key for destination overlay use
  650. DDCOLORKEY ddckCKDestBlt; // color key for destination blt
  651. };
  652. PDD_SURFACE_MORE lpSurfMore; // pointer to additional local data
  653. PDD_ATTACHLIST lpAttachList; // link to surfaces we attached to
  654. PDD_ATTACHLIST lpAttachListFrom; // link to surfaces that attached to us
  655. RECT rcOverlaySrc; // Overlay source rectangle relative to surface
  656. } DD_SURFACE_LOCAL;
  657. #define DDRAWISURF_HASCKEYSRCBLT 0x00000800L // surface has CKSrcBlt
  658. #define DDRAWISURF_HASPIXELFORMAT 0x00002000L // surface structure has pixel format data
  659. #define DDRAWISURF_HASOVERLAYDATA 0x00004000L // surface structure has overlay data
  660. #define DDRAWISURF_FRONTBUFFER 0x04000000L // surface was originally a front buffer
  661. #define DDRAWISURF_BACKBUFFER 0x08000000L // surface was originally backbuffer
  662. #define DDRAWISURF_INVALID 0x10000000L // surface has been invalidated by mode set
  663. #define DDRAWISURF_DRIVERMANAGED 0x40000000L // surface is a driver managed texture (D3D)
  664. /*
  665. * More driver capabilities (in addition to those described in DDCORECAPS).
  666. * This struct contains the caps bits added to the DDCAPS structure in DX6.
  667. */
  668. typedef struct _DD_MORECAPS
  669. {
  670. DWORD dwSize; // size of DDMORECAPS structure
  671. DWORD dwAlphaCaps; // driver-specific alpha caps for overlays & Vmem->Vmem blts
  672. DWORD dwSVBAlphaCaps; // driver-specific alpha capabilities for System->Vmem blts
  673. DWORD dwVSBAlphaCaps; // driver-specific alpha capabilities for Vmem->System blts
  674. DWORD dwSSBAlphaCaps; // driver-specific alpha capabilities for System->System blts
  675. DWORD dwFilterCaps; // driver-specific filter caps for overlays & Vmem->Vmem blts
  676. DWORD dwSVBFilterCaps; // driver-specific filter capabilities for System->Vmem blts
  677. DWORD dwVSBFilterCaps; // driver-specific filter capabilities for Vmem->System blts
  678. DWORD dwSSBFilterCaps; // driver-specific filter capabilities for System->System blts
  679. } DD_MORECAPS;
  680. typedef DD_MORECAPS *PDD_MORECAPS;
  681. /*
  682. * rop stuff
  683. */
  684. #define ROP_HAS_SOURCE 0x00000001l
  685. #define ROP_HAS_PATTERN 0x00000002l
  686. #define ROP_HAS_SOURCEPATTERN ROP_HAS_SOURCE | ROP_HAS_PATTERN
  687. /*
  688. * This structure mirrors the first entries of the DDCAPS but is of a fixed
  689. * size and will not grow as DDCAPS grows. This is the structure your driver
  690. * returns in DDCOREINFO. Additional caps will be requested via a GetDriverInfo
  691. * call.
  692. */
  693. typedef struct _DDNTCORECAPS
  694. {
  695. DWORD dwSize; // size of the DDDRIVERCAPS structure
  696. DWORD dwCaps; // driver specific capabilities
  697. DWORD dwCaps2; // more driver specific capabilites
  698. DWORD dwCKeyCaps; // color key capabilities of the surface
  699. DWORD dwFXCaps; // driver specific stretching and effects capabilites
  700. DWORD dwFXAlphaCaps; // alpha driver specific capabilities
  701. DWORD dwPalCaps; // palette capabilities
  702. DWORD dwSVCaps; // stereo vision capabilities
  703. DWORD dwAlphaBltConstBitDepths; // DDBD_2,4,8
  704. DWORD dwAlphaBltPixelBitDepths; // DDBD_1,2,4,8
  705. DWORD dwAlphaBltSurfaceBitDepths; // DDBD_1,2,4,8
  706. DWORD dwAlphaOverlayConstBitDepths; // DDBD_2,4,8
  707. DWORD dwAlphaOverlayPixelBitDepths; // DDBD_1,2,4,8
  708. DWORD dwAlphaOverlaySurfaceBitDepths; // DDBD_1,2,4,8
  709. DWORD dwZBufferBitDepths; // DDBD_8,16,24,32
  710. DWORD dwVidMemTotal; // total amount of video memory
  711. DWORD dwVidMemFree; // amount of free video memory
  712. DWORD dwMaxVisibleOverlays; // maximum number of visible overlays
  713. DWORD dwCurrVisibleOverlays; // current number of visible overlays
  714. DWORD dwNumFourCCCodes; // number of four cc codes
  715. DWORD dwAlignBoundarySrc; // source rectangle alignment
  716. DWORD dwAlignSizeSrc; // source rectangle byte size
  717. DWORD dwAlignBoundaryDest; // dest rectangle alignment
  718. DWORD dwAlignSizeDest; // dest rectangle byte size
  719. DWORD dwAlignStrideAlign; // stride alignment
  720. DWORD dwRops[DD_ROP_SPACE]; // ROPS supported
  721. DDSCAPS ddsCaps; // DDSCAPS structure has all the general capabilities
  722. DWORD dwMinOverlayStretch; // minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  723. DWORD dwMaxOverlayStretch; // maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  724. DWORD dwMinLiveVideoStretch; // minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  725. DWORD dwMaxLiveVideoStretch; // maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  726. DWORD dwMinHwCodecStretch; // minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  727. DWORD dwMaxHwCodecStretch; // maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3
  728. DWORD dwReserved1; // reserved
  729. DWORD dwReserved2; // reserved
  730. DWORD dwReserved3; // reserved
  731. DWORD dwSVBCaps; // driver specific capabilities for System->Vmem blts
  732. DWORD dwSVBCKeyCaps; // driver color key capabilities for System->Vmem blts
  733. DWORD dwSVBFXCaps; // driver FX capabilities for System->Vmem blts
  734. DWORD dwSVBRops[DD_ROP_SPACE];// ROPS supported for System->Vmem blts
  735. DWORD dwVSBCaps; // driver specific capabilities for Vmem->System blts
  736. DWORD dwVSBCKeyCaps; // driver color key capabilities for Vmem->System blts
  737. DWORD dwVSBFXCaps; // driver FX capabilities for Vmem->System blts
  738. DWORD dwVSBRops[DD_ROP_SPACE];// ROPS supported for Vmem->System blts
  739. DWORD dwSSBCaps; // driver specific capabilities for System->System blts
  740. DWORD dwSSBCKeyCaps; // driver color key capabilities for System->System blts
  741. DWORD dwSSBFXCaps; // driver FX capabilities for System->System blts
  742. DWORD dwSSBRops[DD_ROP_SPACE];// ROPS supported for System->System blts
  743. DWORD dwMaxVideoPorts; // maximum number of usable video ports
  744. DWORD dwCurrVideoPorts; // current number of video ports used
  745. DWORD dwSVBCaps2; // more driver specific capabilities for System->Vmem blts
  746. } DDNTCORECAPS, *PDDNTCORECAPS;
  747. /*
  748. * structure for D3D buffer callbacks
  749. */
  750. typedef struct _DD_D3DBUFCALLBACKS
  751. {
  752. DWORD dwSize;
  753. DWORD dwFlags;
  754. PDD_CANCREATESURFACE CanCreateD3DBuffer;
  755. PDD_CREATESURFACE CreateD3DBuffer;
  756. PDD_SURFCB_DESTROYSURFACE DestroyD3DBuffer;
  757. PDD_SURFCB_LOCK LockD3DBuffer;
  758. PDD_SURFCB_UNLOCK UnlockD3DBuffer;
  759. } DD_D3DBUFCALLBACKS, *PDD_D3DBUFCALLBACKS;
  760. #define DDHAL_EXEBUFCB32_CANCREATEEXEBUF 0x00000001l
  761. #define DDHAL_EXEBUFCB32_CREATEEXEBUF 0x00000002l
  762. #define DDHAL_EXEBUFCB32_DESTROYEXEBUF 0x00000004l
  763. #define DDHAL_EXEBUFCB32_LOCKEXEBUF 0x00000008l
  764. #define DDHAL_EXEBUFCB32_UNLOCKEXEBUF 0x00000010l
  765. /*
  766. * NT friendly names
  767. */
  768. #define DDHAL_D3DBUFCB32_CANCREATED3DBUF DDHAL_EXEBUFCB32_CANCREATEEXEBUF
  769. #define DDHAL_D3DBUFCB32_CREATED3DBUF DDHAL_EXEBUFCB32_CREATEEXEBUF
  770. #define DDHAL_D3DBUFCB32_DESTROYD3DBUF DDHAL_EXEBUFCB32_DESTROYEXEBUF
  771. #define DDHAL_D3DBUFCB32_LOCKD3DBUF DDHAL_EXEBUFCB32_LOCKEXEBUF
  772. #define DDHAL_D3DBUFCB32_UNLOCKD3DBUF DDHAL_EXEBUFCB32_UNLOCKEXEBUF
  773. /*
  774. * structure for display driver to call DDHAL_Create with
  775. * the _V4 version was used by NT4 drivers
  776. */
  777. typedef struct _DD_HALINFO_V4
  778. {
  779. DWORD dwSize;
  780. VIDEOMEMORYINFO vmiData; // video memory info
  781. DDNTCORECAPS ddCaps; // hw specific caps
  782. PDD_GETDRIVERINFO GetDriverInfo; // callback for querying driver data
  783. DWORD dwFlags; // create flags
  784. } DD_HALINFO_V4, *PDD_HALINFO_V4;
  785. typedef struct _DD_HALINFO
  786. {
  787. DWORD dwSize;
  788. VIDEOMEMORYINFO vmiData; // video memory info
  789. DDNTCORECAPS ddCaps; // hw specific caps
  790. PDD_GETDRIVERINFO GetDriverInfo; // callback for querying driver data
  791. DWORD dwFlags; // create flags
  792. LPVOID lpD3DGlobalDriverData; // D3D global Data
  793. LPVOID lpD3DHALCallbacks; // D3D callbacks
  794. PDD_D3DBUFCALLBACKS lpD3DBufCallbacks; // Buffer callbacks
  795. } DD_HALINFO, *PDD_HALINFO;
  796. #define DDHALINFO_GETDRIVERINFOSET 0x00000004l // indicates that GetDriverInfo is set
  797. #define DDHALINFO_GETDRIVERINFO2 0x00000008l // indicates driver support GetDriverInfo2 variant
  798. // of GetDriverInfo. New for DX 8.0
  799. /*
  800. * DDRAW version of DirectDraw object;
  801. *
  802. */
  803. typedef struct _DD_DIRECTDRAW_GLOBAL
  804. {
  805. VOID* dhpdev; // driver's private PDEV pointer
  806. ULONG_PTR dwReserved1; // reserved for use by display driver
  807. ULONG_PTR dwReserved2; // reserved for use by display driver
  808. LPDDVIDEOPORTCAPS lpDDVideoPortCaps;// Info returned by the HAL (an array if more than one video port)
  809. } DD_DIRECTDRAW_GLOBAL;
  810. typedef struct _DD_DIRECTDRAW_LOCAL
  811. {
  812. PDD_DIRECTDRAW_GLOBAL lpGbl; // pointer to data
  813. } DD_DIRECTDRAW_LOCAL;
  814. typedef struct _DD_VIDEOPORT_LOCAL
  815. {
  816. PDD_DIRECTDRAW_LOCAL lpDD; // pointer to DIRECTDRAW_LCL
  817. DDVIDEOPORTDESC ddvpDesc; // description used at create time
  818. DDVIDEOPORTINFO ddvpInfo; // most recent video port info
  819. PDD_SURFACE_INT lpSurface; // surface receiving the data
  820. PDD_SURFACE_INT lpVBISurface; // surface receiving the VBI data
  821. DWORD dwNumAutoflip; // Number of current autoflip surfaces
  822. DWORD dwNumVBIAutoflip; // Number of VBI surfaces currently being autoflipped
  823. ULONG_PTR dwReserved1; // Reserved for display driver
  824. ULONG_PTR dwReserved2; // Reserved for display driver
  825. ULONG_PTR dwReserved3; // Reserved for display driver
  826. } DD_VIDEOPORT_LOCAL;
  827. #define DDRAWIVPORT_ON 0x00000001 // Video port is pumping data
  828. #define DDRAWIVPORT_SOFTWARE_AUTOFLIP 0x00000002 // Video port cannot use hardware autoflip
  829. #define DDRAWIVPORT_COLORKEYANDINTERP 0x00000004 // Overlay cannot bob and colorkey at same time
  830. typedef struct _DD_MOTIONCOMP_LOCAL
  831. {
  832. PDD_DIRECTDRAW_LOCAL lpDD; // pointer to DIRECTDRAW_LCL
  833. GUID guid;
  834. DWORD dwUncompWidth;
  835. DWORD dwUncompHeight;
  836. DDPIXELFORMAT ddUncompPixelFormat;
  837. DWORD dwDriverReserved1;
  838. DWORD dwDriverReserved2;
  839. DWORD dwDriverReserved3;
  840. LPVOID lpDriverReserved1;
  841. LPVOID lpDriverReserved2;
  842. LPVOID lpDriverReserved3;
  843. } DD_MOTIONCOMP_LOCAL;
  844. /*
  845. * More driver surface capabilities (in addition to those described in DDCORECAPS).
  846. * This struct contains the caps bits added to the DDCAPS.ddsCaps structure in DX6.
  847. */
  848. typedef struct _DD_MORESURFACECAPS
  849. {
  850. DWORD dwSize; // size of DDMORESURFACECAPS structure
  851. DDSCAPSEX ddsCapsMore;
  852. /*
  853. * The DDMORESURFACECAPS struct is of variable size. The following list may be
  854. * filled in by DX6-aware drivers (see DDVERSIONINFO) to restrict their
  855. * video memory heaps (those which are exposed to DirectDraw) to
  856. * certain sets of DDSCAPS_ bits. Thse entries are exactly analogous to
  857. * the ddsCaps and ddsCapsAlt members of the VIDMEM structures listed in
  858. * the VIDMEMINFO.pvmList member of DDHALINFO.vmiData. There should be
  859. * exactly DDHALINFO.vmiData.dwNumHeaps copies of tagExtendedHeapRestrictions
  860. * in this struct. The size of this struct is thus:
  861. * DDMORESURFACECAPS.dwSize = sizeof(DDMORESURFACECAPS) +
  862. * (DDHALINFO.vmiData.dwNumHeaps-1) * sizeof(DDSCAPSEX)*2;
  863. * Note the -1 accounts for the fact that DDMORESURFACECAPS is declared to have 1
  864. * tagExtendedHeapRestrictions member.
  865. */
  866. struct tagNTExtendedHeapRestrictions
  867. {
  868. DDSCAPSEX ddsCapsEx;
  869. DDSCAPSEX ddsCapsExAlt;
  870. } ddsExtendedHeapRestrictions[1];
  871. } DD_MORESURFACECAPS;
  872. // for DX7, we check each mode in the driver if it supports
  873. // Stereo, driver returns DD_OK if mode is ok for stereo
  874. typedef struct _DD_STEREOMODE
  875. {
  876. DWORD dwSize; // size of DDSTEREOMODECAPS structure
  877. DWORD dwHeight;
  878. DWORD dwWidth;
  879. DWORD dwBpp;
  880. DWORD dwRefreshRate;
  881. BOOL bSupported;
  882. } DD_STEREOMODE;
  883. typedef struct _DD_UPDATENONLOCALHEAPDATA
  884. {
  885. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  886. DWORD dwHeap; // heap index
  887. FLATPTR fpGARTLin; // linear GART address of start of heap
  888. FLATPTR fpGARTDev; // high physical GART address of start of heap
  889. ULONG_PTR ulPolicyMaxBytes; // maximum amount of AGP memory to use
  890. HRESULT ddRVal; // return value
  891. VOID* UpdateNonLocalHeap; // Unused: Win95 compatibility
  892. } DD_UPDATENONLOCALHEAPDATA;
  893. /*
  894. * Private caps that the driver passes to change DirectDraw behavior.
  895. * These caps are not exposed to the application
  896. */
  897. typedef struct DD_NTPRIVATEDRIVERCAPS
  898. {
  899. DWORD dwSize;
  900. DWORD dwPrivateCaps;
  901. } DD_NTPRIVATEDRIVERCAPS;
  902. // Driver wants DD_CREATESURFACEDATA.lplpSList to contain a list of
  903. // surfaces to create rather than always a single surface.
  904. #define DDHAL_PRIVATECAP_ATOMICSURFACECREATION 0x00000001l
  905. // Driver wants to be notified when creating a primary surface.
  906. #define DDHAL_PRIVATECAP_NOTIFYPRIMARYCREATION 0x00000002l
  907. #define DDHAL_PRIVATECAP_RESERVED1 0x00000004l
  908. /////////////////////////////////////////////////////////////////////////////
  909. // NT Note:
  910. //
  911. // The following structures must match, field for field, the corresponding
  912. // structures as declared in 'ddrawi.h.' We cannot simply use the same
  913. // structures because the sub-structures such as DD_DIRECTDRAW_GLOBAL are
  914. // different, and have to be properly typed for the drivers.
  915. //
  916. /////////////////////////////////////////////////////////////////////////////
  917. /****************************************************************************
  918. *
  919. * DDHAL structures for Surface Object callbacks
  920. *
  921. ***************************************************************************/
  922. /*
  923. * This special flag is seen only by drivers. The DD runtime sets this
  924. * bit in DDHAL_BLTDATA.dwFlags if the dwAFlags and ddrgbaScaleFactors
  925. * members at the end of the DDHAL_BLTDATA structure are valid.
  926. * The flag is always set if the DDHAL_BLTDATA structure is passed to
  927. * the driver via the AlphaBlt HAL callback; otherwise, the flag is zero.
  928. */
  929. #define DDBLT_AFLAGS 0x80000000L
  930. /*
  931. * This flag will be set in DDHAL_BLTDATA.dwAFlags if the call was originated
  932. * by the AlphaBlt API method. If the call was originated by the Blt API,
  933. * this flag will not be set.
  934. * Drivers which have a unified Blt/AlphaBlt DDI can use this flag to distinguish
  935. * between the two API calls.
  936. */
  937. #define DDABLT_SRCOVERDEST 0x00000001L
  938. /*
  939. * structure for passing information to DDHAL Blt fn
  940. */
  941. typedef struct _DD_BLTDATA
  942. {
  943. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  944. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  945. RECTL rDest; // dest rect
  946. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  947. RECTL rSrc; // src rect
  948. DWORD dwFlags; // blt flags
  949. DWORD dwROPFlags; // ROP flags (valid for ROPS only)
  950. DDBLTFX bltFX; // blt FX
  951. HRESULT ddRVal; // return value
  952. VOID* Blt; // Unused: Win95 compatibility
  953. BOOL IsClipped; // clipped blt?
  954. RECTL rOrigDest; // unclipped dest rect
  955. // (only valid if IsClipped)
  956. RECTL rOrigSrc; // unclipped src rect
  957. // (only valid if IsClipped)
  958. DWORD dwRectCnt; // count of dest rects
  959. // (only valid if IsClipped)
  960. LPRECT prDestRects; // array of dest rects
  961. // (only valid if IsClipped)
  962. DWORD dwAFlags; // DDABLT_ flags (for AlphaBlt DDI)
  963. DDARGB ddargbScaleFactors; // ARGB scaling factors (AlphaBlt)
  964. } DD_BLTDATA;
  965. /*
  966. * structure for passing information to DDHAL Lock fn
  967. */
  968. typedef struct _DD_LOCKDATA
  969. {
  970. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  971. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  972. DWORD bHasRect; // rArea is valid
  973. RECTL rArea; // area being locked
  974. LPVOID lpSurfData; // pointer to screen memory (return value)
  975. HRESULT ddRVal; // return value
  976. VOID* Lock; // Unused: Win95 compatibility
  977. DWORD dwFlags; // DDLOCK flags
  978. FLATPTR fpProcess; // process start address
  979. } DD_LOCKDATA;
  980. /*
  981. * structure for passing information to DDHAL Unlock fn
  982. */
  983. typedef struct _DD_UNLOCKDATA
  984. {
  985. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  986. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  987. HRESULT ddRVal; // return value
  988. VOID* Unlock; // Unused: Win95 compatibility
  989. } DD_UNLOCKDATA;
  990. /*
  991. * structure for passing information to DDHAL UpdateOverlay fn
  992. */
  993. typedef struct _DD_UPDATEOVERLAYDATA
  994. {
  995. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  996. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  997. RECTL rDest; // dest rect
  998. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  999. RECTL rSrc; // src rect
  1000. DWORD dwFlags; // flags
  1001. DDOVERLAYFX overlayFX; // overlay FX
  1002. HRESULT ddRVal; // return value
  1003. VOID* UpdateOverlay; // Unused: Win95 compatibility
  1004. } DD_UPDATEOVERLAYDATA;
  1005. /*
  1006. * structure for passing information to DDHAL UpdateOverlay fn
  1007. */
  1008. typedef struct _DD_SETOVERLAYPOSITIONDATA
  1009. {
  1010. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1011. PDD_SURFACE_LOCAL lpDDSrcSurface; // src surface
  1012. PDD_SURFACE_LOCAL lpDDDestSurface;// dest surface
  1013. LONG lXPos; // x position
  1014. LONG lYPos; // y position
  1015. HRESULT ddRVal; // return value
  1016. VOID* SetOverlayPosition; // Unused: Win95 compatibility
  1017. } DD_SETOVERLAYPOSITIONDATA;
  1018. /*
  1019. * structure for passing information to DDHAL SetPalette fn
  1020. */
  1021. typedef struct _DD_SETPALETTEDATA
  1022. {
  1023. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1024. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1025. PDD_PALETTE_GLOBAL lpDDPalette; // palette to set to surface
  1026. HRESULT ddRVal; // return value
  1027. VOID* SetPalette; // Unused: Win95 compatibility
  1028. BOOL Attach; // attach this palette?
  1029. } DD_SETPALETTEDATA;
  1030. /*
  1031. * structure for passing information to DDHAL Flip fn
  1032. */
  1033. typedef struct _DD_FLIPDATA
  1034. {
  1035. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1036. PDD_SURFACE_LOCAL lpSurfCurr; // current surface
  1037. PDD_SURFACE_LOCAL lpSurfTarg; // target surface (to flip to)
  1038. DWORD dwFlags; // flags
  1039. HRESULT ddRVal; // return value
  1040. VOID* Flip; // Unused: Win95 compatibility
  1041. PDD_SURFACE_LOCAL lpSurfCurrLeft; // left target surface (to flip to)
  1042. PDD_SURFACE_LOCAL lpSurfTargLeft; // left target surface (to flip to)
  1043. } DD_FLIPDATA;
  1044. /*
  1045. * structure for passing information to DDHAL DestroySurface fn
  1046. */
  1047. typedef struct _DD_DESTROYSURFACEDATA
  1048. {
  1049. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1050. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1051. HRESULT ddRVal; // return value
  1052. VOID* DestroySurface;// Unused: Win95 compatibility
  1053. } DD_DESTROYSURFACEDATA;
  1054. /*
  1055. * structure for passing information to DDHAL SetClipList fn
  1056. */
  1057. typedef struct _DD_SETCLIPLISTDATA
  1058. {
  1059. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1060. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1061. HRESULT ddRVal; // return value
  1062. VOID* SetClipList; // Unused: Win95 compatibility
  1063. } DD_SETCLIPLISTDATA;
  1064. /*
  1065. * structure for passing information to DDHAL AddAttachedSurface fn
  1066. */
  1067. typedef struct _DD_ADDATTACHEDSURFACEDATA
  1068. {
  1069. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1070. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1071. PDD_SURFACE_LOCAL lpSurfAttached; // surface to attach
  1072. HRESULT ddRVal; // return value
  1073. VOID* AddAttachedSurface; // Unused: Win95 compatibility
  1074. } DD_ADDATTACHEDSURFACEDATA;
  1075. /*
  1076. * structure for passing information to DDHAL SetColorKey fn
  1077. */
  1078. typedef struct _DD_SETCOLORKEYDATA
  1079. {
  1080. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1081. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1082. DWORD dwFlags; // flags
  1083. DDCOLORKEY ckNew; // new color key
  1084. HRESULT ddRVal; // return value
  1085. VOID* SetColorKey; // Unused: Win95 compatibility
  1086. } DD_SETCOLORKEYDATA;
  1087. /*
  1088. * structure for passing information to DDHAL GetBltStatus fn
  1089. */
  1090. typedef struct _DD_GETBLTSTATUSDATA
  1091. {
  1092. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1093. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1094. DWORD dwFlags; // flags
  1095. HRESULT ddRVal; // return value
  1096. VOID* GetBltStatus; // Unused: Win95 compatibility
  1097. } DD_GETBLTSTATUSDATA;
  1098. /*
  1099. * structure for passing information to DDHAL GetFlipStatus fn
  1100. */
  1101. typedef struct _DD_GETFLIPSTATUSDATA
  1102. {
  1103. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1104. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1105. DWORD dwFlags; // flags
  1106. HRESULT ddRVal; // return value
  1107. VOID* GetFlipStatus; // Unused: Win95 compatibility
  1108. } DD_GETFLIPSTATUSDATA;
  1109. /****************************************************************************
  1110. *
  1111. * DDHAL structures for Palette Object callbacks
  1112. *
  1113. ***************************************************************************/
  1114. /*
  1115. * structure for passing information to DDHAL DestroyPalette fn
  1116. */
  1117. typedef struct _DD_DESTROYPALETTEDATA
  1118. {
  1119. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1120. PDD_PALETTE_GLOBAL lpDDPalette; // palette struct
  1121. HRESULT ddRVal; // return value
  1122. VOID* DestroyPalette; // Unused: Win95 compatibility
  1123. } DD_DESTROYPALETTEDATA;
  1124. /*
  1125. * structure for passing information to DDHAL SetEntries fn
  1126. */
  1127. typedef struct _DD_SETENTRIESDATA
  1128. {
  1129. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1130. PDD_PALETTE_GLOBAL lpDDPalette; // palette struct
  1131. DWORD dwBase; // base palette index
  1132. DWORD dwNumEntries; // number of palette entries
  1133. LPPALETTEENTRY lpEntries; // color table
  1134. HRESULT ddRVal; // return value
  1135. VOID* SetEntries; // Unused: Win95 compatibility
  1136. } DD_SETENTRIESDATA;
  1137. /****************************************************************************
  1138. *
  1139. * DDHAL structures for Driver Object callbacks
  1140. *
  1141. ***************************************************************************/
  1142. typedef DDSURFACEDESC* PDD_SURFACEDESC;
  1143. /*
  1144. * structure for passing information to DDHAL CreateSurface fn
  1145. */
  1146. typedef struct _DD_CREATESURFACEDATA
  1147. {
  1148. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1149. PDD_SURFACEDESC lpDDSurfaceDesc;// description of surface being created
  1150. PDD_SURFACE_LOCAL *lplpSList; // list of created surface objects
  1151. DWORD dwSCnt; // number of surfaces in SList
  1152. HRESULT ddRVal; // return value
  1153. VOID* CreateSurface; // Unused: Win95 compatibility
  1154. } DD_CREATESURFACEDATA;
  1155. /*
  1156. * structure for passing information to DDHAL CanCreateSurface fn
  1157. */
  1158. typedef struct _DD_CANCREATESURFACEDATA
  1159. {
  1160. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1161. PDD_SURFACEDESC lpDDSurfaceDesc; // description of surface being created
  1162. DWORD bIsDifferentPixelFormat;// pixel format differs from primary surface
  1163. HRESULT ddRVal; // return value
  1164. VOID* CanCreateSurface; // Unused: Win95 compatibility
  1165. } DD_CANCREATESURFACEDATA;
  1166. /*
  1167. * structure for passing information to DDHAL CreatePalette fn
  1168. */
  1169. typedef struct _DD_CREATEPALETTEDATA
  1170. {
  1171. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1172. PDD_PALETTE_GLOBAL lpDDPalette; // ddraw palette struct
  1173. LPPALETTEENTRY lpColorTable; // colors to go in palette
  1174. HRESULT ddRVal; // return value
  1175. VOID* CreatePalette; // Unused: Win95 compatibility
  1176. BOOL is_excl; // process has exclusive mode
  1177. } DD_CREATEPALETTEDATA;
  1178. /*
  1179. * Return if the vertical blank is in progress
  1180. */
  1181. #define DDWAITVB_I_TESTVB 0x80000006l
  1182. /*
  1183. * structure for passing information to DDHAL WaitForVerticalBlank fn
  1184. */
  1185. typedef struct _DD_WAITFORVERTICALBLANKDATA
  1186. {
  1187. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1188. DWORD dwFlags; // flags
  1189. DWORD bIsInVB; // is in vertical blank
  1190. DWORD hEvent; // event
  1191. HRESULT ddRVal; // return value
  1192. VOID* WaitForVerticalBlank; // Unused: Win95 compatibility
  1193. } DD_WAITFORVERTICALBLANKDATA;
  1194. /*
  1195. * structure for passing information to DDHAL driver SetColorKey fn
  1196. */
  1197. typedef struct _DD_DRVSETCOLORKEYDATA
  1198. {
  1199. PDD_SURFACE_LOCAL lpDDSurface; // surface struct
  1200. DWORD dwFlags; // flags
  1201. DDCOLORKEY ckNew; // new color key
  1202. HRESULT ddRVal; // return value
  1203. VOID* SetColorKey; // Unused: Win95 compatibility
  1204. } DD_DRVSETCOLORKEYDATA;
  1205. /*
  1206. * structure for passing information to DDHAL GetScanLine fn
  1207. */
  1208. typedef struct _DD_GETSCANLINEDATA
  1209. {
  1210. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1211. DWORD dwScanLine; // returned scan line
  1212. HRESULT ddRVal; // return value
  1213. VOID* GetScanLine; // Unused: Win95 compatibility
  1214. } DD_GETSCANLINEDATA;
  1215. /*
  1216. * structure for passing information to DDHAL MapMemory fn
  1217. */
  1218. typedef struct _DD_MAPMEMORYDATA
  1219. {
  1220. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1221. BOOL bMap; // TRUE if map; FALSe if un-map
  1222. HANDLE hProcess; // process handle
  1223. FLATPTR fpProcess; // returned address in process' address space
  1224. HRESULT ddRVal; // return value
  1225. } DD_MAPMEMORYDATA;
  1226. /****************************************************************************
  1227. *
  1228. * DDHAL structures for VideoPort callbacks
  1229. *
  1230. ***************************************************************************/
  1231. /*
  1232. * structure for passing information to DDHAL CanCreateVideoPort fn
  1233. */
  1234. typedef struct _DD_CANCREATEVPORTDATA
  1235. {
  1236. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1237. LPDDVIDEOPORTDESC lpDDVideoPortDesc;
  1238. HRESULT ddRVal; // return value
  1239. VOID* CanCreateVideoPort; // Unused: Win95 compatibility
  1240. } DD_CANCREATEVPORTDATA;
  1241. /*
  1242. * structure for passing information to DDHAL CreateVideoPort fn
  1243. */
  1244. typedef struct _DD_CREATEVPORTDATA
  1245. {
  1246. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1247. LPDDVIDEOPORTDESC lpDDVideoPortDesc;
  1248. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port created
  1249. HRESULT ddRVal; // return value
  1250. VOID* CreateVideoPort; // Unused: Win95 compatibility
  1251. } DD_CREATEVPORTDATA;
  1252. /*
  1253. * structure for passing information to DDHAL FlipVideoPort fn
  1254. */
  1255. typedef struct _DD_FLIPVPORTDATA
  1256. {
  1257. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1258. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1259. PDD_SURFACE_LOCAL lpSurfCurr; // current surface
  1260. PDD_SURFACE_LOCAL lpSurfTarg; // target surface
  1261. HRESULT ddRVal; // return value
  1262. VOID* FlipVideoPort; // Unused: Win95 compatibility
  1263. } DD_FLIPVPORTDATA;
  1264. /*
  1265. * structure for passing information to DDHAL GetVideoPortBandwidth fn
  1266. */
  1267. typedef struct _DD_GETVPORTBANDWIDTHDATA
  1268. {
  1269. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1270. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1271. LPDDPIXELFORMAT lpddpfFormat; // Format for bandwidth
  1272. DWORD dwWidth;
  1273. DWORD dwHeight;
  1274. DWORD dwFlags; // Prescale factor for bandwidth
  1275. LPDDVIDEOPORTBANDWIDTH lpBandwidth; // Returned bandwidth parameters
  1276. HRESULT ddRVal; // return value
  1277. VOID* GetVideoPortBandwidth; // Unused: Win95 compatibility
  1278. } DD_GETVPORTBANDWIDTHDATA;
  1279. /*
  1280. * structure for passing information to DDHAL GetVideoPortInputFormats fn
  1281. */
  1282. typedef struct _DD_GETVPORTINPUTFORMATDATA
  1283. {
  1284. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1285. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1286. DWORD dwFlags; // VBI, regular, or both
  1287. LPDDPIXELFORMAT lpddpfFormat; // Array of formats
  1288. DWORD dwNumFormats; // # of formats in array
  1289. HRESULT ddRVal; // return value
  1290. VOID* GetVideoPortInputFormats; // Unused: Win95 compatibility
  1291. } DD_GETVPORTINPUTFORMATDATA;
  1292. /*
  1293. * structure for passing information to DDHAL GetVideoPortOutputFormats fn
  1294. */
  1295. typedef struct _DD_GETVPORTOUTPUTFORMATDATA
  1296. {
  1297. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1298. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1299. DWORD dwFlags; // VBI, regular, or both
  1300. LPDDPIXELFORMAT lpddpfInputFormat; // Input format
  1301. LPDDPIXELFORMAT lpddpfOutputFormats; // Array of output formats
  1302. DWORD dwNumFormats; // # of formats in array
  1303. HRESULT ddRVal; // return value
  1304. VOID* GetVideoPortInputFormats; // Unused: Win95 compatibility
  1305. } DD_GETVPORTOUTPUTFORMATDATA;
  1306. /*
  1307. * structure for passing information to DDHAL GetVideoPortField fn
  1308. */
  1309. typedef struct _DD_GETVPORTFIELDDATA
  1310. {
  1311. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1312. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1313. BOOL bField; // TRUE if even
  1314. HRESULT ddRVal; // return value
  1315. VOID* GetVideoPortField; // Unused: Win95 compatibility
  1316. } DD_GETVPORTFIELDDATA;
  1317. /*
  1318. * structure for passing information to DDHAL GetVideoPortLine fn
  1319. */
  1320. typedef struct _DD_GETVPORTLINEDATA
  1321. {
  1322. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1323. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1324. DWORD dwLine; // Current line counter
  1325. HRESULT ddRVal; // return value
  1326. VOID* GetVideoPortLine; // Unused: Win95 compatibility
  1327. } DD_GETVPORTLINEDATA;
  1328. /*
  1329. * structure for passing information to DDHAL GetVideoPortConnectInfo fn
  1330. */
  1331. typedef struct _DD_GETVPORTCONNECTDATA
  1332. {
  1333. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1334. DWORD dwPortId; // ID of desired video port
  1335. LPDDVIDEOPORTCONNECT lpConnect; // Array of DDVIDEOPORTCONNECT structures
  1336. DWORD dwNumEntries; // # of structures in array
  1337. HRESULT ddRVal; // return value
  1338. VOID* GetVideoPortConnectInfo; // Unused: Win95 compatibility
  1339. } DD_GETVPORTCONNECTDATA;
  1340. /*
  1341. * structure for passing information to DDHAL DestroyVideoPort fn
  1342. */
  1343. typedef struct _DD_DESTROYVPORTDATA
  1344. {
  1345. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1346. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1347. HRESULT ddRVal; // return value
  1348. VOID* DestroyVideoPort; // Unused: Win95 compatibility
  1349. } DD_DESTROYVPORTDATA;
  1350. /*
  1351. * structure for passing information to DDHAL GetVideoPortFlipStatus fn
  1352. */
  1353. typedef struct _DD_GETVPORTFLIPSTATUSDATA
  1354. {
  1355. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1356. FLATPTR fpSurface; // surface struct
  1357. HRESULT ddRVal; // return value
  1358. VOID* GetVideoPortFlipStatus; // Unused: Win95 compatibility
  1359. } DD_GETVPORTFLIPSTATUSDATA;
  1360. typedef DDVIDEOPORTINFO* PDD_VIDEOPORTINFO;
  1361. /*
  1362. * structure for passing information to DDHAL UpdateVideoPort fn
  1363. */
  1364. typedef struct _DD_UPDATEVPORTDATA
  1365. {
  1366. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1367. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1368. PDD_SURFACE_INT *lplpDDSurface; // surface struct
  1369. PDD_SURFACE_INT *lplpDDVBISurface; // VBI surface structure
  1370. PDD_VIDEOPORTINFO lpVideoInfo; // Video information
  1371. DWORD dwFlags; // DDRAWI_VPORTSTART, DDRAWI_VPORTSTOP, DDRAWI_VPORTUPDATE
  1372. DWORD dwNumAutoflip; // # of autoflip surfaces. If > 1, lpDDSurface is an array.
  1373. DWORD dwNumVBIAutoflip; // # of autoflip surfaces. If > 1, lpDDVBISurface is an array.
  1374. HRESULT ddRVal; // return value
  1375. VOID* UpdateVideoPort; // Unused: Win95 compatibility
  1376. } DD_UPDATEVPORTDATA;
  1377. #define DDRAWI_VPORTSTART 0x0001
  1378. #define DDRAWI_VPORTSTOP 0x0002
  1379. #define DDRAWI_VPORTUPDATE 0x0003
  1380. /*
  1381. * structure for passing information to DDHAL WaitForVideoPortSync fn
  1382. */
  1383. typedef struct _DD_WAITFORVPORTSYNCDATA
  1384. {
  1385. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1386. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1387. DWORD dwFlags; // DDVPEVENT_XXXX
  1388. DWORD dwLine;
  1389. DWORD dwTimeOut; // Max time to wait before returning
  1390. HRESULT ddRVal; // return value
  1391. VOID* UpdateVideoPort; // Unused: Win95 compatibility
  1392. } DD_WAITFORVPORTSYNCDATA;
  1393. /*
  1394. * structure for passing information to DDHAL GetVideoSignalStatus fn
  1395. */
  1396. typedef struct _DD_GETVPORTSIGNALDATA
  1397. {
  1398. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1399. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1400. DWORD dwStatus; // Video signal status
  1401. HRESULT ddRVal; // return value
  1402. VOID* GetVideoSignalStatus; // Unused: Win95 compatibility
  1403. } DD_GETVPORTSIGNALDATA;
  1404. /*
  1405. * structure for passing information to DDHAL GetVideoSignalStatus fn
  1406. */
  1407. typedef struct _DD_VPORTCOLORDATA
  1408. {
  1409. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1410. PDD_VIDEOPORT_LOCAL lpVideoPort; // Video port object
  1411. DWORD dwFlags; // Video signal status
  1412. LPDDCOLORCONTROL lpColorData;
  1413. HRESULT ddRVal; // return value
  1414. VOID* ColorControl; // Unused: Win95 compatibility
  1415. } DD_VPORTCOLORDATA;
  1416. #define DDRAWI_VPORTGETCOLOR 0x0001
  1417. #define DDRAWI_VPORTSETCOLOR 0x0002
  1418. /****************************************************************************
  1419. *
  1420. * DDHAL structures for Color Control callbacks
  1421. *
  1422. ***************************************************************************/
  1423. /*
  1424. * structure for passing information to DDHAL ColorControl fn
  1425. */
  1426. typedef struct _DD_COLORCONTROLDATA
  1427. {
  1428. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1429. PDD_SURFACE_LOCAL lpDDSurface; // surface
  1430. LPDDCOLORCONTROL lpColorData; // color control information
  1431. DWORD dwFlags; // DDRAWI_GETCOLOR/DDRAWI_SETCOLOR
  1432. HRESULT ddRVal; // return value
  1433. VOID* ColorControl; // Unused: Win95 compatibility
  1434. } DD_COLORCONTROLDATA;
  1435. #define DDRAWI_GETCOLOR 0x0001
  1436. #define DDRAWI_SETCOLOR 0x0002
  1437. /****************************************************************************
  1438. *
  1439. * DDHAL structure for GetDriverData callback
  1440. *
  1441. ***************************************************************************/
  1442. typedef struct _DD_GETDRIVERINFODATA {
  1443. // Input fields filled in by DirectDraw
  1444. VOID* dhpdev; // Driver context
  1445. DWORD dwSize; // Size of this structure
  1446. DWORD dwFlags; // Flags
  1447. GUID guidInfo; // GUID that DirectX is querying for
  1448. DWORD dwExpectedSize; // Size of callbacks structure expected by DirectDraw.
  1449. PVOID lpvData; // Buffer that will receive the requested data
  1450. // Output fields filled in by driver
  1451. DWORD dwActualSize; // Size of callbacks structure expected by driver
  1452. HRESULT ddRVal; // Return value from driver
  1453. } DD_GETDRIVERINFODATA;
  1454. /****************************************************************************
  1455. *
  1456. * DDHAL structure for misc. driver callbacks
  1457. *
  1458. ***************************************************************************/
  1459. /*
  1460. * structure for passing information to DDHAL GetAvailDriverMemory fn
  1461. */
  1462. typedef struct _DD_GETAVAILDRIVERMEMORYDATA
  1463. {
  1464. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1465. DDSCAPS DDSCaps; // caps for type of surface memory
  1466. DWORD dwTotal; // total memory for this kind of surface
  1467. DWORD dwFree; // free memory for this kind of surface
  1468. HRESULT ddRVal; // return value
  1469. VOID* GetAvailDriverMemory; // Unused: Win95 compatibility
  1470. } DD_GETAVAILDRIVERMEMORYDATA;
  1471. /****************************************************************************
  1472. *
  1473. * DDHAL structures for NT callbacks
  1474. *
  1475. ***************************************************************************/
  1476. /*
  1477. * structure for passing information to DDHAL FreeDriverMemory fn
  1478. */
  1479. typedef struct _DD_FREEDRIVERMEMORYDATA
  1480. {
  1481. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1482. PDD_SURFACE_LOCAL lpDDSurface; // surface object trying to be created
  1483. HRESULT ddRVal; // return value
  1484. VOID* FreeDriverMemory;// Unused: Win95 compatibility
  1485. } DD_FREEDRIVERMEMORYDATA;
  1486. /*
  1487. * structure for passing information to DDHAL SetExclusiveMode fn
  1488. */
  1489. typedef struct _DD_SETEXCLUSIVEMODEDATA
  1490. {
  1491. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1492. DWORD dwEnterExcl; // TRUE if entering exclusive mode, FALSE is leaving
  1493. DWORD dwReserved; // reserved for future use
  1494. HRESULT ddRVal; // return value
  1495. VOID* SetExclusiveMode; // Unused: Win95 compatibility
  1496. } DD_SETEXCLUSIVEMODEDATA;
  1497. /*
  1498. * structure for passing information to DDHAL FlipToGDISurface fn
  1499. */
  1500. typedef struct _DD_FLIPTOGDISURFACEDATA
  1501. {
  1502. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1503. DWORD dwToGDI; // TRUE if flipping to the GDI surface, FALSE if flipping away
  1504. DWORD dwReserved; // reserved for future use
  1505. HRESULT ddRVal; // return value
  1506. VOID* FlipToGDISurface; // Unused: Win95 compatibility
  1507. } DD_FLIPTOGDISURFACEDATA;
  1508. /****************************************************************************
  1509. *
  1510. * DDHAL structure for kernel callbacks
  1511. *
  1512. ***************************************************************************/
  1513. /*
  1514. * structure for passing information to DDHAL SyncSurfaceData fn
  1515. */
  1516. typedef struct _DD_SYNCSURFACEDATA
  1517. {
  1518. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1519. PDD_SURFACE_LOCAL lpDDSurface; // Surface to sync with
  1520. DWORD dwSurfaceOffset; // Offset in frame buffer of surface
  1521. ULONG_PTR fpLockPtr; // Surface lock ptr
  1522. LONG lPitch; // Surface pitch
  1523. DWORD dwOverlayOffset; // Added to dwSurfaceOffset for origin, clipping, etc.
  1524. ULONG dwDriverReserved1; // Reserved for the HAL
  1525. ULONG dwDriverReserved2; // Reserved for the HAL
  1526. ULONG dwDriverReserved3; // Reserved for the HAL
  1527. ULONG dwDriverReserved4; // Reserved for the HAL
  1528. HRESULT ddRVal;
  1529. } DD_SYNCSURFACEDATA;
  1530. /*
  1531. * structure for passing information to DDHAL SyncVideoPortData fn
  1532. */
  1533. typedef struct _DD_SYNCVIDEOPORTDATA
  1534. {
  1535. PDD_DIRECTDRAW_LOCAL lpDD; // driver struct
  1536. PDD_VIDEOPORT_LOCAL lpVideoPort;// Video port object
  1537. DWORD dwOriginOffset; // Start address relative to surface
  1538. DWORD dwHeight; // Height of total video region (per field)
  1539. DWORD dwVBIHeight; // Height of VBI region (per field)
  1540. ULONG dwDriverReserved1; // Reserved for the HAL
  1541. ULONG dwDriverReserved2; // Reserved for the HAL
  1542. ULONG dwDriverReserved3; // Reserved for the HAL
  1543. HRESULT ddRVal;
  1544. } DD_SYNCVIDEOPORTDATA;
  1545. /****************************************************************************
  1546. *
  1547. * DDHAL structure for motion comp callbacks
  1548. *
  1549. ***************************************************************************/
  1550. /*
  1551. * structure for passing information to DDHAL GetMoCompGuids
  1552. */
  1553. typedef struct _DD_GETMOCOMPGUIDSDATA
  1554. {
  1555. PDD_DIRECTDRAW_LOCAL lpDD;
  1556. DWORD dwNumGuids;
  1557. GUID* lpGuids;
  1558. HRESULT ddRVal;
  1559. } DD_GETMOCOMPGUIDSDATA;
  1560. /*
  1561. * structure for passing information to DDHAL GetMoCompFormats
  1562. */
  1563. typedef struct _DD_GETMOCOMPFORMATSDATA
  1564. {
  1565. PDD_DIRECTDRAW_LOCAL lpDD;
  1566. GUID* lpGuid;
  1567. DWORD dwNumFormats;
  1568. LPDDPIXELFORMAT lpFormats;
  1569. HRESULT ddRVal;
  1570. } DD_GETMOCOMPFORMATSDATA;
  1571. /*
  1572. * structure for passing information to DDHAL CreateMoComp
  1573. */
  1574. typedef struct _DD_CREATEMOCOMPDATA
  1575. {
  1576. PDD_DIRECTDRAW_LOCAL lpDD;
  1577. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1578. GUID* lpGuid;
  1579. DWORD dwUncompWidth;
  1580. DWORD dwUncompHeight;
  1581. DDPIXELFORMAT ddUncompPixelFormat;
  1582. LPVOID lpData;
  1583. DWORD dwDataSize;
  1584. HRESULT ddRVal;
  1585. } DD_CREATEMOCOMPDATA;
  1586. /*
  1587. * structure for passing information to DDHAL GetMoCompBuffInfo
  1588. */
  1589. typedef struct _DDCOMPBUFFERINFO
  1590. {
  1591. DWORD dwSize; // [in] size of the struct
  1592. DWORD dwNumCompBuffers; // [out] number of buffers required for compressed data
  1593. DWORD dwWidthToCreate; // [out] Width of surface to create
  1594. DWORD dwHeightToCreate; // [out] Height of surface to create
  1595. DWORD dwBytesToAllocate; // [out] Total number of bytes used by each surface
  1596. DDSCAPS2 ddCompCaps; // [out] caps to create surfaces to store compressed data
  1597. DDPIXELFORMAT ddPixelFormat; // [out] format to create surfaces to store compressed data
  1598. } DDCOMPBUFFERINFO, *LPDDCOMPBUFFERINFO;
  1599. typedef struct _DD_GETMOCOMPCOMPBUFFDATA
  1600. {
  1601. PDD_DIRECTDRAW_LOCAL lpDD;
  1602. GUID* lpGuid;
  1603. DWORD dwWidth; // [in] width of uncompressed data
  1604. DWORD dwHeight; // [in] height of uncompressed data
  1605. DDPIXELFORMAT ddPixelFormat; // [in] pixel-format of uncompressed data
  1606. DWORD dwNumTypesCompBuffs;// [in/out] number of memory types required for comp buffers
  1607. LPDDCOMPBUFFERINFO lpCompBuffInfo; // [in] driver supplied info regarding comp buffers (allocated by client)
  1608. HRESULT ddRVal; // [out]
  1609. } DD_GETMOCOMPCOMPBUFFDATA;
  1610. /*
  1611. * structure for passing information to DDHAL GetMoCompBuffInfo
  1612. */
  1613. typedef struct _DD_GETINTERNALMOCOMPDATA
  1614. {
  1615. PDD_DIRECTDRAW_LOCAL lpDD;
  1616. GUID* lpGuid;
  1617. DWORD dwWidth; // [in] width of uncompressed data
  1618. DWORD dwHeight; // [in] height of uncompressed data
  1619. DDPIXELFORMAT ddPixelFormat; // [in] pixel-format of uncompressed data
  1620. DWORD dwScratchMemAlloc; // [out] amount of scratch memory will the hal allocate for its private use
  1621. HRESULT ddRVal; // [out]
  1622. } DD_GETINTERNALMOCOMPDATA;
  1623. /*
  1624. * structure for passing information to DDHAL BeginMoCompFrame
  1625. */
  1626. typedef struct _DD_BEGINMOCOMPFRAMEDATA
  1627. {
  1628. PDD_DIRECTDRAW_LOCAL lpDD;
  1629. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1630. PDD_SURFACE_LOCAL lpDestSurface; // [in] destination buffer in which to decoding this frame
  1631. DWORD dwInputDataSize; // [in] size of other misc input data to begin frame
  1632. LPVOID lpInputData; // [in] pointer to misc input data
  1633. DWORD dwOutputDataSize; // [in] size of other misc output data to begin frame
  1634. LPVOID lpOutputData; // [in] pointer to output misc data (allocated by client)
  1635. HRESULT ddRVal; // [out]
  1636. } DD_BEGINMOCOMPFRAMEDATA;
  1637. /*
  1638. * structure for passing information to DDHAL EndMoCompFrame
  1639. */
  1640. typedef struct _DD_ENDMOCOMPFRAMEDATA
  1641. {
  1642. PDD_DIRECTDRAW_LOCAL lpDD;
  1643. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1644. LPVOID lpInputData;
  1645. DWORD dwInputDataSize;
  1646. HRESULT ddRVal;
  1647. } DD_ENDMOCOMPFRAMEDATA;
  1648. /*
  1649. * structure for passing information to DDHAL RenderMoComp
  1650. */
  1651. typedef struct _DDMOCOMPBUFFERINFO
  1652. {
  1653. DWORD dwSize; // [in] size of the struct
  1654. PDD_SURFACE_LOCAL lpCompSurface; // [in] pointer to buffer containing compressed data
  1655. DWORD dwDataOffset; // [in] offset of relevant data from the beginning of buffer
  1656. DWORD dwDataSize; // [in] size of relevant data
  1657. LPVOID lpPrivate; // Reserved by DirectDraw
  1658. } DDMOCOMPBUFFERINFO, *LPDDMOCOMPBUFFERINFO;
  1659. typedef struct _DD_RENDERMOCOMPDATA
  1660. {
  1661. PDD_DIRECTDRAW_LOCAL lpDD;
  1662. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1663. DWORD dwNumBuffers; // [in] Number of entries in the lpMacroBlockInfo array
  1664. LPDDMOCOMPBUFFERINFO lpBufferInfo; // [in] Surfaces containing macro block info
  1665. DWORD dwFunction; // [in] Function
  1666. LPVOID lpInputData;
  1667. DWORD dwInputDataSize;
  1668. LPVOID lpOutputData;
  1669. DWORD dwOutputDataSize;
  1670. HRESULT ddRVal; // [out]
  1671. } DD_RENDERMOCOMPDATA;
  1672. /*
  1673. * structure for passing information to DDHAL QueryMoCompStatus
  1674. */
  1675. typedef struct _DD_QUERYMOCOMPSTATUSDATA
  1676. {
  1677. PDD_DIRECTDRAW_LOCAL lpDD;
  1678. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1679. PDD_SURFACE_LOCAL lpSurface; // [in] Surface being queried
  1680. DWORD dwFlags; // [in] DDMCQUERY_XXX flags
  1681. HRESULT ddRVal; // [out]
  1682. } DD_QUERYMOCOMPSTATUSDATA;
  1683. #define DDMCQUERY_READ 0x00000001
  1684. /*
  1685. * structure for passing information to DDHAL DestroyVideo
  1686. */
  1687. typedef struct _DD_DESTROYMOCOMPDATA
  1688. {
  1689. PDD_DIRECTDRAW_LOCAL lpDD;
  1690. PDD_MOTIONCOMP_LOCAL lpMoComp;
  1691. HRESULT ddRVal;
  1692. } DD_DESTROYMOCOMPDATA;
  1693. /****************************************************************************
  1694. *
  1695. * DDHAL structures for Miscellaneous2 callbacks
  1696. *
  1697. ***************************************************************************/
  1698. // This DDI is called by the kernel only.
  1699. typedef struct _DD_CREATESURFACEEXDATA
  1700. {
  1701. DWORD dwFlags;
  1702. PDD_DIRECTDRAW_LOCAL lpDDLcl; // driver struct
  1703. PDD_SURFACE_LOCAL lpDDSLcl; // created surface
  1704. // objects
  1705. HRESULT ddRVal; // return value
  1706. } DD_CREATESURFACEEXDATA;
  1707. // This DDI is used by both ddraw and d3d to obtain information from
  1708. // the driver.
  1709. typedef struct _DD_GETDRIVERSTATEDATA
  1710. {
  1711. DWORD dwFlags; // Flags to indicate the data
  1712. // required
  1713. union
  1714. {
  1715. PDD_DIRECTDRAW_GLOBAL lpDD; // driver struct
  1716. DWORD_PTR dwhContext; // d3d context
  1717. };
  1718. LPDWORD lpdwStates; // ptr to the state data
  1719. // to be filled in by the
  1720. // driver
  1721. DWORD dwLength;
  1722. HRESULT ddRVal; // return value
  1723. } DD_GETDRIVERSTATEDATA;
  1724. typedef struct _DD_DESTROYDDLOCALDATA
  1725. {
  1726. DWORD dwFlags;
  1727. PDD_DIRECTDRAW_LOCAL pDDLcl;
  1728. HRESULT ddRVal;
  1729. } DD_DESTROYDDLOCALDATA;
  1730. #ifdef __cplusplus
  1731. };
  1732. #endif
  1733. #endif // GUID_DEFS_ONLY
  1734. #endif