1 /* Direct Draw Thunks and old vtables
2 * Copyright 2000 TransGaming Technologies Inc.
5 #include "ddraw_private.h"
9 IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This, REFIID iid, LPVOID *ppObj)
11 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
18 IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This, REFIID iid, LPVOID *ppObj)
20 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
28 IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This, REFIID iid, LPVOID *ppObj)
30 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
37 IDirectDrawImpl_AddRef(LPDIRECTDRAW This)
39 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
40 IDirectDraw, IDirectDraw7,
45 IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 This)
47 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
48 IDirectDraw2, IDirectDraw7,
53 IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 This)
55 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
56 IDirectDraw4, IDirectDraw7,
61 IDirectDrawImpl_Release(LPDIRECTDRAW This)
63 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
64 IDirectDraw, IDirectDraw7,
69 IDirectDraw2Impl_Release(LPDIRECTDRAW2 This)
71 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
72 IDirectDraw2, IDirectDraw7,
77 IDirectDraw4Impl_Release(LPDIRECTDRAW4 This)
79 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
80 IDirectDraw4, IDirectDraw7,
85 IDirectDrawImpl_Compact(LPDIRECTDRAW This)
87 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
88 IDirectDraw, IDirectDraw7,
93 IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This)
95 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
96 IDirectDraw2, IDirectDraw7,
100 static HRESULT WINAPI
101 IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This)
103 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
104 IDirectDraw4, IDirectDraw7,
108 static HRESULT WINAPI
109 IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This, DWORD dwFlags,
110 LPDIRECTDRAWCLIPPER *ppClipper,
113 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
117 dwFlags, ppClipper, pUnkOuter);
120 static HRESULT WINAPI
121 IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This, DWORD dwFlags,
122 LPDIRECTDRAWCLIPPER *ppClipper,
125 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
129 dwFlags, ppClipper, pUnkOuter);
132 static HRESULT WINAPI
133 IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This, DWORD dwFlags,
134 LPDIRECTDRAWCLIPPER *ppClipper,
137 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
141 dwFlags, ppClipper, pUnkOuter);
144 static HRESULT WINAPI
145 IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This, DWORD dwFlags,
146 LPPALETTEENTRY pEntries,
147 LPDIRECTDRAWPALETTE *ppPalette,
150 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
154 dwFlags, pEntries, ppPalette, pUnkOuter);
157 static HRESULT WINAPI
158 IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This, DWORD dwFlags,
159 LPPALETTEENTRY pEntries,
160 LPDIRECTDRAWPALETTE *ppPalette,
163 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
167 dwFlags, pEntries, ppPalette, pUnkOuter);
170 static HRESULT WINAPI
171 IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
172 LPPALETTEENTRY pEntries,
173 LPDIRECTDRAWPALETTE *ppPalette,
176 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
180 dwFlags, pEntries, ppPalette, pUnkOuter);
183 static HRESULT WINAPI
184 IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
185 LPDIRECTDRAWSURFACE *ppSurface,
188 LPDIRECTDRAWSURFACE7 pSurface7;
191 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
195 pSDesc, &pSurface7, pUnkOuter);
197 *ppSurface = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
198 IDirectDrawSurface7, IDirectDrawSurface3,
204 static HRESULT WINAPI
205 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
206 LPDIRECTDRAWSURFACE *ppSurface,
209 LPDIRECTDRAWSURFACE7 pSurface7;
212 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
216 pSDesc, &pSurface7, pUnkOuter);
218 *ppSurface = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
219 IDirectDrawSurface7, IDirectDrawSurface3,
225 static HRESULT WINAPI
226 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
227 LPDIRECTDRAWSURFACE4 *ppSurface,
230 return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
235 (LPDIRECTDRAWSURFACE7 *)ppSurface,
239 static HRESULT WINAPI
240 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
241 LPDIRECTDRAWSURFACE *ppDst)
243 LPDIRECTDRAWSURFACE7 pDst7;
246 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
249 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
255 *ppDst = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
256 IDirectDrawSurface3, pDst7);
261 static HRESULT WINAPI
262 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
263 LPDIRECTDRAWSURFACE *ppDst)
265 LPDIRECTDRAWSURFACE7 pDst7;
268 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
271 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
277 *ppDst = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
278 IDirectDrawSurface3, pDst7);
283 static HRESULT WINAPI
284 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This,
285 LPDIRECTDRAWSURFACE4 pSrc,
286 LPDIRECTDRAWSURFACE4 *ppDst)
288 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
292 (LPDIRECTDRAWSURFACE7)pSrc,
293 (LPDIRECTDRAWSURFACE7 *)ppDst);
296 struct displaymodescallback_context
298 LPDDENUMMODESCALLBACK func;
302 static HRESULT CALLBACK
303 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context)
305 struct displaymodescallback_context *cbcontext = context;
307 return cbcontext->func((LPDDSURFACEDESC)pDDSD2, cbcontext->context);
310 static HRESULT WINAPI
311 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
312 LPDDSURFACEDESC pDDSD, LPVOID context,
313 LPDDENUMMODESCALLBACK cb)
315 struct displaymodescallback_context cbcontext = { cb, context };
317 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
321 dwFlags, pDDSD, &cbcontext,
322 EnumDisplayModesCallbackThunk);
325 static HRESULT WINAPI
326 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
327 LPDDSURFACEDESC pDDSD, LPVOID context,
328 LPDDENUMMODESCALLBACK cb)
330 struct displaymodescallback_context cbcontext = { cb, context };
332 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
336 dwFlags, pDDSD, &cbcontext,
337 EnumDisplayModesCallbackThunk);
340 static HRESULT WINAPI
341 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags,
342 LPDDSURFACEDESC2 pDDSD, LPVOID context,
343 LPDDENUMMODESCALLBACK2 cb)
345 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
349 dwFlags, pDDSD, context, cb);
352 struct surfacescallback_context
354 LPDDENUMSURFACESCALLBACK func;
358 static HRESULT CALLBACK
359 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
362 struct surfacescallback_context *cbcontext = context;
364 return cbcontext->func(COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
366 IDirectDrawSurface3, pSurf),
367 (LPDDSURFACEDESC)pDDSD, cbcontext->context);
370 static HRESULT WINAPI
371 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags,
372 LPDDSURFACEDESC pDDSD, LPVOID context,
373 LPDDENUMSURFACESCALLBACK cb)
375 struct surfacescallback_context cbcontext = { cb, context };
376 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
379 dwFlags, (LPDDSURFACEDESC2)pDDSD,
380 &cbcontext, EnumSurfacesCallbackThunk);
383 static HRESULT WINAPI
384 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags,
385 LPDDSURFACEDESC pDDSD, LPVOID context,
386 LPDDENUMSURFACESCALLBACK cb)
388 struct surfacescallback_context cbcontext = { cb, context };
389 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
392 dwFlags, (LPDDSURFACEDESC2)pDDSD,
393 &cbcontext, EnumSurfacesCallbackThunk);
396 static HRESULT WINAPI
397 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags,
398 LPDDSURFACEDESC2 pDDSD, LPVOID context,
399 LPDDENUMSURFACESCALLBACK2 cb)
401 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
404 dwFlags, pDDSD, context,
405 (LPDDENUMSURFACESCALLBACK7)cb);
408 static HRESULT WINAPI
409 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This)
411 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
417 static HRESULT WINAPI
418 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This)
420 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
426 static HRESULT WINAPI
427 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This)
429 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
435 static HRESULT WINAPI
436 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
438 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
439 IDirectDraw, IDirectDraw7,
440 This), pDDC1, pDDC2);
443 static HRESULT WINAPI
444 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
446 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
447 IDirectDraw2, IDirectDraw7,
448 This), pDDC1, pDDC2);
451 static HRESULT WINAPI
452 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
454 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
455 IDirectDraw4, IDirectDraw7,
456 This), pDDC1, pDDC2);
459 static HRESULT WINAPI
460 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD)
462 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
465 (LPDDSURFACEDESC2)pDDSD);
468 static HRESULT WINAPI
469 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD)
471 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
474 (LPDDSURFACEDESC2)pDDSD);
477 static HRESULT WINAPI
478 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD)
480 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
486 static HRESULT WINAPI
487 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes,
490 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
494 lpNumCodes, lpCodes);
497 static HRESULT WINAPI
498 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes,
501 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
505 lpNumCodes, lpCodes);
508 static HRESULT WINAPI
509 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes,
512 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
516 lpNumCodes, lpCodes);
519 static HRESULT WINAPI
520 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
522 LPDIRECTDRAWSURFACE7 pSurf7;
525 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
530 *ppSurf = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
531 IDirectDrawSurface3, pSurf7);
536 static HRESULT WINAPI
537 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
539 LPDIRECTDRAWSURFACE7 pSurf7;
542 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
547 *ppSurf = COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
548 IDirectDrawSurface3, pSurf7);
553 static HRESULT WINAPI
554 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This,
555 LPDIRECTDRAWSURFACE4 *ppSurf)
557 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
561 (LPDIRECTDRAWSURFACE7 *)ppSurf);
564 static HRESULT WINAPI
565 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq)
567 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
574 static HRESULT WINAPI
575 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq)
577 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
584 static HRESULT WINAPI
585 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq)
587 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
594 static HRESULT WINAPI
595 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This, LPDWORD pdwLine)
597 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
603 static HRESULT WINAPI
604 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This, LPDWORD pdwLine)
606 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
612 static HRESULT WINAPI
613 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This, LPDWORD pdwLine)
615 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
621 static HRESULT WINAPI
622 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This, LPBOOL lpbIsInVB)
624 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
631 static HRESULT WINAPI
632 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This, LPBOOL lpbIsInVB)
634 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
641 static HRESULT WINAPI
642 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This, LPBOOL lpbIsInVB)
644 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
651 static HRESULT WINAPI
652 IDirectDrawImpl_Initialize(LPDIRECTDRAW This, LPGUID pGUID)
654 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
660 static HRESULT WINAPI
661 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 This, LPGUID pGUID)
663 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
669 static HRESULT WINAPI
670 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 This, LPGUID pGUID)
672 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
678 static HRESULT WINAPI
679 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This)
681 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
687 static HRESULT WINAPI
688 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This)
690 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
696 static HRESULT WINAPI
697 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This)
699 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
705 static HRESULT WINAPI
706 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This, HWND hWnd,
709 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
716 static HRESULT WINAPI
717 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This, HWND hWnd,
720 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
727 static HRESULT WINAPI
728 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This, HWND hWnd,
731 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
738 static HRESULT WINAPI
739 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This, DWORD a, DWORD b, DWORD c)
741 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
748 static HRESULT WINAPI
749 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This, DWORD a, DWORD b, DWORD c,
752 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
759 static HRESULT WINAPI
760 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This, DWORD a, DWORD b, DWORD c,
763 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
770 static HRESULT WINAPI
771 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This, DWORD dwFlags,
774 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
781 static HRESULT WINAPI
782 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This, DWORD dwFlags,
785 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
792 static HRESULT WINAPI
793 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This, DWORD dwFlags,
796 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
803 static HRESULT WINAPI
804 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This, LPDDSCAPS pCaps,
805 LPDWORD pdwTotal, LPDWORD pdwFree)
808 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
810 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
814 &Caps2, pdwTotal, pdwFree);
817 static HRESULT WINAPI
818 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This, LPDDSCAPS2 pCaps,
819 LPDWORD pdwTotal, LPDWORD pdwFree)
821 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
825 pCaps, pdwTotal, pdwFree);
828 static HRESULT WINAPI
829 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This, HDC hDC,
830 LPDIRECTDRAWSURFACE4 *pSurf)
832 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
836 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
839 static HRESULT WINAPI
840 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This)
842 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
848 static HRESULT WINAPI
849 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This)
851 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
857 static HRESULT WINAPI
858 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This,
859 LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
861 DDDEVICEIDENTIFIER2 DDDI2;
864 hr = IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl,
870 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(pDDDI, &DDDI2);
875 ICOM_VTABLE(IDirectDraw) DDRAW_IDirectDraw_VTable =
877 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
878 IDirectDrawImpl_QueryInterface,
879 IDirectDrawImpl_AddRef,
880 IDirectDrawImpl_Release,
881 IDirectDrawImpl_Compact,
882 IDirectDrawImpl_CreateClipper,
883 IDirectDrawImpl_CreatePalette,
884 IDirectDrawImpl_CreateSurface,
885 IDirectDrawImpl_DuplicateSurface,
886 IDirectDrawImpl_EnumDisplayModes,
887 IDirectDrawImpl_EnumSurfaces,
888 IDirectDrawImpl_FlipToGDISurface,
889 IDirectDrawImpl_GetCaps,
890 IDirectDrawImpl_GetDisplayMode,
891 IDirectDrawImpl_GetFourCCCodes,
892 IDirectDrawImpl_GetGDISurface,
893 IDirectDrawImpl_GetMonitorFrequency,
894 IDirectDrawImpl_GetScanLine,
895 IDirectDrawImpl_GetVerticalBlankStatus,
896 IDirectDrawImpl_Initialize,
897 IDirectDrawImpl_RestoreDisplayMode,
898 IDirectDrawImpl_SetCooperativeLevel,
899 IDirectDrawImpl_SetDisplayMode,
900 IDirectDrawImpl_WaitForVerticalBlank,
903 ICOM_VTABLE(IDirectDraw2) DDRAW_IDirectDraw2_VTable =
905 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
906 IDirectDraw2Impl_QueryInterface,
907 IDirectDraw2Impl_AddRef,
908 IDirectDraw2Impl_Release,
909 IDirectDraw2Impl_Compact,
910 IDirectDraw2Impl_CreateClipper,
911 IDirectDraw2Impl_CreatePalette,
912 IDirectDraw2Impl_CreateSurface,
913 IDirectDraw2Impl_DuplicateSurface,
914 IDirectDraw2Impl_EnumDisplayModes,
915 IDirectDraw2Impl_EnumSurfaces,
916 IDirectDraw2Impl_FlipToGDISurface,
917 IDirectDraw2Impl_GetCaps,
918 IDirectDraw2Impl_GetDisplayMode,
919 IDirectDraw2Impl_GetFourCCCodes,
920 IDirectDraw2Impl_GetGDISurface,
921 IDirectDraw2Impl_GetMonitorFrequency,
922 IDirectDraw2Impl_GetScanLine,
923 IDirectDraw2Impl_GetVerticalBlankStatus,
924 IDirectDraw2Impl_Initialize,
925 IDirectDraw2Impl_RestoreDisplayMode,
926 IDirectDraw2Impl_SetCooperativeLevel,
927 IDirectDraw2Impl_SetDisplayMode,
928 IDirectDraw2Impl_WaitForVerticalBlank,
929 IDirectDraw2Impl_GetAvailableVidMem
932 ICOM_VTABLE(IDirectDraw4) DDRAW_IDirectDraw4_VTable =
934 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
935 IDirectDraw4Impl_QueryInterface,
936 IDirectDraw4Impl_AddRef,
937 IDirectDraw4Impl_Release,
938 IDirectDraw4Impl_Compact,
939 IDirectDraw4Impl_CreateClipper,
940 IDirectDraw4Impl_CreatePalette,
941 IDirectDraw4Impl_CreateSurface,
942 IDirectDraw4Impl_DuplicateSurface,
943 IDirectDraw4Impl_EnumDisplayModes,
944 IDirectDraw4Impl_EnumSurfaces,
945 IDirectDraw4Impl_FlipToGDISurface,
946 IDirectDraw4Impl_GetCaps,
947 IDirectDraw4Impl_GetDisplayMode,
948 IDirectDraw4Impl_GetFourCCCodes,
949 IDirectDraw4Impl_GetGDISurface,
950 IDirectDraw4Impl_GetMonitorFrequency,
951 IDirectDraw4Impl_GetScanLine,
952 IDirectDraw4Impl_GetVerticalBlankStatus,
953 IDirectDraw4Impl_Initialize,
954 IDirectDraw4Impl_RestoreDisplayMode,
955 IDirectDraw4Impl_SetCooperativeLevel,
956 IDirectDraw4Impl_SetDisplayMode,
957 IDirectDraw4Impl_WaitForVerticalBlank,
958 IDirectDraw4Impl_GetAvailableVidMem,
959 IDirectDraw4Impl_GetSurfaceFromDC,
960 IDirectDraw4Impl_RestoreAllSurfaces,
961 IDirectDraw4Impl_TestCooperativeLevel,
962 IDirectDraw4Impl_GetDeviceIdentifier