1 /* Direct Draw Thunks and old vtables
2 * Copyright 2000 TransGaming Technologies Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "ddraw_private.h"
27 #include "ddcomimpl.h"
30 IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This, REFIID iid, LPVOID *ppObj)
32 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
39 IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This, REFIID iid, LPVOID *ppObj)
41 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
49 IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This, REFIID iid, LPVOID *ppObj)
51 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
58 IDirectDrawImpl_AddRef(LPDIRECTDRAW This)
60 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
61 IDirectDraw, IDirectDraw7,
66 IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 This)
68 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
69 IDirectDraw2, IDirectDraw7,
74 IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 This)
76 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
77 IDirectDraw4, IDirectDraw7,
82 IDirectDrawImpl_Release(LPDIRECTDRAW This)
84 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
85 IDirectDraw, IDirectDraw7,
90 IDirectDraw2Impl_Release(LPDIRECTDRAW2 This)
92 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
93 IDirectDraw2, IDirectDraw7,
98 IDirectDraw4Impl_Release(LPDIRECTDRAW4 This)
100 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
101 IDirectDraw4, IDirectDraw7,
105 static HRESULT WINAPI
106 IDirectDrawImpl_Compact(LPDIRECTDRAW This)
108 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
109 IDirectDraw, IDirectDraw7,
113 static HRESULT WINAPI
114 IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This)
116 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
117 IDirectDraw2, IDirectDraw7,
121 static HRESULT WINAPI
122 IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This)
124 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
125 IDirectDraw4, IDirectDraw7,
129 static HRESULT WINAPI
130 IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This, DWORD dwFlags,
131 LPDIRECTDRAWCLIPPER *ppClipper,
134 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
138 dwFlags, ppClipper, pUnkOuter);
141 static HRESULT WINAPI
142 IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This, DWORD dwFlags,
143 LPDIRECTDRAWCLIPPER *ppClipper,
146 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
150 dwFlags, ppClipper, pUnkOuter);
153 static HRESULT WINAPI
154 IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This, DWORD dwFlags,
155 LPDIRECTDRAWCLIPPER *ppClipper,
158 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
162 dwFlags, ppClipper, pUnkOuter);
165 static HRESULT WINAPI
166 IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This, DWORD dwFlags,
167 LPPALETTEENTRY pEntries,
168 LPDIRECTDRAWPALETTE *ppPalette,
171 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
175 dwFlags, pEntries, ppPalette, pUnkOuter);
178 static HRESULT WINAPI
179 IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This, DWORD dwFlags,
180 LPPALETTEENTRY pEntries,
181 LPDIRECTDRAWPALETTE *ppPalette,
184 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
188 dwFlags, pEntries, ppPalette, pUnkOuter);
191 static HRESULT WINAPI
192 IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
193 LPPALETTEENTRY pEntries,
194 LPDIRECTDRAWPALETTE *ppPalette,
197 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
201 dwFlags, pEntries, ppPalette, pUnkOuter);
204 static HRESULT WINAPI
205 IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
206 LPDIRECTDRAWSURFACE *ppSurface,
209 LPDIRECTDRAWSURFACE7 pSurface7;
212 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
213 * since the data layout is the same */
214 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
218 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
220 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
221 * IDirectDrawSurface vtable layout at the beginning */
222 *ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
223 IDirectDrawSurface7, IDirectDrawSurface3,
229 static HRESULT WINAPI
230 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
231 LPDIRECTDRAWSURFACE *ppSurface,
234 LPDIRECTDRAWSURFACE7 pSurface7;
237 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
241 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
243 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
244 * IDirectDrawSurface vtable layout at the beginning */
245 *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
246 IDirectDrawSurface7, IDirectDrawSurface3,
252 static HRESULT WINAPI
253 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
254 LPDIRECTDRAWSURFACE4 *ppSurface,
257 return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
262 (LPDIRECTDRAWSURFACE7 *)ppSurface,
266 static HRESULT WINAPI
267 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
268 LPDIRECTDRAWSURFACE *ppDst)
270 LPDIRECTDRAWSURFACE7 pDst7;
273 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
276 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
282 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
283 * IDirectDrawSurface vtable layout at the beginning */
284 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
285 IDirectDrawSurface3, pDst7);
290 static HRESULT WINAPI
291 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
292 LPDIRECTDRAWSURFACE *ppDst)
294 LPDIRECTDRAWSURFACE7 pDst7;
297 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
300 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
306 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
307 * IDirectDrawSurface vtable layout at the beginning */
308 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
309 IDirectDrawSurface3, pDst7);
314 static HRESULT WINAPI
315 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This,
316 LPDIRECTDRAWSURFACE4 pSrc,
317 LPDIRECTDRAWSURFACE4 *ppDst)
319 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
323 (LPDIRECTDRAWSURFACE7)pSrc,
324 (LPDIRECTDRAWSURFACE7 *)ppDst);
327 struct displaymodescallback_context
329 LPDDENUMMODESCALLBACK func;
333 static HRESULT CALLBACK
334 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context)
337 struct displaymodescallback_context *cbcontext = context;
339 memcpy(&DDSD,pDDSD2,sizeof(DDSD));
340 DDSD.dwSize = sizeof(DDSD);
342 return cbcontext->func(&DDSD, cbcontext->context);
345 static HRESULT WINAPI
346 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
347 LPDDSURFACEDESC pDDSD, LPVOID context,
348 LPDDENUMMODESCALLBACK cb)
350 struct displaymodescallback_context cbcontext;
353 cbcontext.context = context;
355 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
359 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
360 EnumDisplayModesCallbackThunk);
363 static HRESULT WINAPI
364 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
365 LPDDSURFACEDESC pDDSD, LPVOID context,
366 LPDDENUMMODESCALLBACK cb)
368 struct displaymodescallback_context cbcontext;
371 cbcontext.context = context;
373 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
377 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
378 EnumDisplayModesCallbackThunk);
381 static HRESULT WINAPI
382 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags,
383 LPDDSURFACEDESC2 pDDSD, LPVOID context,
384 LPDDENUMMODESCALLBACK2 cb)
386 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
390 dwFlags, pDDSD, context, cb);
393 struct surfacescallback_context
395 LPDDENUMSURFACESCALLBACK func;
399 static HRESULT CALLBACK
400 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
403 struct surfacescallback_context *cbcontext = context;
405 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
406 * IDirectDrawSurface vtable layout at the beginning */
407 return cbcontext->func((LPDIRECTDRAWSURFACE)
408 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
410 IDirectDrawSurface3, pSurf),
411 (LPDDSURFACEDESC)pDDSD, cbcontext->context);
414 static HRESULT WINAPI
415 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags,
416 LPDDSURFACEDESC pDDSD, LPVOID context,
417 LPDDENUMSURFACESCALLBACK cb)
419 struct surfacescallback_context cbcontext;
422 cbcontext.context = context;
424 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
427 dwFlags, (LPDDSURFACEDESC2)pDDSD,
428 &cbcontext, EnumSurfacesCallbackThunk);
431 static HRESULT WINAPI
432 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags,
433 LPDDSURFACEDESC pDDSD, LPVOID context,
434 LPDDENUMSURFACESCALLBACK cb)
436 struct surfacescallback_context cbcontext;
439 cbcontext.context = context;
441 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
444 dwFlags, (LPDDSURFACEDESC2)pDDSD,
445 &cbcontext, EnumSurfacesCallbackThunk);
448 static HRESULT WINAPI
449 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags,
450 LPDDSURFACEDESC2 pDDSD, LPVOID context,
451 LPDDENUMSURFACESCALLBACK2 cb)
453 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
456 dwFlags, pDDSD, context,
457 (LPDDENUMSURFACESCALLBACK7)cb);
460 static HRESULT WINAPI
461 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This)
463 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
469 static HRESULT WINAPI
470 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This)
472 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
478 static HRESULT WINAPI
479 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This)
481 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
487 static HRESULT WINAPI
488 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
490 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
491 IDirectDraw, IDirectDraw7,
492 This), pDDC1, pDDC2);
495 static HRESULT WINAPI
496 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
498 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
499 IDirectDraw2, IDirectDraw7,
500 This), pDDC1, pDDC2);
503 static HRESULT WINAPI
504 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
506 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
507 IDirectDraw4, IDirectDraw7,
508 This), pDDC1, pDDC2);
511 static HRESULT WINAPI
512 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD)
514 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
517 (LPDDSURFACEDESC2)pDDSD);
520 static HRESULT WINAPI
521 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD)
523 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
526 (LPDDSURFACEDESC2)pDDSD);
529 static HRESULT WINAPI
530 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD)
532 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
538 static HRESULT WINAPI
539 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes,
542 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
546 lpNumCodes, lpCodes);
549 static HRESULT WINAPI
550 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes,
553 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
557 lpNumCodes, lpCodes);
560 static HRESULT WINAPI
561 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes,
564 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
568 lpNumCodes, lpCodes);
571 static HRESULT WINAPI
572 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
574 LPDIRECTDRAWSURFACE7 pSurf7;
577 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
582 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
583 * IDirectDrawSurface vtable layout at the beginning */
584 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
585 IDirectDrawSurface3, pSurf7);
590 static HRESULT WINAPI
591 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
593 LPDIRECTDRAWSURFACE7 pSurf7;
596 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
601 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
602 * IDirectDrawSurface vtable layout at the beginning */
603 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
604 IDirectDrawSurface3, pSurf7);
609 static HRESULT WINAPI
610 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This,
611 LPDIRECTDRAWSURFACE4 *ppSurf)
613 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
617 (LPDIRECTDRAWSURFACE7 *)ppSurf);
620 static HRESULT WINAPI
621 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq)
623 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
630 static HRESULT WINAPI
631 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq)
633 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
640 static HRESULT WINAPI
641 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq)
643 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
650 static HRESULT WINAPI
651 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This, LPDWORD pdwLine)
653 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
659 static HRESULT WINAPI
660 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This, LPDWORD pdwLine)
662 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
668 static HRESULT WINAPI
669 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This, LPDWORD pdwLine)
671 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
677 static HRESULT WINAPI
678 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This, LPBOOL lpbIsInVB)
680 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
687 static HRESULT WINAPI
688 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This, LPBOOL lpbIsInVB)
690 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
697 static HRESULT WINAPI
698 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This, LPBOOL lpbIsInVB)
700 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
707 static HRESULT WINAPI
708 IDirectDrawImpl_Initialize(LPDIRECTDRAW iface, LPGUID pGUID)
710 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw, iface);
713 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
715 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
716 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
721 static HRESULT WINAPI
722 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID)
724 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw2, iface);
727 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
729 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
730 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
735 static HRESULT WINAPI
736 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID)
738 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw4, iface);
741 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
743 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
744 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
750 static HRESULT WINAPI
751 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This)
753 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
759 static HRESULT WINAPI
760 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This)
762 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
768 static HRESULT WINAPI
769 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This)
771 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
777 static HRESULT WINAPI
778 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This, HWND hWnd,
781 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
788 static HRESULT WINAPI
789 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This, HWND hWnd,
792 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
799 static HRESULT WINAPI
800 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This, HWND hWnd,
803 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
810 static HRESULT WINAPI
811 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This, DWORD a, DWORD b, DWORD c)
813 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
820 static HRESULT WINAPI
821 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This, DWORD a, DWORD b, DWORD c,
824 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
831 static HRESULT WINAPI
832 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This, DWORD a, DWORD b, DWORD c,
835 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
842 static HRESULT WINAPI
843 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This, DWORD dwFlags,
846 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
853 static HRESULT WINAPI
854 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This, DWORD dwFlags,
857 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
864 static HRESULT WINAPI
865 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This, DWORD dwFlags,
868 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
875 static HRESULT WINAPI
876 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This, LPDDSCAPS pCaps,
877 LPDWORD pdwTotal, LPDWORD pdwFree)
880 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
882 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
886 &Caps2, pdwTotal, pdwFree);
889 static HRESULT WINAPI
890 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This, LPDDSCAPS2 pCaps,
891 LPDWORD pdwTotal, LPDWORD pdwFree)
893 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
897 pCaps, pdwTotal, pdwFree);
900 static HRESULT WINAPI
901 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This, HDC hDC,
902 LPDIRECTDRAWSURFACE4 *pSurf)
904 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
908 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
911 static HRESULT WINAPI
912 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This)
914 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
920 static HRESULT WINAPI
921 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This)
923 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
929 static HRESULT WINAPI
930 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This,
931 LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
933 DDDEVICEIDENTIFIER2 DDDI2;
936 hr = IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl,
942 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&DDDI2, pDDDI);
947 const IDirectDrawVtbl DDRAW_IDirectDraw_VTable =
949 IDirectDrawImpl_QueryInterface,
950 IDirectDrawImpl_AddRef,
951 IDirectDrawImpl_Release,
952 IDirectDrawImpl_Compact,
953 IDirectDrawImpl_CreateClipper,
954 IDirectDrawImpl_CreatePalette,
955 IDirectDrawImpl_CreateSurface,
956 IDirectDrawImpl_DuplicateSurface,
957 IDirectDrawImpl_EnumDisplayModes,
958 IDirectDrawImpl_EnumSurfaces,
959 IDirectDrawImpl_FlipToGDISurface,
960 IDirectDrawImpl_GetCaps,
961 IDirectDrawImpl_GetDisplayMode,
962 IDirectDrawImpl_GetFourCCCodes,
963 IDirectDrawImpl_GetGDISurface,
964 IDirectDrawImpl_GetMonitorFrequency,
965 IDirectDrawImpl_GetScanLine,
966 IDirectDrawImpl_GetVerticalBlankStatus,
967 IDirectDrawImpl_Initialize,
968 IDirectDrawImpl_RestoreDisplayMode,
969 IDirectDrawImpl_SetCooperativeLevel,
970 IDirectDrawImpl_SetDisplayMode,
971 IDirectDrawImpl_WaitForVerticalBlank,
974 const IDirectDraw2Vtbl DDRAW_IDirectDraw2_VTable =
976 IDirectDraw2Impl_QueryInterface,
977 IDirectDraw2Impl_AddRef,
978 IDirectDraw2Impl_Release,
979 IDirectDraw2Impl_Compact,
980 IDirectDraw2Impl_CreateClipper,
981 IDirectDraw2Impl_CreatePalette,
982 IDirectDraw2Impl_CreateSurface,
983 IDirectDraw2Impl_DuplicateSurface,
984 IDirectDraw2Impl_EnumDisplayModes,
985 IDirectDraw2Impl_EnumSurfaces,
986 IDirectDraw2Impl_FlipToGDISurface,
987 IDirectDraw2Impl_GetCaps,
988 IDirectDraw2Impl_GetDisplayMode,
989 IDirectDraw2Impl_GetFourCCCodes,
990 IDirectDraw2Impl_GetGDISurface,
991 IDirectDraw2Impl_GetMonitorFrequency,
992 IDirectDraw2Impl_GetScanLine,
993 IDirectDraw2Impl_GetVerticalBlankStatus,
994 IDirectDraw2Impl_Initialize,
995 IDirectDraw2Impl_RestoreDisplayMode,
996 IDirectDraw2Impl_SetCooperativeLevel,
997 IDirectDraw2Impl_SetDisplayMode,
998 IDirectDraw2Impl_WaitForVerticalBlank,
999 IDirectDraw2Impl_GetAvailableVidMem
1002 const IDirectDraw4Vtbl DDRAW_IDirectDraw4_VTable =
1004 IDirectDraw4Impl_QueryInterface,
1005 IDirectDraw4Impl_AddRef,
1006 IDirectDraw4Impl_Release,
1007 IDirectDraw4Impl_Compact,
1008 IDirectDraw4Impl_CreateClipper,
1009 IDirectDraw4Impl_CreatePalette,
1010 IDirectDraw4Impl_CreateSurface,
1011 IDirectDraw4Impl_DuplicateSurface,
1012 IDirectDraw4Impl_EnumDisplayModes,
1013 IDirectDraw4Impl_EnumSurfaces,
1014 IDirectDraw4Impl_FlipToGDISurface,
1015 IDirectDraw4Impl_GetCaps,
1016 IDirectDraw4Impl_GetDisplayMode,
1017 IDirectDraw4Impl_GetFourCCCodes,
1018 IDirectDraw4Impl_GetGDISurface,
1019 IDirectDraw4Impl_GetMonitorFrequency,
1020 IDirectDraw4Impl_GetScanLine,
1021 IDirectDraw4Impl_GetVerticalBlankStatus,
1022 IDirectDraw4Impl_Initialize,
1023 IDirectDraw4Impl_RestoreDisplayMode,
1024 IDirectDraw4Impl_SetCooperativeLevel,
1025 IDirectDraw4Impl_SetDisplayMode,
1026 IDirectDraw4Impl_WaitForVerticalBlank,
1027 IDirectDraw4Impl_GetAvailableVidMem,
1028 IDirectDraw4Impl_GetSurfaceFromDC,
1029 IDirectDraw4Impl_RestoreAllSurfaces,
1030 IDirectDraw4Impl_TestCooperativeLevel,
1031 IDirectDraw4Impl_GetDeviceIdentifier