Source code of Windows XP (NT5)
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.

840 lines
35 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: vtable.cpp
  6. * Content: declaration of vtables for the various interfaces
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 24-feb-97 ralphl initial implementation
  11. * 25-feb-97 craige minor tweaks for dx checkin
  12. * 06-mar-97 craige IDirectDrawSurface3 support
  13. * 14-mar-97 jeffort SetBits changed to reflect DX5 as SetSurfaceDesc
  14. * 01-apr-97 jeffort Following changes checked in:
  15. * Aggregation of Add/GetAttachedSurface
  16. * Aggregation of Flip/Blt
  17. * 28-apr-97 jeffort Palette wrapping added/DX5 support
  18. *
  19. * 02-may-97 jeffort GetDDInterface wrapping added
  20. * 06-may-97 jeffort DeleteAttachedSurface wrapping added
  21. * 07-jul-97 jeffort GetSurfaceDesc wrapping added
  22. ***************************************************************************/
  23. #define CINTERFACE
  24. #include "ddfactry.h"
  25. #define FORWARD0(Interface, Name) \
  26. STDMETHODIMP Interface##Name(Interface *pIntStruc) \
  27. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  28. return pReal->lpVtbl->Name(pReal); }
  29. #define FORWARD1(Interface, Name, p1) \
  30. STDMETHODIMP Interface##Name(Interface *pIntStruc, p1 a) \
  31. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  32. return pReal->lpVtbl->Name(pReal, a); }
  33. #define FORWARD2(Interface, Name, p1, p2) \
  34. STDMETHODIMP Interface##Name(Interface *pIntStruc, p1 a, p2 b) \
  35. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  36. return pReal->lpVtbl->Name(pReal, a, b); }
  37. #define FORWARD3(Interface, Name, p1, p2, p3) \
  38. STDMETHODIMP Interface##Name(Interface *pIntStruc, p1 a, p2 b, p3 c) \
  39. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  40. return pReal->lpVtbl->Name(pReal, a, b, c); }
  41. #define FORWARD4(Interface, Name, p1, p2, p3, p4) \
  42. STDMETHODIMP Interface##Name(Interface *pIntStruc, p1 a, p2 b, p3 c, p4 d) \
  43. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  44. return pReal->lpVtbl->Name(pReal, a, b, c, d); }
  45. #define FORWARD5(Interface, Name, p1, p2, p3, p4, p5) \
  46. STDMETHODIMP Interface##Name(Interface *pIntStruc, p1 a, p2 b, p3 c, p4 d, p5 e) \
  47. { Interface * pReal = ((INTSTRUC_##Interface *)pIntStruc)->m_pRealInterface; \
  48. return pReal->lpVtbl->Name(pReal, a, b, c, d, e); }
  49. #define __QI(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  50. _inline CDirectDrawEx * PARENTOF(IDirectDraw * pDD)
  51. {
  52. return ((INTSTRUC_IDirectDraw *)pDD)->m_pDirectDrawEx;
  53. }
  54. _inline CDirectDrawEx * PARENTOF(IDirectDraw2 * pDD2)
  55. {
  56. return ((INTSTRUC_IDirectDraw2 *)pDD2)->m_pDirectDrawEx;
  57. }
  58. _inline CDirectDrawEx * PARENTOF(IDirectDraw4 * pDD4)
  59. {
  60. return ((INTSTRUC_IDirectDraw4 *)pDD4)->m_pDirectDrawEx;
  61. }
  62. _inline CDDSurface * SURFACEOF(IDirectDrawSurface * pDDS)
  63. {
  64. return ((INTSTRUC_IDirectDrawSurface *)pDDS)->m_pSimpleSurface;
  65. }
  66. _inline CDDSurface * SURFACEOF(IDirectDrawSurface2 * pDDS2)
  67. {
  68. return ((INTSTRUC_IDirectDrawSurface2 *)pDDS2)->m_pSimpleSurface;
  69. }
  70. _inline CDDSurface * SURFACEOF(IDirectDrawSurface3 * pDDS3)
  71. {
  72. return ((INTSTRUC_IDirectDrawSurface3 *)pDDS3)->m_pSimpleSurface;
  73. }
  74. _inline CDDSurface * SURFACEOF(IDirectDrawSurface4 * pDDS4)
  75. {
  76. return ((INTSTRUC_IDirectDrawSurface4 *)pDDS4)->m_pSimpleSurface;
  77. }
  78. _inline CDDPalette * PALETTEOF(IDirectDrawPalette * pDDP)
  79. {
  80. return ((INTSTRUC_IDirectDrawPalette *)pDDP)->m_pSimplePalette;
  81. }
  82. /*
  83. * IDirectDraw
  84. */
  85. STDMETHODIMP IDirectDrawAggQueryInterface(IDirectDraw *pDD, REFIID riid, void ** ppv)
  86. {
  87. return __QI(PARENTOF(pDD)->m_pUnkOuter, riid, ppv);
  88. }
  89. STDMETHODIMP_(ULONG) IDirectDrawAggAddRef(IDirectDraw *);
  90. STDMETHODIMP_(ULONG) IDirectDrawAggRelease(IDirectDraw *);
  91. STDMETHODIMP IDirectDrawAggCreateSurface(IDirectDraw *, LPDDSURFACEDESC pSurfaceDesc,
  92. IDirectDrawSurface **ppNewSurface, IUnknown *pUnkOuter);
  93. STDMETHODIMP IDirectDrawAggCreatePalette(IDirectDraw *,DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR *, IUnknown FAR *);
  94. STDMETHODIMP IDirectDrawAggSetCooperativeLevel(IDirectDraw *, HWND, DWORD);
  95. FORWARD0(IDirectDraw, Compact)
  96. FORWARD3(IDirectDraw, CreateClipper, DWORD, LPDIRECTDRAWCLIPPER FAR *, IUnknown *)
  97. FORWARD2(IDirectDraw, DuplicateSurface, LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR *)
  98. FORWARD4(IDirectDraw, EnumDisplayModes, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK)
  99. FORWARD4(IDirectDraw, EnumSurfaces, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMSURFACESCALLBACK)
  100. FORWARD0(IDirectDraw, FlipToGDISurface)
  101. FORWARD2(IDirectDraw, GetCaps, LPDDCAPS, LPDDCAPS)
  102. FORWARD1(IDirectDraw, GetDisplayMode, LPDDSURFACEDESC)
  103. FORWARD2(IDirectDraw, GetFourCCCodes, LPDWORD, LPDWORD)
  104. FORWARD1(IDirectDraw, GetGDISurface, LPDIRECTDRAWSURFACE FAR *)
  105. FORWARD1(IDirectDraw, GetMonitorFrequency, LPDWORD)
  106. FORWARD1(IDirectDraw, GetScanLine, LPDWORD)
  107. FORWARD1(IDirectDraw, Initialize, GUID *)
  108. FORWARD1(IDirectDraw, GetVerticalBlankStatus, LPBOOL)
  109. FORWARD0(IDirectDraw, RestoreDisplayMode)
  110. FORWARD2(IDirectDraw, WaitForVerticalBlank, DWORD, HANDLE)
  111. FORWARD3(IDirectDraw, SetDisplayMode, DWORD, DWORD, DWORD)
  112. IDirectDrawVtbl g_DirectDrawVtbl =
  113. {
  114. IDirectDrawAggQueryInterface,
  115. IDirectDrawAggAddRef,
  116. IDirectDrawAggRelease,
  117. IDirectDrawCompact,
  118. IDirectDrawCreateClipper,
  119. IDirectDrawAggCreatePalette,
  120. IDirectDrawAggCreateSurface,
  121. IDirectDrawDuplicateSurface,
  122. IDirectDrawEnumDisplayModes,
  123. IDirectDrawEnumSurfaces,
  124. IDirectDrawFlipToGDISurface,
  125. IDirectDrawGetCaps,
  126. IDirectDrawGetDisplayMode,
  127. IDirectDrawGetFourCCCodes,
  128. IDirectDrawGetGDISurface,
  129. IDirectDrawGetMonitorFrequency,
  130. IDirectDrawGetScanLine,
  131. IDirectDrawGetVerticalBlankStatus,
  132. IDirectDrawInitialize,
  133. IDirectDrawRestoreDisplayMode,
  134. IDirectDrawAggSetCooperativeLevel,
  135. IDirectDrawSetDisplayMode,
  136. IDirectDrawWaitForVerticalBlank
  137. };
  138. /*
  139. * IDirectDraw2
  140. */
  141. STDMETHODIMP IDirectDraw2AggQueryInterface(IDirectDraw2 *pDD, REFIID riid, void ** ppv)
  142. {
  143. return __QI(PARENTOF(pDD)->m_pUnkOuter, riid, ppv);
  144. }
  145. STDMETHODIMP_(ULONG) IDirectDraw2AggAddRef(IDirectDraw2 *);
  146. STDMETHODIMP_(ULONG) IDirectDraw2AggRelease(IDirectDraw2 *);
  147. STDMETHODIMP IDirectDraw2AggCreateSurface(IDirectDraw2 *, LPDDSURFACEDESC pSurfaceDesc,
  148. IDirectDrawSurface **ppNewSurface, IUnknown *pUnkOuter);
  149. STDMETHODIMP IDirectDraw2AggCreatePalette(IDirectDraw2 *,DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR *, IUnknown FAR *);
  150. STDMETHODIMP IDirectDraw2AggSetCooperativeLevel(IDirectDraw2 *, HWND, DWORD);
  151. FORWARD0(IDirectDraw2, Compact)
  152. FORWARD3(IDirectDraw2, CreateClipper, DWORD, LPDIRECTDRAWCLIPPER FAR *, IUnknown *)
  153. FORWARD2(IDirectDraw2, DuplicateSurface, LPDIRECTDRAWSURFACE, LPDIRECTDRAWSURFACE FAR *)
  154. FORWARD4(IDirectDraw2, EnumDisplayModes, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMMODESCALLBACK)
  155. FORWARD4(IDirectDraw2, EnumSurfaces, DWORD, LPDDSURFACEDESC, LPVOID, LPDDENUMSURFACESCALLBACK)
  156. FORWARD0(IDirectDraw2, FlipToGDISurface)
  157. FORWARD2(IDirectDraw2, GetCaps, LPDDCAPS, LPDDCAPS)
  158. FORWARD1(IDirectDraw2, GetDisplayMode, LPDDSURFACEDESC)
  159. FORWARD2(IDirectDraw2, GetFourCCCodes, LPDWORD, LPDWORD)
  160. FORWARD1(IDirectDraw2, GetGDISurface, LPDIRECTDRAWSURFACE FAR *)
  161. FORWARD1(IDirectDraw2, GetMonitorFrequency, LPDWORD)
  162. FORWARD1(IDirectDraw2, GetScanLine, LPDWORD)
  163. FORWARD1(IDirectDraw2, Initialize, GUID *)
  164. FORWARD1(IDirectDraw2, GetVerticalBlankStatus, LPBOOL)
  165. FORWARD0(IDirectDraw2, RestoreDisplayMode)
  166. FORWARD2(IDirectDraw2, WaitForVerticalBlank, DWORD, HANDLE)
  167. FORWARD3(IDirectDraw2, GetAvailableVidMem, LPDDSCAPS, LPDWORD, LPDWORD)
  168. FORWARD5(IDirectDraw2, SetDisplayMode, DWORD, DWORD, DWORD, DWORD, DWORD)
  169. IDirectDraw2Vtbl g_DirectDraw2Vtbl =
  170. {
  171. IDirectDraw2AggQueryInterface,
  172. IDirectDraw2AggAddRef,
  173. IDirectDraw2AggRelease,
  174. IDirectDraw2Compact,
  175. IDirectDraw2CreateClipper,
  176. IDirectDraw2AggCreatePalette,
  177. IDirectDraw2AggCreateSurface,
  178. IDirectDraw2DuplicateSurface,
  179. IDirectDraw2EnumDisplayModes,
  180. IDirectDraw2EnumSurfaces,
  181. IDirectDraw2FlipToGDISurface,
  182. IDirectDraw2GetCaps,
  183. IDirectDraw2GetDisplayMode,
  184. IDirectDraw2GetFourCCCodes,
  185. IDirectDraw2GetGDISurface,
  186. IDirectDraw2GetMonitorFrequency,
  187. IDirectDraw2GetScanLine,
  188. IDirectDraw2GetVerticalBlankStatus,
  189. IDirectDraw2Initialize,
  190. IDirectDraw2RestoreDisplayMode,
  191. IDirectDraw2AggSetCooperativeLevel,
  192. IDirectDraw2SetDisplayMode,
  193. IDirectDraw2WaitForVerticalBlank,
  194. IDirectDraw2GetAvailableVidMem
  195. };
  196. STDMETHODIMP IDirectDraw4AggQueryInterface(IDirectDraw4 *pDD, REFIID riid, void ** ppv)
  197. {
  198. return __QI(PARENTOF(pDD)->m_pUnkOuter, riid, ppv);
  199. }
  200. STDMETHODIMP_(ULONG) IDirectDraw4AggAddRef(IDirectDraw4 *);
  201. STDMETHODIMP_(ULONG) IDirectDraw4AggRelease(IDirectDraw4 *);
  202. STDMETHODIMP IDirectDraw4AggCreateSurface(IDirectDraw4 *, LPDDSURFACEDESC2 pSurfaceDesc2,
  203. IDirectDrawSurface4 **ppNewSurface, IUnknown *pUnkOuter);
  204. STDMETHODIMP IDirectDraw4AggCreatePalette(IDirectDraw4 *,DWORD, LPPALETTEENTRY, LPDIRECTDRAWPALETTE FAR *, IUnknown FAR *);
  205. STDMETHODIMP IDirectDraw4AggSetCooperativeLevel(IDirectDraw4 *, HWND, DWORD);
  206. FORWARD0(IDirectDraw4, Compact)
  207. FORWARD3(IDirectDraw4, CreateClipper, DWORD, LPDIRECTDRAWCLIPPER FAR *, IUnknown *)
  208. FORWARD2(IDirectDraw4, DuplicateSurface, LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4 FAR *)
  209. FORWARD4(IDirectDraw4, EnumDisplayModes, DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMMODESCALLBACK2)
  210. FORWARD4(IDirectDraw4, EnumSurfaces, DWORD, LPDDSURFACEDESC2, LPVOID, LPDDENUMSURFACESCALLBACK2)
  211. FORWARD0(IDirectDraw4, FlipToGDISurface)
  212. FORWARD2(IDirectDraw4, GetCaps, LPDDCAPS, LPDDCAPS)
  213. FORWARD1(IDirectDraw4, GetDisplayMode, LPDDSURFACEDESC2)
  214. FORWARD2(IDirectDraw4, GetFourCCCodes, LPDWORD, LPDWORD)
  215. FORWARD1(IDirectDraw4, GetGDISurface, LPDIRECTDRAWSURFACE4 FAR *)
  216. FORWARD1(IDirectDraw4, GetMonitorFrequency, LPDWORD)
  217. FORWARD1(IDirectDraw4, GetScanLine, LPDWORD)
  218. FORWARD1(IDirectDraw4, Initialize, GUID *)
  219. FORWARD1(IDirectDraw4, GetVerticalBlankStatus, LPBOOL)
  220. FORWARD0(IDirectDraw4, RestoreDisplayMode)
  221. FORWARD2(IDirectDraw4, WaitForVerticalBlank, DWORD, HANDLE)
  222. FORWARD3(IDirectDraw4, GetAvailableVidMem, LPDDSCAPS2, LPDWORD, LPDWORD)
  223. FORWARD5(IDirectDraw4, SetDisplayMode, DWORD, DWORD, DWORD, DWORD, DWORD)
  224. FORWARD2(IDirectDraw4, GetSurfaceFromDC, HDC, LPDIRECTDRAWSURFACE4 *)
  225. FORWARD0(IDirectDraw4, RestoreAllSurfaces)
  226. FORWARD0(IDirectDraw4, TestCooperativeLevel)
  227. IDirectDraw4Vtbl g_DirectDraw4Vtbl =
  228. {
  229. IDirectDraw4AggQueryInterface,
  230. IDirectDraw4AggAddRef,
  231. IDirectDraw4AggRelease,
  232. IDirectDraw4Compact,
  233. IDirectDraw4CreateClipper,
  234. IDirectDraw4AggCreatePalette,
  235. IDirectDraw4AggCreateSurface,
  236. IDirectDraw4DuplicateSurface,
  237. IDirectDraw4EnumDisplayModes,
  238. IDirectDraw4EnumSurfaces,
  239. IDirectDraw4FlipToGDISurface,
  240. IDirectDraw4GetCaps,
  241. IDirectDraw4GetDisplayMode,
  242. IDirectDraw4GetFourCCCodes,
  243. IDirectDraw4GetGDISurface,
  244. IDirectDraw4GetMonitorFrequency,
  245. IDirectDraw4GetScanLine,
  246. IDirectDraw4GetVerticalBlankStatus,
  247. IDirectDraw4Initialize,
  248. IDirectDraw4RestoreDisplayMode,
  249. IDirectDraw4AggSetCooperativeLevel,
  250. IDirectDraw4SetDisplayMode,
  251. IDirectDraw4WaitForVerticalBlank,
  252. IDirectDraw4GetAvailableVidMem,
  253. IDirectDraw4GetSurfaceFromDC,
  254. IDirectDraw4RestoreAllSurfaces,
  255. IDirectDraw4TestCooperativeLevel
  256. };
  257. /*
  258. * IDirectDrawSurface
  259. */
  260. STDMETHODIMP IDirectDrawSurfaceAggQueryInterface(IDirectDrawSurface *pDDS, REFIID riid, void ** ppv)
  261. {
  262. return __QI(SURFACEOF(pDDS)->m_pUnkOuter, riid, ppv);
  263. }
  264. STDMETHODIMP_(ULONG) IDirectDrawSurfaceAggAddRef(IDirectDrawSurface *);
  265. STDMETHODIMP_(ULONG) IDirectDrawSurfaceAggRelease(IDirectDrawSurface *);
  266. STDMETHODIMP IDirectDrawSurfaceAggGetDC(IDirectDrawSurface *, HDC *);
  267. STDMETHODIMP IDirectDrawSurfaceAggReleaseDC(IDirectDrawSurface *, HDC);
  268. STDMETHODIMP IDirectDrawSurfaceAggLock(IDirectDrawSurface *, LPRECT,LPDDSURFACEDESC,DWORD,HANDLE);
  269. STDMETHODIMP IDirectDrawSurfaceAggUnlock(IDirectDrawSurface *, LPVOID);
  270. STDMETHODIMP IDirectDrawSurfaceAggSetSurfaceDesc(IDirectDrawSurface *, LPVOID);
  271. STDMETHODIMP IDirectDrawSurfaceAggGetAttachedSurface( IDirectDrawSurface *, LPDDSCAPS, LPDIRECTDRAWSURFACE FAR *);
  272. STDMETHODIMP IDirectDrawSurfaceAggAddAttachedSurface( IDirectDrawSurface *, LPDIRECTDRAWSURFACE);
  273. STDMETHODIMP IDirectDrawSurfaceAggDeleteAttachedSurface( IDirectDrawSurface *,DWORD, LPDIRECTDRAWSURFACE);
  274. STDMETHODIMP IDirectDrawSurfaceAggFlip(IDirectDrawSurface *, LPDIRECTDRAWSURFACE, DWORD);
  275. STDMETHODIMP IDirectDrawSurfaceAggBlt(IDirectDrawSurface *,LPRECT,LPDIRECTDRAWSURFACE, LPRECT,DWORD, LPDDBLTFX);
  276. STDMETHODIMP IDirectDrawSurfaceAggGetPalette(IDirectDrawSurface *, LPDIRECTDRAWPALETTE FAR *);
  277. STDMETHODIMP IDirectDrawSurfaceAggSetPalette(IDirectDrawSurface *, LPDIRECTDRAWPALETTE);
  278. STDMETHODIMP IDirectDrawSurfaceAggGetSurfaceDesc(IDirectDrawSurface *, LPDDSURFACEDESC);
  279. /*** IDirectDrawSurface methods ***/
  280. FORWARD1(IDirectDrawSurface, AddOverlayDirtyRect, LPRECT)
  281. FORWARD3(IDirectDrawSurface, BltBatch, LPDDBLTBATCH, DWORD, DWORD )
  282. FORWARD5(IDirectDrawSurface, BltFast, DWORD,DWORD,LPDIRECTDRAWSURFACE, LPRECT,DWORD)
  283. FORWARD2(IDirectDrawSurface, EnumAttachedSurfaces, LPVOID,LPDDENUMSURFACESCALLBACK)
  284. FORWARD3(IDirectDrawSurface, EnumOverlayZOrders, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
  285. FORWARD1(IDirectDrawSurface, GetBltStatus, DWORD)
  286. FORWARD1(IDirectDrawSurface, GetCaps, LPDDSCAPS)
  287. FORWARD1(IDirectDrawSurface, GetClipper, LPDIRECTDRAWCLIPPER FAR*)
  288. FORWARD2(IDirectDrawSurface, GetColorKey, DWORD, LPDDCOLORKEY)
  289. FORWARD1(IDirectDrawSurface, GetFlipStatus, DWORD)
  290. FORWARD2(IDirectDrawSurface, GetOverlayPosition, LPLONG, LPLONG )
  291. FORWARD1(IDirectDrawSurface, GetPixelFormat, LPDDPIXELFORMAT)
  292. FORWARD2(IDirectDrawSurface, Initialize, LPDIRECTDRAW, LPDDSURFACEDESC)
  293. FORWARD0(IDirectDrawSurface, IsLost)
  294. FORWARD0(IDirectDrawSurface, Restore)
  295. FORWARD1(IDirectDrawSurface, SetClipper, LPDIRECTDRAWCLIPPER)
  296. FORWARD2(IDirectDrawSurface, SetColorKey, DWORD, LPDDCOLORKEY)
  297. FORWARD2(IDirectDrawSurface, SetOverlayPosition, LONG, LONG )
  298. FORWARD5(IDirectDrawSurface, UpdateOverlay, LPRECT, LPDIRECTDRAWSURFACE,LPRECT,DWORD, LPDDOVERLAYFX)
  299. FORWARD1(IDirectDrawSurface, UpdateOverlayDisplay, DWORD)
  300. FORWARD2(IDirectDrawSurface, UpdateOverlayZOrder, DWORD, LPDIRECTDRAWSURFACE)
  301. IDirectDrawSurfaceVtbl g_DirectDrawSurfaceVtbl =
  302. {
  303. IDirectDrawSurfaceAggQueryInterface,
  304. IDirectDrawSurfaceAggAddRef,
  305. IDirectDrawSurfaceAggRelease,
  306. IDirectDrawSurfaceAggAddAttachedSurface,
  307. IDirectDrawSurfaceAddOverlayDirtyRect,
  308. IDirectDrawSurfaceAggBlt,
  309. IDirectDrawSurfaceBltBatch,
  310. IDirectDrawSurfaceBltFast,
  311. IDirectDrawSurfaceAggDeleteAttachedSurface,
  312. IDirectDrawSurfaceEnumAttachedSurfaces,
  313. IDirectDrawSurfaceEnumOverlayZOrders,
  314. IDirectDrawSurfaceAggFlip,
  315. IDirectDrawSurfaceAggGetAttachedSurface,
  316. IDirectDrawSurfaceGetBltStatus,
  317. IDirectDrawSurfaceGetCaps,
  318. IDirectDrawSurfaceGetClipper,
  319. IDirectDrawSurfaceGetColorKey,
  320. IDirectDrawSurfaceAggGetDC,
  321. IDirectDrawSurfaceGetFlipStatus,
  322. IDirectDrawSurfaceGetOverlayPosition,
  323. IDirectDrawSurfaceAggGetPalette,
  324. IDirectDrawSurfaceGetPixelFormat,
  325. IDirectDrawSurfaceAggGetSurfaceDesc,
  326. IDirectDrawSurfaceInitialize,
  327. IDirectDrawSurfaceIsLost,
  328. IDirectDrawSurfaceAggLock,
  329. IDirectDrawSurfaceAggReleaseDC,
  330. IDirectDrawSurfaceRestore,
  331. IDirectDrawSurfaceSetClipper,
  332. IDirectDrawSurfaceSetColorKey,
  333. IDirectDrawSurfaceSetOverlayPosition,
  334. IDirectDrawSurfaceAggSetPalette,
  335. IDirectDrawSurfaceAggUnlock,
  336. IDirectDrawSurfaceUpdateOverlay,
  337. IDirectDrawSurfaceUpdateOverlayDisplay,
  338. IDirectDrawSurfaceUpdateOverlayZOrder
  339. };
  340. /*
  341. * IDirectDrawSurface2
  342. */
  343. STDMETHODIMP IDirectDrawSurface2AggQueryInterface(IDirectDrawSurface2 *pDDS2, REFIID riid, void ** ppv)
  344. {
  345. return __QI(SURFACEOF(pDDS2)->m_pUnkOuter, riid, ppv);
  346. }
  347. STDMETHODIMP_(ULONG) IDirectDrawSurface2AggAddRef(IDirectDrawSurface2 *);
  348. STDMETHODIMP_(ULONG) IDirectDrawSurface2AggRelease(IDirectDrawSurface2 *);
  349. STDMETHODIMP IDirectDrawSurface2AggGetDC(IDirectDrawSurface2 *, HDC *);
  350. STDMETHODIMP IDirectDrawSurface2AggReleaseDC(IDirectDrawSurface2 *, HDC);
  351. STDMETHODIMP IDirectDrawSurface2AggLock(IDirectDrawSurface2 *, LPRECT,LPDDSURFACEDESC,DWORD,HANDLE);
  352. STDMETHODIMP IDirectDrawSurface2AggUnlock(IDirectDrawSurface2 *, LPVOID);
  353. STDMETHODIMP IDirectDrawSurface2AggGetAttachedSurface( IDirectDrawSurface2 *, LPDDSCAPS, LPDIRECTDRAWSURFACE2 FAR *);
  354. STDMETHODIMP IDirectDrawSurface2AggAddAttachedSurface( IDirectDrawSurface2 *, LPDIRECTDRAWSURFACE2);
  355. STDMETHODIMP IDirectDrawSurface2AggDeleteAttachedSurface( IDirectDrawSurface2 *,DWORD, LPDIRECTDRAWSURFACE2);
  356. STDMETHODIMP IDirectDrawSurface2AggFlip(IDirectDrawSurface2 *, LPDIRECTDRAWSURFACE2, DWORD);
  357. STDMETHODIMP IDirectDrawSurface2AggBlt(IDirectDrawSurface2 *,LPRECT,LPDIRECTDRAWSURFACE2, LPRECT,DWORD, LPDDBLTFX);
  358. STDMETHODIMP IDirectDrawSurface2AggGetPalette(IDirectDrawSurface2 *, LPDIRECTDRAWPALETTE FAR *);
  359. STDMETHODIMP IDirectDrawSurface2AggSetPalette(IDirectDrawSurface2 *, LPDIRECTDRAWPALETTE);
  360. STDMETHODIMP IDirectDrawSurface2AggGetDDInterface(IDirectDrawSurface2 *, LPVOID FAR *);
  361. STDMETHODIMP IDirectDrawSurface2AggGetSurfaceDesc(IDirectDrawSurface2 *, LPDDSURFACEDESC);
  362. /*** IDirectDrawSurface2 methods ***/
  363. FORWARD1(IDirectDrawSurface2, AddOverlayDirtyRect, LPRECT)
  364. FORWARD3(IDirectDrawSurface2, BltBatch, LPDDBLTBATCH, DWORD, DWORD )
  365. FORWARD5(IDirectDrawSurface2, BltFast, DWORD,DWORD,LPDIRECTDRAWSURFACE2, LPRECT,DWORD)
  366. FORWARD2(IDirectDrawSurface2, EnumAttachedSurfaces, LPVOID,LPDDENUMSURFACESCALLBACK)
  367. FORWARD3(IDirectDrawSurface2, EnumOverlayZOrders, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
  368. FORWARD1(IDirectDrawSurface2, GetBltStatus, DWORD)
  369. FORWARD1(IDirectDrawSurface2, GetCaps, LPDDSCAPS)
  370. FORWARD1(IDirectDrawSurface2, GetClipper, LPDIRECTDRAWCLIPPER FAR*)
  371. FORWARD2(IDirectDrawSurface2, GetColorKey, DWORD, LPDDCOLORKEY)
  372. FORWARD1(IDirectDrawSurface2, GetFlipStatus, DWORD)
  373. FORWARD2(IDirectDrawSurface2, GetOverlayPosition, LPLONG, LPLONG )
  374. FORWARD1(IDirectDrawSurface2, GetPixelFormat, LPDDPIXELFORMAT)
  375. FORWARD2(IDirectDrawSurface2, Initialize, LPDIRECTDRAW, LPDDSURFACEDESC)
  376. FORWARD0(IDirectDrawSurface2, IsLost)
  377. FORWARD0(IDirectDrawSurface2, Restore)
  378. FORWARD1(IDirectDrawSurface2, SetClipper, LPDIRECTDRAWCLIPPER)
  379. FORWARD2(IDirectDrawSurface2, SetColorKey, DWORD, LPDDCOLORKEY)
  380. FORWARD2(IDirectDrawSurface2, SetOverlayPosition, LONG, LONG )
  381. FORWARD5(IDirectDrawSurface2, UpdateOverlay, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
  382. FORWARD1(IDirectDrawSurface2, UpdateOverlayDisplay, DWORD)
  383. FORWARD2(IDirectDrawSurface2, UpdateOverlayZOrder, DWORD, LPDIRECTDRAWSURFACE2)
  384. FORWARD1(IDirectDrawSurface2, PageLock, DWORD)
  385. FORWARD1(IDirectDrawSurface2, PageUnlock, DWORD)
  386. IDirectDrawSurface2Vtbl g_DirectDrawSurface2Vtbl =
  387. {
  388. IDirectDrawSurface2AggQueryInterface,
  389. IDirectDrawSurface2AggAddRef,
  390. IDirectDrawSurface2AggRelease,
  391. IDirectDrawSurface2AggAddAttachedSurface,
  392. IDirectDrawSurface2AddOverlayDirtyRect,
  393. IDirectDrawSurface2AggBlt,
  394. IDirectDrawSurface2BltBatch,
  395. IDirectDrawSurface2BltFast,
  396. IDirectDrawSurface2AggDeleteAttachedSurface,
  397. IDirectDrawSurface2EnumAttachedSurfaces,
  398. IDirectDrawSurface2EnumOverlayZOrders,
  399. IDirectDrawSurface2AggFlip,
  400. IDirectDrawSurface2AggGetAttachedSurface,
  401. IDirectDrawSurface2GetBltStatus,
  402. IDirectDrawSurface2GetCaps,
  403. IDirectDrawSurface2GetClipper,
  404. IDirectDrawSurface2GetColorKey,
  405. IDirectDrawSurface2AggGetDC,
  406. IDirectDrawSurface2GetFlipStatus,
  407. IDirectDrawSurface2GetOverlayPosition,
  408. IDirectDrawSurface2AggGetPalette,
  409. IDirectDrawSurface2GetPixelFormat,
  410. IDirectDrawSurface2AggGetSurfaceDesc,
  411. IDirectDrawSurface2Initialize,
  412. IDirectDrawSurface2IsLost,
  413. IDirectDrawSurface2AggLock,
  414. IDirectDrawSurface2AggReleaseDC,
  415. IDirectDrawSurface2Restore,
  416. IDirectDrawSurface2SetClipper,
  417. IDirectDrawSurface2SetColorKey,
  418. IDirectDrawSurface2SetOverlayPosition,
  419. IDirectDrawSurface2AggSetPalette,
  420. IDirectDrawSurface2AggUnlock,
  421. IDirectDrawSurface2UpdateOverlay,
  422. IDirectDrawSurface2UpdateOverlayDisplay,
  423. IDirectDrawSurface2UpdateOverlayZOrder,
  424. IDirectDrawSurface2AggGetDDInterface,
  425. IDirectDrawSurface2PageLock,
  426. IDirectDrawSurface2PageUnlock
  427. };
  428. /*
  429. * IDirectDrawSurface3
  430. */
  431. STDMETHODIMP IDirectDrawSurface3AggQueryInterface(IDirectDrawSurface3 *pDDS3, REFIID riid, void ** ppv)
  432. {
  433. return __QI(SURFACEOF(pDDS3)->m_pUnkOuter, riid, ppv);
  434. }
  435. STDMETHODIMP_(ULONG) IDirectDrawSurface3AggAddRef(IDirectDrawSurface3 *);
  436. STDMETHODIMP_(ULONG) IDirectDrawSurface3AggRelease(IDirectDrawSurface3 *);
  437. STDMETHODIMP IDirectDrawSurface3AggGetDC(IDirectDrawSurface3 *, HDC *);
  438. STDMETHODIMP IDirectDrawSurface3AggReleaseDC(IDirectDrawSurface3 *, HDC);
  439. STDMETHODIMP IDirectDrawSurface3AggLock(IDirectDrawSurface3 *, LPRECT,LPDDSURFACEDESC,DWORD,HANDLE);
  440. STDMETHODIMP IDirectDrawSurface3AggUnlock(IDirectDrawSurface3 *, LPVOID);
  441. STDMETHODIMP IDirectDrawSurface3AggSetSurfaceDesc(IDirectDrawSurface3 *, LPDDSURFACEDESC, DWORD);
  442. STDMETHODIMP IDirectDrawSurface3AggGetAttachedSurface( IDirectDrawSurface3 *, LPDDSCAPS, LPDIRECTDRAWSURFACE3 FAR *);
  443. STDMETHODIMP IDirectDrawSurface3AggAddAttachedSurface( IDirectDrawSurface3 *, LPDIRECTDRAWSURFACE3);
  444. STDMETHODIMP IDirectDrawSurface3AggDeleteAttachedSurface( IDirectDrawSurface3 *,DWORD, LPDIRECTDRAWSURFACE3);
  445. STDMETHODIMP IDirectDrawSurface3AggFlip(IDirectDrawSurface3 *, LPDIRECTDRAWSURFACE3, DWORD);
  446. STDMETHODIMP IDirectDrawSurface3AggBlt(IDirectDrawSurface3 *,LPRECT,LPDIRECTDRAWSURFACE3, LPRECT,DWORD, LPDDBLTFX);
  447. STDMETHODIMP IDirectDrawSurface3AggGetPalette(IDirectDrawSurface3 *, LPDIRECTDRAWPALETTE FAR *);
  448. STDMETHODIMP IDirectDrawSurface3AggSetPalette(IDirectDrawSurface3 *, LPDIRECTDRAWPALETTE);
  449. STDMETHODIMP IDirectDrawSurface3AggGetDDInterface(IDirectDrawSurface3 *, LPVOID FAR *);
  450. STDMETHODIMP IDirectDrawSurface3AggGetSurfaceDesc(IDirectDrawSurface3 *, LPDDSURFACEDESC);
  451. /*** IDirectDrawSurface3 methods ***/
  452. FORWARD1(IDirectDrawSurface3, AddOverlayDirtyRect, LPRECT)
  453. FORWARD3(IDirectDrawSurface3, BltBatch, LPDDBLTBATCH, DWORD, DWORD )
  454. FORWARD5(IDirectDrawSurface3, BltFast, DWORD,DWORD,LPDIRECTDRAWSURFACE3, LPRECT,DWORD)
  455. FORWARD2(IDirectDrawSurface3, EnumAttachedSurfaces, LPVOID,LPDDENUMSURFACESCALLBACK)
  456. FORWARD3(IDirectDrawSurface3, EnumOverlayZOrders, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
  457. FORWARD2(IDirectDrawSurface3, Flip, LPDIRECTDRAWSURFACE3, DWORD)
  458. FORWARD1(IDirectDrawSurface3, GetBltStatus, DWORD)
  459. FORWARD1(IDirectDrawSurface3, GetCaps, LPDDSCAPS)
  460. FORWARD1(IDirectDrawSurface3, GetClipper, LPDIRECTDRAWCLIPPER FAR*)
  461. FORWARD2(IDirectDrawSurface3, GetColorKey, DWORD, LPDDCOLORKEY)
  462. FORWARD1(IDirectDrawSurface3, GetFlipStatus, DWORD)
  463. FORWARD2(IDirectDrawSurface3, GetOverlayPosition, LPLONG, LPLONG )
  464. FORWARD1(IDirectDrawSurface3, GetPixelFormat, LPDDPIXELFORMAT)
  465. FORWARD2(IDirectDrawSurface3, Initialize, LPDIRECTDRAW, LPDDSURFACEDESC)
  466. FORWARD0(IDirectDrawSurface3, IsLost)
  467. FORWARD0(IDirectDrawSurface3, Restore)
  468. FORWARD1(IDirectDrawSurface3, SetClipper, LPDIRECTDRAWCLIPPER)
  469. FORWARD2(IDirectDrawSurface3, SetColorKey, DWORD, LPDDCOLORKEY)
  470. FORWARD2(IDirectDrawSurface3, SetOverlayPosition, LONG, LONG )
  471. FORWARD5(IDirectDrawSurface3, UpdateOverlay, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
  472. FORWARD1(IDirectDrawSurface3, UpdateOverlayDisplay, DWORD)
  473. FORWARD2(IDirectDrawSurface3, UpdateOverlayZOrder, DWORD, LPDIRECTDRAWSURFACE3)
  474. FORWARD1(IDirectDrawSurface3, PageLock, DWORD)
  475. FORWARD1(IDirectDrawSurface3, PageUnlock, DWORD)
  476. FORWARD2(IDirectDrawSurface3, SetSurfaceDesc, LPDDSURFACEDESC, DWORD )
  477. IDirectDrawSurface3Vtbl g_DirectDrawSurface3Vtbl_DX3 =
  478. {
  479. IDirectDrawSurface3AggQueryInterface,
  480. IDirectDrawSurface3AggAddRef,
  481. IDirectDrawSurface3AggRelease,
  482. IDirectDrawSurface3AggAddAttachedSurface,
  483. IDirectDrawSurface3AddOverlayDirtyRect,
  484. IDirectDrawSurface3AggBlt,
  485. IDirectDrawSurface3BltBatch,
  486. IDirectDrawSurface3BltFast,
  487. IDirectDrawSurface3AggDeleteAttachedSurface,
  488. IDirectDrawSurface3EnumAttachedSurfaces,
  489. IDirectDrawSurface3EnumOverlayZOrders,
  490. IDirectDrawSurface3AggFlip,
  491. IDirectDrawSurface3AggGetAttachedSurface,
  492. IDirectDrawSurface3GetBltStatus,
  493. IDirectDrawSurface3GetCaps,
  494. IDirectDrawSurface3GetClipper,
  495. IDirectDrawSurface3GetColorKey,
  496. IDirectDrawSurface3AggGetDC,
  497. IDirectDrawSurface3GetFlipStatus,
  498. IDirectDrawSurface3GetOverlayPosition,
  499. IDirectDrawSurface3AggGetPalette,
  500. IDirectDrawSurface3GetPixelFormat,
  501. IDirectDrawSurface3AggGetSurfaceDesc,
  502. IDirectDrawSurface3Initialize,
  503. IDirectDrawSurface3IsLost,
  504. IDirectDrawSurface3AggLock,
  505. IDirectDrawSurface3AggReleaseDC,
  506. IDirectDrawSurface3Restore,
  507. IDirectDrawSurface3SetClipper,
  508. IDirectDrawSurface3SetColorKey,
  509. IDirectDrawSurface3SetOverlayPosition,
  510. IDirectDrawSurface3AggSetPalette,
  511. IDirectDrawSurface3AggUnlock,
  512. IDirectDrawSurface3UpdateOverlay,
  513. IDirectDrawSurface3UpdateOverlayDisplay,
  514. IDirectDrawSurface3UpdateOverlayZOrder,
  515. IDirectDrawSurface3AggGetDDInterface,
  516. IDirectDrawSurface3PageLock,
  517. IDirectDrawSurface3PageUnlock,
  518. IDirectDrawSurface3AggSetSurfaceDesc
  519. };
  520. IDirectDrawSurface3Vtbl g_DirectDrawSurface3Vtbl_DX5 =
  521. {
  522. IDirectDrawSurface3AggQueryInterface,
  523. IDirectDrawSurface3AggAddRef,
  524. IDirectDrawSurface3AggRelease,
  525. IDirectDrawSurface3AggAddAttachedSurface,
  526. IDirectDrawSurface3AddOverlayDirtyRect,
  527. IDirectDrawSurface3AggBlt,
  528. IDirectDrawSurface3BltBatch,
  529. IDirectDrawSurface3BltFast,
  530. IDirectDrawSurface3AggDeleteAttachedSurface,
  531. IDirectDrawSurface3EnumAttachedSurfaces,
  532. IDirectDrawSurface3EnumOverlayZOrders,
  533. IDirectDrawSurface3AggFlip,
  534. IDirectDrawSurface3AggGetAttachedSurface,
  535. IDirectDrawSurface3GetBltStatus,
  536. IDirectDrawSurface3GetCaps,
  537. IDirectDrawSurface3GetClipper,
  538. IDirectDrawSurface3GetColorKey,
  539. IDirectDrawSurface3AggGetDC,
  540. IDirectDrawSurface3GetFlipStatus,
  541. IDirectDrawSurface3GetOverlayPosition,
  542. IDirectDrawSurface3AggGetPalette,
  543. IDirectDrawSurface3GetPixelFormat,
  544. IDirectDrawSurface3AggGetSurfaceDesc,
  545. IDirectDrawSurface3Initialize,
  546. IDirectDrawSurface3IsLost,
  547. IDirectDrawSurface3AggLock,
  548. IDirectDrawSurface3AggReleaseDC,
  549. IDirectDrawSurface3Restore,
  550. IDirectDrawSurface3SetClipper,
  551. IDirectDrawSurface3SetColorKey,
  552. IDirectDrawSurface3SetOverlayPosition,
  553. IDirectDrawSurface3AggSetPalette,
  554. IDirectDrawSurface3AggUnlock,
  555. IDirectDrawSurface3UpdateOverlay,
  556. IDirectDrawSurface3UpdateOverlayDisplay,
  557. IDirectDrawSurface3UpdateOverlayZOrder,
  558. IDirectDrawSurface3AggGetDDInterface,
  559. IDirectDrawSurface3PageLock,
  560. IDirectDrawSurface3PageUnlock,
  561. IDirectDrawSurface3SetSurfaceDesc
  562. };
  563. /*
  564. * IDirectDrawSurface4
  565. */
  566. STDMETHODIMP IDirectDrawSurface4AggQueryInterface(IDirectDrawSurface4 *pDDS4, REFIID riid, void ** ppv)
  567. {
  568. return __QI(SURFACEOF(pDDS4)->m_pUnkOuter, riid, ppv);
  569. }
  570. STDMETHODIMP_(ULONG) IDirectDrawSurface4AggAddRef(IDirectDrawSurface4 *);
  571. STDMETHODIMP_(ULONG) IDirectDrawSurface4AggRelease(IDirectDrawSurface4 *);
  572. STDMETHODIMP IDirectDrawSurface4AggGetDC(IDirectDrawSurface4 *, HDC *);
  573. STDMETHODIMP IDirectDrawSurface4AggReleaseDC(IDirectDrawSurface4 *, HDC);
  574. STDMETHODIMP IDirectDrawSurface4AggLock(IDirectDrawSurface4 *, LPRECT,LPDDSURFACEDESC2,DWORD,HANDLE);
  575. STDMETHODIMP IDirectDrawSurface4AggUnlock(IDirectDrawSurface4 *, LPRECT);
  576. STDMETHODIMP IDirectDrawSurface4AggSetSurfaceDesc(IDirectDrawSurface4 *, LPDDSURFACEDESC, DWORD);
  577. STDMETHODIMP IDirectDrawSurface4AggGetAttachedSurface( IDirectDrawSurface4 *, LPDDSCAPS2, LPDIRECTDRAWSURFACE4 FAR *);
  578. STDMETHODIMP IDirectDrawSurface4AggAddAttachedSurface( IDirectDrawSurface4 *, LPDIRECTDRAWSURFACE4);
  579. STDMETHODIMP IDirectDrawSurface4AggDeleteAttachedSurface( IDirectDrawSurface4 *,DWORD, LPDIRECTDRAWSURFACE4);
  580. STDMETHODIMP IDirectDrawSurface4AggFlip(IDirectDrawSurface4 *, LPDIRECTDRAWSURFACE4, DWORD);
  581. STDMETHODIMP IDirectDrawSurface4AggBlt(IDirectDrawSurface4 *,LPRECT,LPDIRECTDRAWSURFACE4, LPRECT,DWORD, LPDDBLTFX);
  582. STDMETHODIMP IDirectDrawSurface4AggGetPalette(IDirectDrawSurface4 *, LPDIRECTDRAWPALETTE FAR *);
  583. STDMETHODIMP IDirectDrawSurface4AggSetPalette(IDirectDrawSurface4 *, LPDIRECTDRAWPALETTE);
  584. STDMETHODIMP IDirectDrawSurface4AggGetDDInterface(IDirectDrawSurface4 *, LPVOID FAR *);
  585. STDMETHODIMP IDirectDrawSurface4AggGetSurfaceDesc(IDirectDrawSurface4 *, LPDDSURFACEDESC2);
  586. /*** IDirectDrawSurface4 methods ***/
  587. FORWARD1(IDirectDrawSurface4, AddOverlayDirtyRect, LPRECT)
  588. FORWARD3(IDirectDrawSurface4, BltBatch, LPDDBLTBATCH, DWORD, DWORD )
  589. FORWARD5(IDirectDrawSurface4, BltFast, DWORD,DWORD,LPDIRECTDRAWSURFACE4, LPRECT,DWORD)
  590. FORWARD2(IDirectDrawSurface4, EnumAttachedSurfaces, LPVOID,LPDDENUMSURFACESCALLBACK2)
  591. FORWARD3(IDirectDrawSurface4, EnumOverlayZOrders, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)
  592. FORWARD2(IDirectDrawSurface4, Flip, LPDIRECTDRAWSURFACE4, DWORD)
  593. FORWARD1(IDirectDrawSurface4, GetBltStatus, DWORD)
  594. FORWARD1(IDirectDrawSurface4, GetCaps, LPDDSCAPS2)
  595. FORWARD1(IDirectDrawSurface4, GetClipper, LPDIRECTDRAWCLIPPER FAR*)
  596. FORWARD2(IDirectDrawSurface4, GetColorKey, DWORD, LPDDCOLORKEY)
  597. FORWARD1(IDirectDrawSurface4, GetFlipStatus, DWORD)
  598. FORWARD2(IDirectDrawSurface4, GetOverlayPosition, LPLONG, LPLONG )
  599. FORWARD1(IDirectDrawSurface4, GetPixelFormat, LPDDPIXELFORMAT)
  600. FORWARD2(IDirectDrawSurface4, Initialize, LPDIRECTDRAW, LPDDSURFACEDESC2)
  601. FORWARD0(IDirectDrawSurface4, IsLost)
  602. FORWARD0(IDirectDrawSurface4, Restore)
  603. FORWARD1(IDirectDrawSurface4, SetClipper, LPDIRECTDRAWCLIPPER)
  604. FORWARD2(IDirectDrawSurface4, SetColorKey, DWORD, LPDDCOLORKEY)
  605. FORWARD2(IDirectDrawSurface4, SetOverlayPosition, LONG, LONG )
  606. FORWARD5(IDirectDrawSurface4, UpdateOverlay, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
  607. FORWARD1(IDirectDrawSurface4, UpdateOverlayDisplay, DWORD)
  608. FORWARD2(IDirectDrawSurface4, UpdateOverlayZOrder, DWORD, LPDIRECTDRAWSURFACE4)
  609. FORWARD1(IDirectDrawSurface4, PageLock, DWORD)
  610. FORWARD1(IDirectDrawSurface4, PageUnlock, DWORD)
  611. FORWARD2(IDirectDrawSurface4, SetSurfaceDesc, LPDDSURFACEDESC2, DWORD )
  612. FORWARD4(IDirectDrawSurface4, SetPrivateData, REFGUID, LPVOID, DWORD, DWORD )
  613. FORWARD3(IDirectDrawSurface4, GetPrivateData, REFGUID, LPVOID, LPDWORD)
  614. FORWARD1(IDirectDrawSurface4, FreePrivateData, REFGUID )
  615. FORWARD1(IDirectDrawSurface4, GetUniquenessValue, LPDWORD )
  616. FORWARD0(IDirectDrawSurface4, ChangeUniquenessValue )
  617. IDirectDrawSurface4Vtbl g_DirectDrawSurface4Vtbl =
  618. {
  619. IDirectDrawSurface4AggQueryInterface,
  620. IDirectDrawSurface4AggAddRef,
  621. IDirectDrawSurface4AggRelease,
  622. IDirectDrawSurface4AggAddAttachedSurface,
  623. IDirectDrawSurface4AddOverlayDirtyRect,
  624. IDirectDrawSurface4AggBlt,
  625. IDirectDrawSurface4BltBatch,
  626. IDirectDrawSurface4BltFast,
  627. IDirectDrawSurface4AggDeleteAttachedSurface,
  628. IDirectDrawSurface4EnumAttachedSurfaces,
  629. IDirectDrawSurface4EnumOverlayZOrders,
  630. IDirectDrawSurface4AggFlip,
  631. IDirectDrawSurface4AggGetAttachedSurface,
  632. IDirectDrawSurface4GetBltStatus,
  633. IDirectDrawSurface4GetCaps,
  634. IDirectDrawSurface4GetClipper,
  635. IDirectDrawSurface4GetColorKey,
  636. IDirectDrawSurface4AggGetDC,
  637. IDirectDrawSurface4GetFlipStatus,
  638. IDirectDrawSurface4GetOverlayPosition,
  639. IDirectDrawSurface4AggGetPalette,
  640. IDirectDrawSurface4GetPixelFormat,
  641. IDirectDrawSurface4AggGetSurfaceDesc,
  642. IDirectDrawSurface4Initialize,
  643. IDirectDrawSurface4IsLost,
  644. IDirectDrawSurface4AggLock,
  645. IDirectDrawSurface4AggReleaseDC,
  646. IDirectDrawSurface4Restore,
  647. IDirectDrawSurface4SetClipper,
  648. IDirectDrawSurface4SetColorKey,
  649. IDirectDrawSurface4SetOverlayPosition,
  650. IDirectDrawSurface4AggSetPalette,
  651. IDirectDrawSurface4AggUnlock,
  652. IDirectDrawSurface4UpdateOverlay,
  653. IDirectDrawSurface4UpdateOverlayDisplay,
  654. IDirectDrawSurface4UpdateOverlayZOrder,
  655. IDirectDrawSurface4AggGetDDInterface,
  656. IDirectDrawSurface4PageLock,
  657. IDirectDrawSurface4PageUnlock,
  658. IDirectDrawSurface4SetSurfaceDesc,
  659. IDirectDrawSurface4SetPrivateData,
  660. IDirectDrawSurface4GetPrivateData,
  661. IDirectDrawSurface4FreePrivateData,
  662. IDirectDrawSurface4GetUniquenessValue,
  663. IDirectDrawSurface4ChangeUniquenessValue
  664. };
  665. /*
  666. * IDirectDrawPalette
  667. */
  668. STDMETHODIMP IDirectDrawPaletteAggQueryInterface(IDirectDrawPalette *pDDP, REFIID riid, void ** ppv)
  669. {
  670. return __QI(PALETTEOF(pDDP)->m_pUnkOuter, riid, ppv);
  671. }
  672. STDMETHODIMP_(ULONG) IDirectDrawPaletteAggAddRef(IDirectDrawPalette *);
  673. STDMETHODIMP_(ULONG) IDirectDrawPaletteAggRelease(IDirectDrawPalette *);
  674. STDMETHODIMP IDirectDrawPaletteAggSetEntries(IDirectDrawPalette *,DWORD,DWORD,DWORD,LPPALETTEENTRY);
  675. /*** IDirectDrawPalette methods ***/
  676. FORWARD1(IDirectDrawPalette, GetCaps, LPDWORD);
  677. FORWARD4(IDirectDrawPalette, GetEntries, DWORD,DWORD,DWORD,LPPALETTEENTRY);
  678. FORWARD3(IDirectDrawPalette, Initialize, LPDIRECTDRAW, DWORD, LPPALETTEENTRY);
  679. IDirectDrawPaletteVtbl g_DirectDrawPaletteVtbl =
  680. {
  681. IDirectDrawPaletteAggQueryInterface,
  682. IDirectDrawPaletteAggAddRef,
  683. IDirectDrawPaletteAggRelease,
  684. IDirectDrawPaletteGetCaps,
  685. IDirectDrawPaletteGetEntries,
  686. IDirectDrawPaletteInitialize,
  687. IDirectDrawPaletteAggSetEntries
  688. };
  689. /*
  690. * InitDirectDrawInterfaces
  691. *
  692. * set up our ddraw interface data
  693. */
  694. void __stdcall InitDirectDrawInterfaces(
  695. IDirectDraw *pDD,
  696. INTSTRUC_IDirectDraw *pDDInt,
  697. IDirectDraw2 *pDD2,
  698. INTSTRUC_IDirectDraw2 *pDD2Int,
  699. IDirectDraw4 *pDD4,
  700. INTSTRUC_IDirectDraw4 *pDD4Int)
  701. {
  702. memcpy(pDDInt, pDD, sizeof(REALDDINTSTRUC));
  703. memcpy(pDD2Int, pDD2, sizeof(REALDDINTSTRUC));
  704. pDDInt->lpVtbl = &g_DirectDrawVtbl;
  705. pDD2Int->lpVtbl = &g_DirectDraw2Vtbl;
  706. if (pDD4)
  707. {
  708. memcpy(pDD4Int, pDD4, sizeof(REALDDINTSTRUC));
  709. pDD4Int->lpVtbl = &g_DirectDraw4Vtbl;
  710. }
  711. else
  712. {
  713. memset(pDD4Int, 0, sizeof(*pDD4Int));
  714. }
  715. } /* InitDirectDrawInterfaces */
  716. void __stdcall InitDirectDrawPaletteInterfaces(
  717. IDirectDrawPalette *pDDPalette,
  718. INTSTRUC_IDirectDrawPalette *pDDInt)
  719. {
  720. memcpy(pDDInt, pDDPalette, sizeof(REALDDINTSTRUC));
  721. pDDInt->lpVtbl = &g_DirectDrawPaletteVtbl;
  722. }
  723. /*
  724. * InitSurfaceInterfaces
  725. *
  726. * set up our ddraw surface interface data
  727. */
  728. void __stdcall InitSurfaceInterfaces(
  729. IDirectDrawSurface *pDDSurface,
  730. INTSTRUC_IDirectDrawSurface *pDDSInt,
  731. IDirectDrawSurface2 *pDDSurface2,
  732. INTSTRUC_IDirectDrawSurface2 *pDDS2Int,
  733. IDirectDrawSurface3 *pDDSurface3,
  734. INTSTRUC_IDirectDrawSurface3 *pDDS3Int,
  735. IDirectDrawSurface4 *pDDSurface4,
  736. INTSTRUC_IDirectDrawSurface4 *pDDS4Int
  737. )
  738. {
  739. memcpy(pDDSInt, pDDSurface, sizeof(REALDDINTSTRUC));
  740. pDDSInt->lpVtbl = &g_DirectDrawSurfaceVtbl;
  741. memcpy(pDDS2Int, pDDSurface2, sizeof(REALDDINTSTRUC));
  742. pDDS2Int->lpVtbl = &g_DirectDrawSurface2Vtbl;
  743. #pragma message( REMIND( "Would it be better to have 1 table and change the SetSurfaceDesc member?" ))
  744. if( pDDSurface3 != NULL )
  745. {
  746. memcpy(pDDS3Int, pDDSurface3, sizeof(REALDDINTSTRUC));
  747. pDDS3Int->lpVtbl = &g_DirectDrawSurface3Vtbl_DX5;
  748. }
  749. else
  750. {
  751. memcpy(pDDS3Int, pDDSurface2, sizeof(REALDDINTSTRUC));
  752. pDDS3Int->lpVtbl = &g_DirectDrawSurface3Vtbl_DX3;
  753. }
  754. if (pDDSurface4)
  755. {
  756. memcpy(pDDS4Int, pDDSurface4, sizeof(REALDDINTSTRUC));
  757. pDDS4Int->lpVtbl = &g_DirectDrawSurface4Vtbl;
  758. }
  759. else
  760. {
  761. memset(pDDS4Int, 0, sizeof(*pDDS4Int));
  762. }
  763. } /* InitSurfaceInterfaces */