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
24 #include "ddraw_private.h"
25 #include "ddcomimpl.h"
28 IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This, REFIID iid, LPVOID *ppObj)
30 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
37 IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This, REFIID iid, LPVOID *ppObj)
39 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
47 IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This, REFIID iid, LPVOID *ppObj)
49 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
56 IDirectDrawImpl_AddRef(LPDIRECTDRAW This)
58 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
59 IDirectDraw, IDirectDraw7,
64 IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 This)
66 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
67 IDirectDraw2, IDirectDraw7,
72 IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 This)
74 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl,
75 IDirectDraw4, IDirectDraw7,
80 IDirectDrawImpl_Release(LPDIRECTDRAW This)
82 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
83 IDirectDraw, IDirectDraw7,
88 IDirectDraw2Impl_Release(LPDIRECTDRAW2 This)
90 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
91 IDirectDraw2, IDirectDraw7,
96 IDirectDraw4Impl_Release(LPDIRECTDRAW4 This)
98 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
99 IDirectDraw4, IDirectDraw7,
103 static HRESULT WINAPI
104 IDirectDrawImpl_Compact(LPDIRECTDRAW This)
106 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
107 IDirectDraw, IDirectDraw7,
111 static HRESULT WINAPI
112 IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This)
114 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
115 IDirectDraw2, IDirectDraw7,
119 static HRESULT WINAPI
120 IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This)
122 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
123 IDirectDraw4, IDirectDraw7,
127 static HRESULT WINAPI
128 IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This, DWORD dwFlags,
129 LPDIRECTDRAWCLIPPER *ppClipper,
132 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
136 dwFlags, ppClipper, pUnkOuter);
139 static HRESULT WINAPI
140 IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This, DWORD dwFlags,
141 LPDIRECTDRAWCLIPPER *ppClipper,
144 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
148 dwFlags, ppClipper, pUnkOuter);
151 static HRESULT WINAPI
152 IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This, DWORD dwFlags,
153 LPDIRECTDRAWCLIPPER *ppClipper,
156 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
160 dwFlags, ppClipper, pUnkOuter);
163 static HRESULT WINAPI
164 IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This, DWORD dwFlags,
165 LPPALETTEENTRY pEntries,
166 LPDIRECTDRAWPALETTE *ppPalette,
169 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
173 dwFlags, pEntries, ppPalette, pUnkOuter);
176 static HRESULT WINAPI
177 IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This, DWORD dwFlags,
178 LPPALETTEENTRY pEntries,
179 LPDIRECTDRAWPALETTE *ppPalette,
182 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
186 dwFlags, pEntries, ppPalette, pUnkOuter);
189 static HRESULT WINAPI
190 IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
191 LPPALETTEENTRY pEntries,
192 LPDIRECTDRAWPALETTE *ppPalette,
195 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
199 dwFlags, pEntries, ppPalette, pUnkOuter);
202 static HRESULT WINAPI
203 IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
204 LPDIRECTDRAWSURFACE *ppSurface,
207 LPDIRECTDRAWSURFACE7 pSurface7;
210 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
211 * since the data layout is the same */
212 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
216 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
218 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
219 * IDirectDrawSurface vtable layout at the beginning */
220 *ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
221 IDirectDrawSurface7, IDirectDrawSurface3,
227 static HRESULT WINAPI
228 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
229 LPDIRECTDRAWSURFACE *ppSurface,
232 LPDIRECTDRAWSURFACE7 pSurface7;
235 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
239 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
241 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
242 * IDirectDrawSurface vtable layout at the beginning */
243 *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
244 IDirectDrawSurface7, IDirectDrawSurface3,
250 static HRESULT WINAPI
251 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
252 LPDIRECTDRAWSURFACE4 *ppSurface,
255 return IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
260 (LPDIRECTDRAWSURFACE7 *)ppSurface,
264 static HRESULT WINAPI
265 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
266 LPDIRECTDRAWSURFACE *ppDst)
268 LPDIRECTDRAWSURFACE7 pDst7;
271 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
274 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
280 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
281 * IDirectDrawSurface vtable layout at the beginning */
282 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
283 IDirectDrawSurface3, pDst7);
288 static HRESULT WINAPI
289 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
290 LPDIRECTDRAWSURFACE *ppDst)
292 LPDIRECTDRAWSURFACE7 pDst7;
295 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
298 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
304 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
305 * IDirectDrawSurface vtable layout at the beginning */
306 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
307 IDirectDrawSurface3, pDst7);
312 static HRESULT WINAPI
313 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This,
314 LPDIRECTDRAWSURFACE4 pSrc,
315 LPDIRECTDRAWSURFACE4 *ppDst)
317 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
321 (LPDIRECTDRAWSURFACE7)pSrc,
322 (LPDIRECTDRAWSURFACE7 *)ppDst);
325 struct displaymodescallback_context
327 LPDDENUMMODESCALLBACK func;
331 static HRESULT CALLBACK
332 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context)
335 struct displaymodescallback_context *cbcontext = context;
337 memcpy(&DDSD,pDDSD2,sizeof(DDSD));
338 DDSD.dwSize = sizeof(DDSD);
340 return cbcontext->func(&DDSD, cbcontext->context);
343 static HRESULT WINAPI
344 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
345 LPDDSURFACEDESC pDDSD, LPVOID context,
346 LPDDENUMMODESCALLBACK cb)
348 struct displaymodescallback_context cbcontext;
351 cbcontext.context = context;
353 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
357 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
358 EnumDisplayModesCallbackThunk);
361 static HRESULT WINAPI
362 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
363 LPDDSURFACEDESC pDDSD, LPVOID context,
364 LPDDENUMMODESCALLBACK cb)
366 struct displaymodescallback_context cbcontext;
369 cbcontext.context = context;
371 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
375 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
376 EnumDisplayModesCallbackThunk);
379 static HRESULT WINAPI
380 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags,
381 LPDDSURFACEDESC2 pDDSD, LPVOID context,
382 LPDDENUMMODESCALLBACK2 cb)
384 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
388 dwFlags, pDDSD, context, cb);
391 struct surfacescallback_context
393 LPDDENUMSURFACESCALLBACK func;
397 static HRESULT CALLBACK
398 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
401 struct surfacescallback_context *cbcontext = context;
403 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
404 * IDirectDrawSurface vtable layout at the beginning */
405 return cbcontext->func((LPDIRECTDRAWSURFACE)
406 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
408 IDirectDrawSurface3, pSurf),
409 (LPDDSURFACEDESC)pDDSD, cbcontext->context);
412 static HRESULT WINAPI
413 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags,
414 LPDDSURFACEDESC pDDSD, LPVOID context,
415 LPDDENUMSURFACESCALLBACK cb)
417 struct surfacescallback_context cbcontext;
420 cbcontext.context = context;
422 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
425 dwFlags, (LPDDSURFACEDESC2)pDDSD,
426 &cbcontext, EnumSurfacesCallbackThunk);
429 static HRESULT WINAPI
430 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags,
431 LPDDSURFACEDESC pDDSD, LPVOID context,
432 LPDDENUMSURFACESCALLBACK cb)
434 struct surfacescallback_context cbcontext;
437 cbcontext.context = context;
439 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
442 dwFlags, (LPDDSURFACEDESC2)pDDSD,
443 &cbcontext, EnumSurfacesCallbackThunk);
446 static HRESULT WINAPI
447 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags,
448 LPDDSURFACEDESC2 pDDSD, LPVOID context,
449 LPDDENUMSURFACESCALLBACK2 cb)
451 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
454 dwFlags, pDDSD, context,
455 (LPDDENUMSURFACESCALLBACK7)cb);
458 static HRESULT WINAPI
459 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This)
461 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
467 static HRESULT WINAPI
468 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This)
470 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
476 static HRESULT WINAPI
477 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This)
479 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
485 static HRESULT WINAPI
486 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
488 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
489 IDirectDraw, IDirectDraw7,
490 This), pDDC1, pDDC2);
493 static HRESULT WINAPI
494 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
496 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
497 IDirectDraw2, IDirectDraw7,
498 This), pDDC1, pDDC2);
501 static HRESULT WINAPI
502 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
504 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
505 IDirectDraw4, IDirectDraw7,
506 This), pDDC1, pDDC2);
509 static HRESULT WINAPI
510 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD)
512 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
515 (LPDDSURFACEDESC2)pDDSD);
518 static HRESULT WINAPI
519 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD)
521 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
524 (LPDDSURFACEDESC2)pDDSD);
527 static HRESULT WINAPI
528 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD)
530 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
536 static HRESULT WINAPI
537 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes,
540 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
544 lpNumCodes, lpCodes);
547 static HRESULT WINAPI
548 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes,
551 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
555 lpNumCodes, lpCodes);
558 static HRESULT WINAPI
559 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes,
562 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
566 lpNumCodes, lpCodes);
569 static HRESULT WINAPI
570 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
572 LPDIRECTDRAWSURFACE7 pSurf7;
575 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
580 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
581 * IDirectDrawSurface vtable layout at the beginning */
582 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
583 IDirectDrawSurface3, pSurf7);
588 static HRESULT WINAPI
589 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
591 LPDIRECTDRAWSURFACE7 pSurf7;
594 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
599 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
600 * IDirectDrawSurface vtable layout at the beginning */
601 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
602 IDirectDrawSurface3, pSurf7);
607 static HRESULT WINAPI
608 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This,
609 LPDIRECTDRAWSURFACE4 *ppSurf)
611 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
615 (LPDIRECTDRAWSURFACE7 *)ppSurf);
618 static HRESULT WINAPI
619 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq)
621 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
628 static HRESULT WINAPI
629 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq)
631 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
638 static HRESULT WINAPI
639 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq)
641 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
648 static HRESULT WINAPI
649 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This, LPDWORD pdwLine)
651 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
657 static HRESULT WINAPI
658 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This, LPDWORD pdwLine)
660 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
666 static HRESULT WINAPI
667 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This, LPDWORD pdwLine)
669 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
675 static HRESULT WINAPI
676 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This, LPBOOL lpbIsInVB)
678 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
685 static HRESULT WINAPI
686 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This, LPBOOL lpbIsInVB)
688 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
695 static HRESULT WINAPI
696 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This, LPBOOL lpbIsInVB)
698 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
705 static HRESULT WINAPI
706 IDirectDrawImpl_Initialize(LPDIRECTDRAW iface, LPGUID pGUID)
708 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw, iface);
711 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
713 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
714 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
719 static HRESULT WINAPI
720 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID)
722 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw2, iface);
725 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
727 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
728 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
733 static HRESULT WINAPI
734 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID)
736 ICOM_THIS_FROM(IDirectDrawImpl, IDirectDraw4, iface);
739 ret_value = IDirectDraw7_Initialize(ICOM_INTERFACE(This, IDirectDraw7), pGUID);
741 /* Overwrite the falsely set 'DIRECTDRAW7' flag */
742 This->local.dwLocalFlags &= ~DDRAWILCL_DIRECTDRAW7;
748 static HRESULT WINAPI
749 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This)
751 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
757 static HRESULT WINAPI
758 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This)
760 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
766 static HRESULT WINAPI
767 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This)
769 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
775 static HRESULT WINAPI
776 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This, HWND hWnd,
779 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
786 static HRESULT WINAPI
787 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This, HWND hWnd,
790 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
797 static HRESULT WINAPI
798 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This, HWND hWnd,
801 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
808 static HRESULT WINAPI
809 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This, DWORD a, DWORD b, DWORD c)
811 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
818 static HRESULT WINAPI
819 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This, DWORD a, DWORD b, DWORD c,
822 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
829 static HRESULT WINAPI
830 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This, DWORD a, DWORD b, DWORD c,
833 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
840 static HRESULT WINAPI
841 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This, DWORD dwFlags,
844 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
851 static HRESULT WINAPI
852 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This, DWORD dwFlags,
855 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
862 static HRESULT WINAPI
863 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This, DWORD dwFlags,
866 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
873 static HRESULT WINAPI
874 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This, LPDDSCAPS pCaps,
875 LPDWORD pdwTotal, LPDWORD pdwFree)
878 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
880 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
884 &Caps2, pdwTotal, pdwFree);
887 static HRESULT WINAPI
888 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This, LPDDSCAPS2 pCaps,
889 LPDWORD pdwTotal, LPDWORD pdwFree)
891 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
895 pCaps, pdwTotal, pdwFree);
898 static HRESULT WINAPI
899 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This, HDC hDC,
900 LPDIRECTDRAWSURFACE4 *pSurf)
902 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
906 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
909 static HRESULT WINAPI
910 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This)
912 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
918 static HRESULT WINAPI
919 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This)
921 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
927 static HRESULT WINAPI
928 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This,
929 LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
931 DDDEVICEIDENTIFIER2 DDDI2;
934 hr = IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl,
940 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&DDDI2, pDDDI);
945 ICOM_VTABLE(IDirectDraw) DDRAW_IDirectDraw_VTable =
947 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
948 IDirectDrawImpl_QueryInterface,
949 IDirectDrawImpl_AddRef,
950 IDirectDrawImpl_Release,
951 IDirectDrawImpl_Compact,
952 IDirectDrawImpl_CreateClipper,
953 IDirectDrawImpl_CreatePalette,
954 IDirectDrawImpl_CreateSurface,
955 IDirectDrawImpl_DuplicateSurface,
956 IDirectDrawImpl_EnumDisplayModes,
957 IDirectDrawImpl_EnumSurfaces,
958 IDirectDrawImpl_FlipToGDISurface,
959 IDirectDrawImpl_GetCaps,
960 IDirectDrawImpl_GetDisplayMode,
961 IDirectDrawImpl_GetFourCCCodes,
962 IDirectDrawImpl_GetGDISurface,
963 IDirectDrawImpl_GetMonitorFrequency,
964 IDirectDrawImpl_GetScanLine,
965 IDirectDrawImpl_GetVerticalBlankStatus,
966 IDirectDrawImpl_Initialize,
967 IDirectDrawImpl_RestoreDisplayMode,
968 IDirectDrawImpl_SetCooperativeLevel,
969 IDirectDrawImpl_SetDisplayMode,
970 IDirectDrawImpl_WaitForVerticalBlank,
973 ICOM_VTABLE(IDirectDraw2) DDRAW_IDirectDraw2_VTable =
975 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
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 ICOM_VTABLE(IDirectDraw4) DDRAW_IDirectDraw4_VTable =
1004 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1005 IDirectDraw4Impl_QueryInterface,
1006 IDirectDraw4Impl_AddRef,
1007 IDirectDraw4Impl_Release,
1008 IDirectDraw4Impl_Compact,
1009 IDirectDraw4Impl_CreateClipper,
1010 IDirectDraw4Impl_CreatePalette,
1011 IDirectDraw4Impl_CreateSurface,
1012 IDirectDraw4Impl_DuplicateSurface,
1013 IDirectDraw4Impl_EnumDisplayModes,
1014 IDirectDraw4Impl_EnumSurfaces,
1015 IDirectDraw4Impl_FlipToGDISurface,
1016 IDirectDraw4Impl_GetCaps,
1017 IDirectDraw4Impl_GetDisplayMode,
1018 IDirectDraw4Impl_GetFourCCCodes,
1019 IDirectDraw4Impl_GetGDISurface,
1020 IDirectDraw4Impl_GetMonitorFrequency,
1021 IDirectDraw4Impl_GetScanLine,
1022 IDirectDraw4Impl_GetVerticalBlankStatus,
1023 IDirectDraw4Impl_Initialize,
1024 IDirectDraw4Impl_RestoreDisplayMode,
1025 IDirectDraw4Impl_SetCooperativeLevel,
1026 IDirectDraw4Impl_SetDisplayMode,
1027 IDirectDraw4Impl_WaitForVerticalBlank,
1028 IDirectDraw4Impl_GetAvailableVidMem,
1029 IDirectDraw4Impl_GetSurfaceFromDC,
1030 IDirectDraw4Impl_RestoreAllSurfaces,
1031 IDirectDraw4Impl_TestCooperativeLevel,
1032 IDirectDraw4Impl_GetDeviceIdentifier