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 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
192 * since the data layout is the same */
193 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
197 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
199 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
200 * IDirectDrawSurface vtable layout at the beginning */
201 *ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
202 IDirectDrawSurface7, IDirectDrawSurface3,
208 static HRESULT WINAPI
209 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
210 LPDIRECTDRAWSURFACE *ppSurface,
213 LPDIRECTDRAWSURFACE7 pSurface7;
216 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
217 * since the data layout is the same */
218 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
222 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
224 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
225 * IDirectDrawSurface vtable layout at the beginning */
226 *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
227 IDirectDrawSurface7, IDirectDrawSurface3,
233 static HRESULT WINAPI
234 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
235 LPDIRECTDRAWSURFACE4 *ppSurface,
238 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
239 * since the data layout is the same */
240 return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
244 (LPDDSURFACEDESC2)pSDesc,
245 (LPDIRECTDRAWSURFACE7 *)ppSurface,
249 static HRESULT WINAPI
250 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
251 LPDIRECTDRAWSURFACE *ppDst)
253 LPDIRECTDRAWSURFACE7 pDst7;
256 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
259 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
265 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
266 * IDirectDrawSurface vtable layout at the beginning */
267 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
268 IDirectDrawSurface3, pDst7);
273 static HRESULT WINAPI
274 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
275 LPDIRECTDRAWSURFACE *ppDst)
277 LPDIRECTDRAWSURFACE7 pDst7;
280 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
283 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
289 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
290 * IDirectDrawSurface vtable layout at the beginning */
291 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
292 IDirectDrawSurface3, pDst7);
297 static HRESULT WINAPI
298 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This,
299 LPDIRECTDRAWSURFACE4 pSrc,
300 LPDIRECTDRAWSURFACE4 *ppDst)
302 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
306 (LPDIRECTDRAWSURFACE7)pSrc,
307 (LPDIRECTDRAWSURFACE7 *)ppDst);
310 struct displaymodescallback_context
312 LPDDENUMMODESCALLBACK func;
316 static HRESULT CALLBACK
317 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context)
319 struct displaymodescallback_context *cbcontext = context;
321 return cbcontext->func((LPDDSURFACEDESC)pDDSD2, cbcontext->context);
324 static HRESULT WINAPI
325 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
326 LPDDSURFACEDESC pDDSD, LPVOID context,
327 LPDDENUMMODESCALLBACK cb)
329 struct displaymodescallback_context cbcontext = { cb, context };
331 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
335 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
336 EnumDisplayModesCallbackThunk);
339 static HRESULT WINAPI
340 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
341 LPDDSURFACEDESC pDDSD, LPVOID context,
342 LPDDENUMMODESCALLBACK cb)
344 struct displaymodescallback_context cbcontext = { cb, context };
346 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
350 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
351 EnumDisplayModesCallbackThunk);
354 static HRESULT WINAPI
355 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags,
356 LPDDSURFACEDESC2 pDDSD, LPVOID context,
357 LPDDENUMMODESCALLBACK2 cb)
359 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
363 dwFlags, pDDSD, context, cb);
366 struct surfacescallback_context
368 LPDDENUMSURFACESCALLBACK func;
372 static HRESULT CALLBACK
373 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
376 struct surfacescallback_context *cbcontext = context;
378 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
379 * IDirectDrawSurface vtable layout at the beginning */
380 return cbcontext->func((LPDIRECTDRAWSURFACE)
381 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
383 IDirectDrawSurface3, pSurf),
384 (LPDDSURFACEDESC)pDDSD, cbcontext->context);
387 static HRESULT WINAPI
388 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags,
389 LPDDSURFACEDESC pDDSD, LPVOID context,
390 LPDDENUMSURFACESCALLBACK cb)
392 struct surfacescallback_context cbcontext = { cb, context };
393 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
396 dwFlags, (LPDDSURFACEDESC2)pDDSD,
397 &cbcontext, EnumSurfacesCallbackThunk);
400 static HRESULT WINAPI
401 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags,
402 LPDDSURFACEDESC pDDSD, LPVOID context,
403 LPDDENUMSURFACESCALLBACK cb)
405 struct surfacescallback_context cbcontext = { cb, context };
406 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
409 dwFlags, (LPDDSURFACEDESC2)pDDSD,
410 &cbcontext, EnumSurfacesCallbackThunk);
413 static HRESULT WINAPI
414 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags,
415 LPDDSURFACEDESC2 pDDSD, LPVOID context,
416 LPDDENUMSURFACESCALLBACK2 cb)
418 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
421 dwFlags, pDDSD, context,
422 (LPDDENUMSURFACESCALLBACK7)cb);
425 static HRESULT WINAPI
426 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This)
428 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
434 static HRESULT WINAPI
435 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This)
437 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
443 static HRESULT WINAPI
444 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This)
446 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
452 static HRESULT WINAPI
453 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
455 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
456 IDirectDraw, IDirectDraw7,
457 This), pDDC1, pDDC2);
460 static HRESULT WINAPI
461 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
463 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
464 IDirectDraw2, IDirectDraw7,
465 This), pDDC1, pDDC2);
468 static HRESULT WINAPI
469 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
471 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
472 IDirectDraw4, IDirectDraw7,
473 This), pDDC1, pDDC2);
476 static HRESULT WINAPI
477 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD)
479 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
482 (LPDDSURFACEDESC2)pDDSD);
485 static HRESULT WINAPI
486 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD)
488 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
491 (LPDDSURFACEDESC2)pDDSD);
494 static HRESULT WINAPI
495 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD)
497 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
503 static HRESULT WINAPI
504 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes,
507 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
511 lpNumCodes, lpCodes);
514 static HRESULT WINAPI
515 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes,
518 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
522 lpNumCodes, lpCodes);
525 static HRESULT WINAPI
526 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes,
529 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
533 lpNumCodes, lpCodes);
536 static HRESULT WINAPI
537 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
539 LPDIRECTDRAWSURFACE7 pSurf7;
542 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
547 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
548 * IDirectDrawSurface vtable layout at the beginning */
549 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
550 IDirectDrawSurface3, pSurf7);
555 static HRESULT WINAPI
556 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
558 LPDIRECTDRAWSURFACE7 pSurf7;
561 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
566 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
567 * IDirectDrawSurface vtable layout at the beginning */
568 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
569 IDirectDrawSurface3, pSurf7);
574 static HRESULT WINAPI
575 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This,
576 LPDIRECTDRAWSURFACE4 *ppSurf)
578 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
582 (LPDIRECTDRAWSURFACE7 *)ppSurf);
585 static HRESULT WINAPI
586 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq)
588 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
595 static HRESULT WINAPI
596 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq)
598 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
605 static HRESULT WINAPI
606 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq)
608 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
615 static HRESULT WINAPI
616 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This, LPDWORD pdwLine)
618 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
624 static HRESULT WINAPI
625 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This, LPDWORD pdwLine)
627 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
633 static HRESULT WINAPI
634 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This, LPDWORD pdwLine)
636 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
642 static HRESULT WINAPI
643 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This, LPBOOL lpbIsInVB)
645 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
652 static HRESULT WINAPI
653 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This, LPBOOL lpbIsInVB)
655 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
662 static HRESULT WINAPI
663 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This, LPBOOL lpbIsInVB)
665 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
672 static HRESULT WINAPI
673 IDirectDrawImpl_Initialize(LPDIRECTDRAW This, LPGUID pGUID)
675 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
681 static HRESULT WINAPI
682 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 This, LPGUID pGUID)
684 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
690 static HRESULT WINAPI
691 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 This, LPGUID pGUID)
693 return IDirectDraw7_Initialize(COM_INTERFACE_CAST(IDirectDrawImpl,
699 static HRESULT WINAPI
700 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This)
702 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
708 static HRESULT WINAPI
709 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This)
711 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
717 static HRESULT WINAPI
718 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This)
720 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
726 static HRESULT WINAPI
727 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This, HWND hWnd,
730 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
737 static HRESULT WINAPI
738 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This, HWND hWnd,
741 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
748 static HRESULT WINAPI
749 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This, HWND hWnd,
752 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
759 static HRESULT WINAPI
760 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This, DWORD a, DWORD b, DWORD c)
762 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
769 static HRESULT WINAPI
770 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This, DWORD a, DWORD b, DWORD c,
773 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
780 static HRESULT WINAPI
781 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This, DWORD a, DWORD b, DWORD c,
784 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
791 static HRESULT WINAPI
792 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This, DWORD dwFlags,
795 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
802 static HRESULT WINAPI
803 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This, DWORD dwFlags,
806 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
813 static HRESULT WINAPI
814 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This, DWORD dwFlags,
817 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
824 static HRESULT WINAPI
825 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This, LPDDSCAPS pCaps,
826 LPDWORD pdwTotal, LPDWORD pdwFree)
829 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
831 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
835 &Caps2, pdwTotal, pdwFree);
838 static HRESULT WINAPI
839 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This, LPDDSCAPS2 pCaps,
840 LPDWORD pdwTotal, LPDWORD pdwFree)
842 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
846 pCaps, pdwTotal, pdwFree);
849 static HRESULT WINAPI
850 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This, HDC hDC,
851 LPDIRECTDRAWSURFACE4 *pSurf)
853 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
857 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
860 static HRESULT WINAPI
861 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This)
863 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
869 static HRESULT WINAPI
870 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This)
872 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
878 static HRESULT WINAPI
879 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This,
880 LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
882 DDDEVICEIDENTIFIER2 DDDI2;
885 hr = IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl,
891 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(pDDDI, &DDDI2);
896 ICOM_VTABLE(IDirectDraw) DDRAW_IDirectDraw_VTable =
898 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
899 IDirectDrawImpl_QueryInterface,
900 IDirectDrawImpl_AddRef,
901 IDirectDrawImpl_Release,
902 IDirectDrawImpl_Compact,
903 IDirectDrawImpl_CreateClipper,
904 IDirectDrawImpl_CreatePalette,
905 IDirectDrawImpl_CreateSurface,
906 IDirectDrawImpl_DuplicateSurface,
907 IDirectDrawImpl_EnumDisplayModes,
908 IDirectDrawImpl_EnumSurfaces,
909 IDirectDrawImpl_FlipToGDISurface,
910 IDirectDrawImpl_GetCaps,
911 IDirectDrawImpl_GetDisplayMode,
912 IDirectDrawImpl_GetFourCCCodes,
913 IDirectDrawImpl_GetGDISurface,
914 IDirectDrawImpl_GetMonitorFrequency,
915 IDirectDrawImpl_GetScanLine,
916 IDirectDrawImpl_GetVerticalBlankStatus,
917 IDirectDrawImpl_Initialize,
918 IDirectDrawImpl_RestoreDisplayMode,
919 IDirectDrawImpl_SetCooperativeLevel,
920 IDirectDrawImpl_SetDisplayMode,
921 IDirectDrawImpl_WaitForVerticalBlank,
924 ICOM_VTABLE(IDirectDraw2) DDRAW_IDirectDraw2_VTable =
926 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
927 IDirectDraw2Impl_QueryInterface,
928 IDirectDraw2Impl_AddRef,
929 IDirectDraw2Impl_Release,
930 IDirectDraw2Impl_Compact,
931 IDirectDraw2Impl_CreateClipper,
932 IDirectDraw2Impl_CreatePalette,
933 IDirectDraw2Impl_CreateSurface,
934 IDirectDraw2Impl_DuplicateSurface,
935 IDirectDraw2Impl_EnumDisplayModes,
936 IDirectDraw2Impl_EnumSurfaces,
937 IDirectDraw2Impl_FlipToGDISurface,
938 IDirectDraw2Impl_GetCaps,
939 IDirectDraw2Impl_GetDisplayMode,
940 IDirectDraw2Impl_GetFourCCCodes,
941 IDirectDraw2Impl_GetGDISurface,
942 IDirectDraw2Impl_GetMonitorFrequency,
943 IDirectDraw2Impl_GetScanLine,
944 IDirectDraw2Impl_GetVerticalBlankStatus,
945 IDirectDraw2Impl_Initialize,
946 IDirectDraw2Impl_RestoreDisplayMode,
947 IDirectDraw2Impl_SetCooperativeLevel,
948 IDirectDraw2Impl_SetDisplayMode,
949 IDirectDraw2Impl_WaitForVerticalBlank,
950 IDirectDraw2Impl_GetAvailableVidMem
953 ICOM_VTABLE(IDirectDraw4) DDRAW_IDirectDraw4_VTable =
955 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
956 IDirectDraw4Impl_QueryInterface,
957 IDirectDraw4Impl_AddRef,
958 IDirectDraw4Impl_Release,
959 IDirectDraw4Impl_Compact,
960 IDirectDraw4Impl_CreateClipper,
961 IDirectDraw4Impl_CreatePalette,
962 IDirectDraw4Impl_CreateSurface,
963 IDirectDraw4Impl_DuplicateSurface,
964 IDirectDraw4Impl_EnumDisplayModes,
965 IDirectDraw4Impl_EnumSurfaces,
966 IDirectDraw4Impl_FlipToGDISurface,
967 IDirectDraw4Impl_GetCaps,
968 IDirectDraw4Impl_GetDisplayMode,
969 IDirectDraw4Impl_GetFourCCCodes,
970 IDirectDraw4Impl_GetGDISurface,
971 IDirectDraw4Impl_GetMonitorFrequency,
972 IDirectDraw4Impl_GetScanLine,
973 IDirectDraw4Impl_GetVerticalBlankStatus,
974 IDirectDraw4Impl_Initialize,
975 IDirectDraw4Impl_RestoreDisplayMode,
976 IDirectDraw4Impl_SetCooperativeLevel,
977 IDirectDraw4Impl_SetDisplayMode,
978 IDirectDraw4Impl_WaitForVerticalBlank,
979 IDirectDraw4Impl_GetAvailableVidMem,
980 IDirectDraw4Impl_GetSurfaceFromDC,
981 IDirectDraw4Impl_RestoreAllSurfaces,
982 IDirectDraw4Impl_TestCooperativeLevel,
983 IDirectDraw4Impl_GetDeviceIdentifier