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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "wine/port.h"
28 #define NONAMELESSUNION
34 #include "wine/exception.h"
39 #include "ddraw_private.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(ddraw_thunk);
43 WINE_DECLARE_DEBUG_CHANNEL(ddraw);
46 IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This, REFIID iid, LPVOID *ppObj)
48 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
55 IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This, REFIID iid, LPVOID *ppObj)
57 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
64 IDirectDraw3Impl_QueryInterface(LPDIRECTDRAW3 This, REFIID iid, LPVOID *ppObj)
66 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
73 IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This, REFIID iid, LPVOID *ppObj)
75 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl,
82 IDirectDrawImpl_AddRef(LPDIRECTDRAW iface)
84 IDirectDrawImpl *This = ddraw_from_ddraw1(iface);
85 ULONG ref = InterlockedIncrement(&This->ref1);
87 TRACE("(%p) : incrementing IDirectDraw refcount from %u.\n", This, ref -1);
89 if(ref == 1) InterlockedIncrement(&This->numIfaces);
95 IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 iface)
97 IDirectDrawImpl *This = ddraw_from_ddraw2(iface);
98 ULONG ref = InterlockedIncrement(&This->ref2);
100 TRACE("(%p) : incrementing IDirectDraw2 refcount from %u.\n", This, ref -1);
102 if(ref == 1) InterlockedIncrement(&This->numIfaces);
108 IDirectDraw3Impl_AddRef(LPDIRECTDRAW3 iface)
110 IDirectDrawImpl *This = ddraw_from_ddraw3(iface);
111 ULONG ref = InterlockedIncrement(&This->ref3);
113 TRACE("(%p) : incrementing IDirectDraw3 refcount from %u.\n", This, ref -1);
115 if(ref == 1) InterlockedIncrement(&This->numIfaces);
121 IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 iface)
123 IDirectDrawImpl *This = ddraw_from_ddraw4(iface);
124 ULONG ref = InterlockedIncrement(&This->ref4);
126 TRACE("(%p) : incrementing IDirectDraw4 refcount from %u.\n", This, ref -1);
128 if(ref == 1) InterlockedIncrement(&This->numIfaces);
134 IDirectDrawImpl_Release(LPDIRECTDRAW iface)
136 IDirectDrawImpl *This = ddraw_from_ddraw1(iface);
137 ULONG ref = InterlockedDecrement(&This->ref1);
139 TRACE_(ddraw)("(%p)->() decrementing IDirectDraw refcount from %u.\n", This, ref +1);
143 ULONG ifacecount = InterlockedDecrement(&This->numIfaces);
144 if(ifacecount == 0) IDirectDrawImpl_Destroy(This);
151 IDirectDraw2Impl_Release(LPDIRECTDRAW2 iface)
153 IDirectDrawImpl *This = ddraw_from_ddraw2(iface);
154 ULONG ref = InterlockedDecrement(&This->ref2);
156 TRACE_(ddraw)("(%p)->() decrementing IDirectDraw2 refcount from %u.\n", This, ref +1);
160 ULONG ifacecount = InterlockedDecrement(&This->numIfaces);
161 if(ifacecount == 0) IDirectDrawImpl_Destroy(This);
168 IDirectDraw3Impl_Release(LPDIRECTDRAW3 iface)
170 IDirectDrawImpl *This = ddraw_from_ddraw3(iface);
171 ULONG ref = InterlockedDecrement(&This->ref3);
173 TRACE_(ddraw)("(%p)->() decrementing IDirectDraw3 refcount from %u.\n", This, ref +1);
177 ULONG ifacecount = InterlockedDecrement(&This->numIfaces);
178 if(ifacecount == 0) IDirectDrawImpl_Destroy(This);
185 IDirectDraw4Impl_Release(LPDIRECTDRAW4 iface)
187 IDirectDrawImpl *This = ddraw_from_ddraw4(iface);
188 ULONG ref = InterlockedDecrement(&This->ref4);
190 TRACE_(ddraw)("(%p)->() decrementing IDirectDraw4 refcount from %u.\n", This, ref +1);
194 ULONG ifacecount = InterlockedDecrement(&This->numIfaces);
195 if(ifacecount == 0) IDirectDrawImpl_Destroy(This);
201 static HRESULT WINAPI
202 IDirectDrawImpl_Compact(LPDIRECTDRAW This)
204 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
205 IDirectDraw, IDirectDraw7,
209 static HRESULT WINAPI
210 IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This)
212 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
213 IDirectDraw2, IDirectDraw7,
217 static HRESULT WINAPI
218 IDirectDraw3Impl_Compact(LPDIRECTDRAW3 This)
220 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
221 IDirectDraw3, IDirectDraw7,
225 static HRESULT WINAPI
226 IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This)
228 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl,
229 IDirectDraw4, IDirectDraw7,
233 static HRESULT WINAPI
234 IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This, DWORD dwFlags,
235 LPDIRECTDRAWCLIPPER *ppClipper,
238 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
242 dwFlags, ppClipper, pUnkOuter);
245 static HRESULT WINAPI
246 IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This, DWORD dwFlags,
247 LPDIRECTDRAWCLIPPER *ppClipper,
250 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
254 dwFlags, ppClipper, pUnkOuter);
257 static HRESULT WINAPI
258 IDirectDraw3Impl_CreateClipper(LPDIRECTDRAW3 This, DWORD dwFlags,
259 LPDIRECTDRAWCLIPPER *ppClipper,
262 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
266 dwFlags, ppClipper, pUnkOuter);
269 static HRESULT WINAPI
270 IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This, DWORD dwFlags,
271 LPDIRECTDRAWCLIPPER *ppClipper,
274 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl,
278 dwFlags, ppClipper, pUnkOuter);
281 static HRESULT WINAPI
282 IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This, DWORD dwFlags,
283 LPPALETTEENTRY pEntries,
284 LPDIRECTDRAWPALETTE *ppPalette,
288 hr = IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
292 dwFlags, pEntries, ppPalette, pUnkOuter);
293 if(SUCCEEDED(hr) && *ppPalette)
295 IDirectDrawPaletteImpl *impl = (IDirectDrawPaletteImpl *)*ppPalette;
296 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
300 impl->ifaceToRelease = NULL;
306 static HRESULT WINAPI
307 IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This, DWORD dwFlags,
308 LPPALETTEENTRY pEntries,
309 LPDIRECTDRAWPALETTE *ppPalette,
313 hr = IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
317 dwFlags, pEntries, ppPalette, pUnkOuter);
318 if(SUCCEEDED(hr) && *ppPalette)
320 IDirectDrawPaletteImpl *impl = (IDirectDrawPaletteImpl *)*ppPalette;
321 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
325 impl->ifaceToRelease = NULL;
330 static HRESULT WINAPI
331 IDirectDraw3Impl_CreatePalette(LPDIRECTDRAW3 This, DWORD dwFlags,
332 LPPALETTEENTRY pEntries,
333 LPDIRECTDRAWPALETTE *ppPalette,
337 hr = IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
341 dwFlags, pEntries, ppPalette, pUnkOuter);
342 if(SUCCEEDED(hr) && *ppPalette)
344 IDirectDrawPaletteImpl *impl = (IDirectDrawPaletteImpl *)*ppPalette;
345 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
349 IDirectDraw4_AddRef(This);
350 impl->ifaceToRelease = (IUnknown *) This;
355 static HRESULT WINAPI
356 IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This, DWORD dwFlags,
357 LPPALETTEENTRY pEntries,
358 LPDIRECTDRAWPALETTE *ppPalette,
362 hr = IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl,
366 dwFlags, pEntries, ppPalette, pUnkOuter);
367 if(SUCCEEDED(hr) && *ppPalette)
369 IDirectDrawPaletteImpl *impl = (IDirectDrawPaletteImpl *)*ppPalette;
370 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
374 IDirectDraw4_AddRef(This);
375 impl->ifaceToRelease = (IUnknown *) This;
380 /* Must set all attached surfaces (e.g. mipmaps) versions as well */
381 static void set_surf_version(IDirectDrawSurfaceImpl *surf, int version)
384 TRACE("%p->version(%d) = %d\n", surf, surf->version, version);
385 surf->version = version;
386 for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
388 if(!surf->complex_array[i]) break;
389 set_surf_version(surf->complex_array[i], version);
391 while( (surf = surf->next_attached) )
393 set_surf_version(surf, version);
397 static HRESULT WINAPI
398 IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This, LPDDSURFACEDESC pSDesc,
399 LPDIRECTDRAWSURFACE *ppSurface,
402 LPDIRECTDRAWSURFACE7 pSurface7;
403 IDirectDrawSurfaceImpl *impl;
406 /* Remove front buffer flag, this causes failure in v7, and its added to normal
409 pSDesc->ddsCaps.dwCaps &= ~DDSCAPS_FRONTBUFFER;
410 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
411 * since the data layout is the same */
412 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
416 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
418 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
419 * IDirectDrawSurface vtable layout at the beginning */
420 *ppSurface = (LPDIRECTDRAWSURFACE) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
421 IDirectDrawSurface7, IDirectDrawSurface3,
424 impl = (IDirectDrawSurfaceImpl *)pSurface7;
425 if(SUCCEEDED(hr) && impl)
427 set_surf_version(impl, 1);
428 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
432 impl->ifaceToRelease = NULL;
438 static HRESULT WINAPI
439 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This, LPDDSURFACEDESC pSDesc,
440 LPDIRECTDRAWSURFACE *ppSurface,
443 LPDIRECTDRAWSURFACE7 pSurface7;
444 IDirectDrawSurfaceImpl *impl;
447 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
451 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
453 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
454 * IDirectDrawSurface vtable layout at the beginning */
455 *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
456 IDirectDrawSurface7, IDirectDrawSurface3,
459 impl = (IDirectDrawSurfaceImpl *)pSurface7;
460 if(SUCCEEDED(hr) && impl)
462 set_surf_version(impl, 2);
463 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
467 impl->ifaceToRelease = NULL;
473 static HRESULT WINAPI
474 IDirectDraw3Impl_CreateSurface(LPDIRECTDRAW3 This, LPDDSURFACEDESC pSDesc,
475 LPDIRECTDRAWSURFACE *ppSurface,
478 LPDIRECTDRAWSURFACE7 pSurface7;
479 IDirectDrawSurfaceImpl *impl;
482 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
486 (LPDDSURFACEDESC2)pSDesc, &pSurface7, pUnkOuter);
488 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
489 * IDirectDrawSurface vtable layout at the beginning */
490 *ppSurface = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
491 IDirectDrawSurface7, IDirectDrawSurface3,
494 impl = (IDirectDrawSurfaceImpl *)pSurface7;
495 if(SUCCEEDED(hr) && impl)
497 set_surf_version(impl, 3);
498 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
502 IDirectDraw3_AddRef(This);
503 impl->ifaceToRelease = (IUnknown *) This;
509 static HRESULT WINAPI
510 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pSDesc,
511 LPDIRECTDRAWSURFACE4 *ppSurface,
515 IDirectDrawSurfaceImpl *impl;
517 hr = IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
522 (LPDIRECTDRAWSURFACE7 *)ppSurface,
524 impl = (IDirectDrawSurfaceImpl *)*ppSurface;
525 if(SUCCEEDED(hr) && impl)
527 set_surf_version(impl, 4);
528 IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl,
532 IDirectDraw4_AddRef(This);
533 impl->ifaceToRelease = (IUnknown *) This;
538 static HRESULT WINAPI
539 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE pSrc,
540 LPDIRECTDRAWSURFACE *ppDst)
542 LPDIRECTDRAWSURFACE7 pDst7;
545 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
548 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
554 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
555 * IDirectDrawSurface vtable layout at the beginning */
556 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
557 IDirectDrawSurface3, pDst7);
562 static HRESULT WINAPI
563 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE pSrc,
564 LPDIRECTDRAWSURFACE *ppDst)
566 LPDIRECTDRAWSURFACE7 pDst7;
569 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
572 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
578 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
579 * IDirectDrawSurface vtable layout at the beginning */
580 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
581 IDirectDrawSurface3, pDst7);
586 static HRESULT WINAPI
587 IDirectDraw3Impl_DuplicateSurface(LPDIRECTDRAW3 This, LPDIRECTDRAWSURFACE pSrc,
588 LPDIRECTDRAWSURFACE *ppDst)
590 LPDIRECTDRAWSURFACE7 pDst7;
593 hr = IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
596 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
602 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
603 * IDirectDrawSurface vtable layout at the beginning */
604 *ppDst = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
605 IDirectDrawSurface3, pDst7);
610 static HRESULT WINAPI
611 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This,
612 LPDIRECTDRAWSURFACE4 pSrc,
613 LPDIRECTDRAWSURFACE4 *ppDst)
615 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl,
619 (LPDIRECTDRAWSURFACE7)pSrc,
620 (LPDIRECTDRAWSURFACE7 *)ppDst);
623 struct displaymodescallback_context
625 LPDDENUMMODESCALLBACK func;
629 static HRESULT CALLBACK
630 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context)
633 struct displaymodescallback_context *cbcontext = context;
635 memcpy(&DDSD,pDDSD2,sizeof(DDSD));
636 DDSD.dwSize = sizeof(DDSD);
638 return cbcontext->func(&DDSD, cbcontext->context);
641 static HRESULT WINAPI
642 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This, DWORD dwFlags,
643 LPDDSURFACEDESC pDDSD, LPVOID context,
644 LPDDENUMMODESCALLBACK cb)
646 struct displaymodescallback_context cbcontext;
649 cbcontext.context = context;
651 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
655 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
656 EnumDisplayModesCallbackThunk);
659 static HRESULT WINAPI
660 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This, DWORD dwFlags,
661 LPDDSURFACEDESC pDDSD, LPVOID context,
662 LPDDENUMMODESCALLBACK cb)
664 struct displaymodescallback_context cbcontext;
667 cbcontext.context = context;
669 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
673 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
674 EnumDisplayModesCallbackThunk);
677 static HRESULT WINAPI
678 IDirectDraw3Impl_EnumDisplayModes(LPDIRECTDRAW3 This, DWORD dwFlags,
679 LPDDSURFACEDESC pDDSD, LPVOID context,
680 LPDDENUMMODESCALLBACK cb)
682 struct displaymodescallback_context cbcontext;
685 cbcontext.context = context;
687 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
691 dwFlags, (LPDDSURFACEDESC2)pDDSD, &cbcontext,
692 EnumDisplayModesCallbackThunk);
695 static HRESULT WINAPI
696 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This, DWORD dwFlags,
697 LPDDSURFACEDESC2 pDDSD, LPVOID context,
698 LPDDENUMMODESCALLBACK2 cb)
700 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl,
704 dwFlags, pDDSD, context, cb);
707 struct surfacescallback_context
709 LPDDENUMSURFACESCALLBACK func;
713 static HRESULT CALLBACK
714 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf, LPDDSURFACEDESC2 pDDSD,
717 struct surfacescallback_context *cbcontext = context;
719 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
720 * IDirectDrawSurface vtable layout at the beginning */
721 return cbcontext->func((LPDIRECTDRAWSURFACE)
722 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl,
724 IDirectDrawSurface3, pSurf),
725 (LPDDSURFACEDESC)pDDSD, cbcontext->context);
728 static HRESULT WINAPI
729 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This, DWORD dwFlags,
730 LPDDSURFACEDESC pDDSD, LPVOID context,
731 LPDDENUMSURFACESCALLBACK cb)
733 struct surfacescallback_context cbcontext;
736 cbcontext.context = context;
738 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
741 dwFlags, (LPDDSURFACEDESC2)pDDSD,
742 &cbcontext, EnumSurfacesCallbackThunk);
745 static HRESULT WINAPI
746 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This, DWORD dwFlags,
747 LPDDSURFACEDESC pDDSD, LPVOID context,
748 LPDDENUMSURFACESCALLBACK cb)
750 struct surfacescallback_context cbcontext;
753 cbcontext.context = context;
755 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
758 dwFlags, (LPDDSURFACEDESC2)pDDSD,
759 &cbcontext, EnumSurfacesCallbackThunk);
762 static HRESULT WINAPI
763 IDirectDraw3Impl_EnumSurfaces(LPDIRECTDRAW3 This, DWORD dwFlags,
764 LPDDSURFACEDESC pDDSD, LPVOID context,
765 LPDDENUMSURFACESCALLBACK cb)
767 struct surfacescallback_context cbcontext;
770 cbcontext.context = context;
772 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
775 dwFlags, (LPDDSURFACEDESC2)pDDSD,
776 &cbcontext, EnumSurfacesCallbackThunk);
779 static HRESULT WINAPI
780 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This, DWORD dwFlags,
781 LPDDSURFACEDESC2 pDDSD, LPVOID context,
782 LPDDENUMSURFACESCALLBACK2 cb)
784 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
787 dwFlags, pDDSD, context,
788 (LPDDENUMSURFACESCALLBACK7)cb);
791 static HRESULT WINAPI
792 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This)
794 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
800 static HRESULT WINAPI
801 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This)
803 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
809 static HRESULT WINAPI
810 IDirectDraw3Impl_FlipToGDISurface(LPDIRECTDRAW3 This)
812 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
818 static HRESULT WINAPI
819 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This)
821 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
827 static HRESULT WINAPI
828 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
830 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
831 IDirectDraw, IDirectDraw7,
832 This), pDDC1, pDDC2);
835 static HRESULT WINAPI
836 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
838 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
839 IDirectDraw2, IDirectDraw7,
840 This), pDDC1, pDDC2);
843 static HRESULT WINAPI
844 IDirectDraw3Impl_GetCaps(LPDIRECTDRAW3 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
846 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
847 IDirectDraw3, IDirectDraw7,
848 This), pDDC1, pDDC2);
851 static HRESULT WINAPI
852 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
854 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl,
855 IDirectDraw4, IDirectDraw7,
856 This), pDDC1, pDDC2);
859 static HRESULT WINAPI
860 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This, LPDDSURFACEDESC pDDSD)
862 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
865 (LPDDSURFACEDESC2)pDDSD);
868 static HRESULT WINAPI
869 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This, LPDDSURFACEDESC pDDSD)
871 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
874 (LPDDSURFACEDESC2)pDDSD);
877 static HRESULT WINAPI
878 IDirectDraw3Impl_GetDisplayMode(LPDIRECTDRAW3 This, LPDDSURFACEDESC pDDSD)
880 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
883 (LPDDSURFACEDESC2)pDDSD);
886 static HRESULT WINAPI
887 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This, LPDDSURFACEDESC2 pDDSD)
889 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
895 static HRESULT WINAPI
896 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This, LPDWORD lpNumCodes,
899 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
903 lpNumCodes, lpCodes);
906 static HRESULT WINAPI
907 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This, LPDWORD lpNumCodes,
910 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
914 lpNumCodes, lpCodes);
917 static HRESULT WINAPI
918 IDirectDraw3Impl_GetFourCCCodes(LPDIRECTDRAW3 This, LPDWORD lpNumCodes,
921 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
925 lpNumCodes, lpCodes);
928 static HRESULT WINAPI
929 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This, LPDWORD lpNumCodes,
932 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl,
936 lpNumCodes, lpCodes);
939 static HRESULT WINAPI
940 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This, LPDIRECTDRAWSURFACE *ppSurf)
942 LPDIRECTDRAWSURFACE7 pSurf7;
945 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
950 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
951 * IDirectDrawSurface vtable layout at the beginning */
952 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
953 IDirectDrawSurface3, pSurf7);
958 static HRESULT WINAPI
959 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This, LPDIRECTDRAWSURFACE *ppSurf)
961 LPDIRECTDRAWSURFACE7 pSurf7;
964 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
969 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
970 * IDirectDrawSurface vtable layout at the beginning */
971 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
972 IDirectDrawSurface3, pSurf7);
977 static HRESULT WINAPI
978 IDirectDraw3Impl_GetGDISurface(LPDIRECTDRAW3 This, LPDIRECTDRAWSURFACE *ppSurf)
980 LPDIRECTDRAWSURFACE7 pSurf7;
983 hr = IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
988 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
989 * IDirectDrawSurface vtable layout at the beginning */
990 *ppSurf = (LPDIRECTDRAWSURFACE)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, IDirectDrawSurface7,
991 IDirectDrawSurface3, pSurf7);
996 static HRESULT WINAPI
997 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This,
998 LPDIRECTDRAWSURFACE4 *ppSurf)
1000 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl,
1004 (LPDIRECTDRAWSURFACE7 *)ppSurf);
1007 static HRESULT WINAPI
1008 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This, LPDWORD pdwFreq)
1010 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
1017 static HRESULT WINAPI
1018 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This, LPDWORD pdwFreq)
1020 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
1027 static HRESULT WINAPI
1028 IDirectDraw3Impl_GetMonitorFrequency(LPDIRECTDRAW3 This, LPDWORD pdwFreq)
1030 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
1037 static HRESULT WINAPI
1038 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This, LPDWORD pdwFreq)
1040 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl,
1047 static HRESULT WINAPI
1048 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This, LPDWORD pdwLine)
1050 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
1056 static HRESULT WINAPI
1057 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This, LPDWORD pdwLine)
1059 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
1065 static HRESULT WINAPI
1066 IDirectDraw3Impl_GetScanLine(LPDIRECTDRAW3 This, LPDWORD pdwLine)
1068 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
1074 static HRESULT WINAPI
1075 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This, LPDWORD pdwLine)
1077 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl,
1083 static HRESULT WINAPI
1084 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This, LPBOOL lpbIsInVB)
1086 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
1093 static HRESULT WINAPI
1094 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This, LPBOOL lpbIsInVB)
1096 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
1103 static HRESULT WINAPI
1104 IDirectDraw3Impl_GetVerticalBlankStatus(LPDIRECTDRAW3 This, LPBOOL lpbIsInVB)
1106 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
1113 static HRESULT WINAPI
1114 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This, LPBOOL lpbIsInVB)
1116 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl,
1123 static HRESULT WINAPI
1124 IDirectDrawImpl_Initialize(LPDIRECTDRAW iface, LPGUID pGUID)
1126 IDirectDrawImpl *This = ddraw_from_ddraw1(iface);
1129 ret_value = IDirectDraw7_Initialize((IDirectDraw7 *)This, pGUID);
1134 static HRESULT WINAPI
1135 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID)
1137 IDirectDrawImpl *This = ddraw_from_ddraw2(iface);
1140 ret_value = IDirectDraw7_Initialize((IDirectDraw7 *)This, pGUID);
1145 static HRESULT WINAPI
1146 IDirectDraw3Impl_Initialize(LPDIRECTDRAW3 iface, LPGUID pGUID)
1148 IDirectDrawImpl *This = ddraw_from_ddraw3(iface);
1151 ret_value = IDirectDraw7_Initialize((IDirectDraw7 *)This, pGUID);
1156 static HRESULT WINAPI
1157 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID)
1159 IDirectDrawImpl *This = ddraw_from_ddraw4(iface);
1162 ret_value = IDirectDraw7_Initialize((IDirectDraw7 *)This, pGUID);
1168 static HRESULT WINAPI
1169 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This)
1171 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1177 static HRESULT WINAPI
1178 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This)
1180 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1186 static HRESULT WINAPI
1187 IDirectDraw3Impl_RestoreDisplayMode(LPDIRECTDRAW3 This)
1189 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1195 static HRESULT WINAPI
1196 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This)
1198 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1204 static HRESULT WINAPI
1205 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This, HWND hWnd,
1208 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
1215 static HRESULT WINAPI
1216 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This, HWND hWnd,
1219 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
1226 static HRESULT WINAPI
1227 IDirectDraw3Impl_SetCooperativeLevel(LPDIRECTDRAW3 This, HWND hWnd,
1230 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
1237 static HRESULT WINAPI
1238 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This, HWND hWnd,
1241 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
1248 static HRESULT WINAPI
1249 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This, DWORD a, DWORD b, DWORD c)
1251 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1258 static HRESULT WINAPI
1259 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This, DWORD a, DWORD b, DWORD c,
1262 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1269 static HRESULT WINAPI
1270 IDirectDraw3Impl_SetDisplayMode(LPDIRECTDRAW3 This, DWORD a, DWORD b, DWORD c,
1273 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1280 static HRESULT WINAPI
1281 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This, DWORD a, DWORD b, DWORD c,
1284 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl,
1291 static HRESULT WINAPI
1292 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This, DWORD dwFlags,
1295 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
1302 static HRESULT WINAPI
1303 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This, DWORD dwFlags,
1306 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
1313 static HRESULT WINAPI
1314 IDirectDraw3Impl_WaitForVerticalBlank(LPDIRECTDRAW3 This, DWORD dwFlags,
1317 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
1324 static HRESULT WINAPI
1325 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This, DWORD dwFlags,
1328 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl,
1335 static HRESULT WINAPI
1336 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This, LPDDSCAPS pCaps,
1337 LPDWORD pdwTotal, LPDWORD pdwFree)
1340 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
1342 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
1346 &Caps2, pdwTotal, pdwFree);
1349 static HRESULT WINAPI
1350 IDirectDraw3Impl_GetAvailableVidMem(LPDIRECTDRAW3 This, LPDDSCAPS pCaps,
1351 LPDWORD pdwTotal, LPDWORD pdwFree)
1354 DDRAW_Convert_DDSCAPS_1_To_2(pCaps, &Caps2);
1356 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
1360 &Caps2, pdwTotal, pdwFree);
1363 static HRESULT WINAPI
1364 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This, LPDDSCAPS2 pCaps,
1365 LPDWORD pdwTotal, LPDWORD pdwFree)
1367 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl,
1371 pCaps, pdwTotal, pdwFree);
1374 static HRESULT WINAPI
1375 IDirectDraw3Impl_GetSurfaceFromDC(LPDIRECTDRAW3 This, HDC hDC,
1376 LPDIRECTDRAWSURFACE *pSurf)
1378 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
1382 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
1385 static HRESULT WINAPI
1386 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This, HDC hDC,
1387 LPDIRECTDRAWSURFACE4 *pSurf)
1389 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl,
1393 hDC, (LPDIRECTDRAWSURFACE7 *)pSurf);
1396 static HRESULT WINAPI
1397 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This)
1399 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl,
1405 static HRESULT WINAPI
1406 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This)
1408 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl,
1414 static HRESULT WINAPI
1415 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This,
1416 LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
1418 DDDEVICEIDENTIFIER2 DDDI2;
1421 hr = IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl,
1427 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&DDDI2, pDDDI);
1432 const IDirectDrawVtbl IDirectDraw1_Vtbl =
1434 IDirectDrawImpl_QueryInterface,
1435 IDirectDrawImpl_AddRef,
1436 IDirectDrawImpl_Release,
1437 IDirectDrawImpl_Compact,
1438 IDirectDrawImpl_CreateClipper,
1439 IDirectDrawImpl_CreatePalette,
1440 IDirectDrawImpl_CreateSurface,
1441 IDirectDrawImpl_DuplicateSurface,
1442 IDirectDrawImpl_EnumDisplayModes,
1443 IDirectDrawImpl_EnumSurfaces,
1444 IDirectDrawImpl_FlipToGDISurface,
1445 IDirectDrawImpl_GetCaps,
1446 IDirectDrawImpl_GetDisplayMode,
1447 IDirectDrawImpl_GetFourCCCodes,
1448 IDirectDrawImpl_GetGDISurface,
1449 IDirectDrawImpl_GetMonitorFrequency,
1450 IDirectDrawImpl_GetScanLine,
1451 IDirectDrawImpl_GetVerticalBlankStatus,
1452 IDirectDrawImpl_Initialize,
1453 IDirectDrawImpl_RestoreDisplayMode,
1454 IDirectDrawImpl_SetCooperativeLevel,
1455 IDirectDrawImpl_SetDisplayMode,
1456 IDirectDrawImpl_WaitForVerticalBlank,
1459 const IDirectDraw2Vtbl IDirectDraw2_Vtbl =
1461 IDirectDraw2Impl_QueryInterface,
1462 IDirectDraw2Impl_AddRef,
1463 IDirectDraw2Impl_Release,
1464 IDirectDraw2Impl_Compact,
1465 IDirectDraw2Impl_CreateClipper,
1466 IDirectDraw2Impl_CreatePalette,
1467 IDirectDraw2Impl_CreateSurface,
1468 IDirectDraw2Impl_DuplicateSurface,
1469 IDirectDraw2Impl_EnumDisplayModes,
1470 IDirectDraw2Impl_EnumSurfaces,
1471 IDirectDraw2Impl_FlipToGDISurface,
1472 IDirectDraw2Impl_GetCaps,
1473 IDirectDraw2Impl_GetDisplayMode,
1474 IDirectDraw2Impl_GetFourCCCodes,
1475 IDirectDraw2Impl_GetGDISurface,
1476 IDirectDraw2Impl_GetMonitorFrequency,
1477 IDirectDraw2Impl_GetScanLine,
1478 IDirectDraw2Impl_GetVerticalBlankStatus,
1479 IDirectDraw2Impl_Initialize,
1480 IDirectDraw2Impl_RestoreDisplayMode,
1481 IDirectDraw2Impl_SetCooperativeLevel,
1482 IDirectDraw2Impl_SetDisplayMode,
1483 IDirectDraw2Impl_WaitForVerticalBlank,
1484 IDirectDraw2Impl_GetAvailableVidMem
1487 const IDirectDraw3Vtbl IDirectDraw3_Vtbl =
1489 IDirectDraw3Impl_QueryInterface,
1490 IDirectDraw3Impl_AddRef,
1491 IDirectDraw3Impl_Release,
1492 IDirectDraw3Impl_Compact,
1493 IDirectDraw3Impl_CreateClipper,
1494 IDirectDraw3Impl_CreatePalette,
1495 IDirectDraw3Impl_CreateSurface,
1496 IDirectDraw3Impl_DuplicateSurface,
1497 IDirectDraw3Impl_EnumDisplayModes,
1498 IDirectDraw3Impl_EnumSurfaces,
1499 IDirectDraw3Impl_FlipToGDISurface,
1500 IDirectDraw3Impl_GetCaps,
1501 IDirectDraw3Impl_GetDisplayMode,
1502 IDirectDraw3Impl_GetFourCCCodes,
1503 IDirectDraw3Impl_GetGDISurface,
1504 IDirectDraw3Impl_GetMonitorFrequency,
1505 IDirectDraw3Impl_GetScanLine,
1506 IDirectDraw3Impl_GetVerticalBlankStatus,
1507 IDirectDraw3Impl_Initialize,
1508 IDirectDraw3Impl_RestoreDisplayMode,
1509 IDirectDraw3Impl_SetCooperativeLevel,
1510 IDirectDraw3Impl_SetDisplayMode,
1511 IDirectDraw3Impl_WaitForVerticalBlank,
1512 IDirectDraw3Impl_GetAvailableVidMem,
1513 IDirectDraw3Impl_GetSurfaceFromDC,
1516 const IDirectDraw4Vtbl IDirectDraw4_Vtbl =
1518 IDirectDraw4Impl_QueryInterface,
1519 IDirectDraw4Impl_AddRef,
1520 IDirectDraw4Impl_Release,
1521 IDirectDraw4Impl_Compact,
1522 IDirectDraw4Impl_CreateClipper,
1523 IDirectDraw4Impl_CreatePalette,
1524 IDirectDraw4Impl_CreateSurface,
1525 IDirectDraw4Impl_DuplicateSurface,
1526 IDirectDraw4Impl_EnumDisplayModes,
1527 IDirectDraw4Impl_EnumSurfaces,
1528 IDirectDraw4Impl_FlipToGDISurface,
1529 IDirectDraw4Impl_GetCaps,
1530 IDirectDraw4Impl_GetDisplayMode,
1531 IDirectDraw4Impl_GetFourCCCodes,
1532 IDirectDraw4Impl_GetGDISurface,
1533 IDirectDraw4Impl_GetMonitorFrequency,
1534 IDirectDraw4Impl_GetScanLine,
1535 IDirectDraw4Impl_GetVerticalBlankStatus,
1536 IDirectDraw4Impl_Initialize,
1537 IDirectDraw4Impl_RestoreDisplayMode,
1538 IDirectDraw4Impl_SetCooperativeLevel,
1539 IDirectDraw4Impl_SetDisplayMode,
1540 IDirectDraw4Impl_WaitForVerticalBlank,
1541 IDirectDraw4Impl_GetAvailableVidMem,
1542 IDirectDraw4Impl_GetSurfaceFromDC,
1543 IDirectDraw4Impl_RestoreAllSurfaces,
1544 IDirectDraw4Impl_TestCooperativeLevel,
1545 IDirectDraw4Impl_GetDeviceIdentifier