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
27 #include "ddraw_private.h"
28 #include "ddcomimpl.h"
31 IDirectDrawImpl_QueryInterface(LPDIRECTDRAW This
, REFIID iid
, LPVOID
*ppObj
)
33 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
,
40 IDirectDraw2Impl_QueryInterface(LPDIRECTDRAW2 This
, REFIID iid
, LPVOID
*ppObj
)
42 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
,
50 IDirectDraw4Impl_QueryInterface(LPDIRECTDRAW4 This
, REFIID iid
, LPVOID
*ppObj
)
52 return IDirectDraw7_QueryInterface(COM_INTERFACE_CAST(IDirectDrawImpl
,
59 IDirectDrawImpl_AddRef(LPDIRECTDRAW This
)
61 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
,
62 IDirectDraw
, IDirectDraw7
,
67 IDirectDraw2Impl_AddRef(LPDIRECTDRAW2 This
)
69 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
,
70 IDirectDraw2
, IDirectDraw7
,
75 IDirectDraw4Impl_AddRef(LPDIRECTDRAW4 This
)
77 return IDirectDraw7_AddRef(COM_INTERFACE_CAST(IDirectDrawImpl
,
78 IDirectDraw4
, IDirectDraw7
,
83 IDirectDrawImpl_Release(LPDIRECTDRAW This
)
85 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
,
86 IDirectDraw
, IDirectDraw7
,
91 IDirectDraw2Impl_Release(LPDIRECTDRAW2 This
)
93 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
,
94 IDirectDraw2
, IDirectDraw7
,
99 IDirectDraw4Impl_Release(LPDIRECTDRAW4 This
)
101 return IDirectDraw7_Release(COM_INTERFACE_CAST(IDirectDrawImpl
,
102 IDirectDraw4
, IDirectDraw7
,
106 static HRESULT WINAPI
107 IDirectDrawImpl_Compact(LPDIRECTDRAW This
)
109 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl
,
110 IDirectDraw
, IDirectDraw7
,
114 static HRESULT WINAPI
115 IDirectDraw2Impl_Compact(LPDIRECTDRAW2 This
)
117 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl
,
118 IDirectDraw2
, IDirectDraw7
,
122 static HRESULT WINAPI
123 IDirectDraw4Impl_Compact(LPDIRECTDRAW4 This
)
125 return IDirectDraw7_Compact(COM_INTERFACE_CAST(IDirectDrawImpl
,
126 IDirectDraw4
, IDirectDraw7
,
130 static HRESULT WINAPI
131 IDirectDrawImpl_CreateClipper(LPDIRECTDRAW This
, DWORD dwFlags
,
132 LPDIRECTDRAWCLIPPER
*ppClipper
,
135 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl
,
139 dwFlags
, ppClipper
, pUnkOuter
);
142 static HRESULT WINAPI
143 IDirectDraw2Impl_CreateClipper(LPDIRECTDRAW2 This
, DWORD dwFlags
,
144 LPDIRECTDRAWCLIPPER
*ppClipper
,
147 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl
,
151 dwFlags
, ppClipper
, pUnkOuter
);
154 static HRESULT WINAPI
155 IDirectDraw4Impl_CreateClipper(LPDIRECTDRAW4 This
, DWORD dwFlags
,
156 LPDIRECTDRAWCLIPPER
*ppClipper
,
159 return IDirectDraw7_CreateClipper(COM_INTERFACE_CAST(IDirectDrawImpl
,
163 dwFlags
, ppClipper
, pUnkOuter
);
166 static HRESULT WINAPI
167 IDirectDrawImpl_CreatePalette(LPDIRECTDRAW This
, DWORD dwFlags
,
168 LPPALETTEENTRY pEntries
,
169 LPDIRECTDRAWPALETTE
*ppPalette
,
172 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl
,
176 dwFlags
, pEntries
, ppPalette
, pUnkOuter
);
179 static HRESULT WINAPI
180 IDirectDraw2Impl_CreatePalette(LPDIRECTDRAW2 This
, DWORD dwFlags
,
181 LPPALETTEENTRY pEntries
,
182 LPDIRECTDRAWPALETTE
*ppPalette
,
185 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl
,
189 dwFlags
, pEntries
, ppPalette
, pUnkOuter
);
192 static HRESULT WINAPI
193 IDirectDraw4Impl_CreatePalette(LPDIRECTDRAW4 This
, DWORD dwFlags
,
194 LPPALETTEENTRY pEntries
,
195 LPDIRECTDRAWPALETTE
*ppPalette
,
198 return IDirectDraw7_CreatePalette(COM_INTERFACE_CAST(IDirectDrawImpl
,
202 dwFlags
, pEntries
, ppPalette
, pUnkOuter
);
205 static HRESULT WINAPI
206 IDirectDrawImpl_CreateSurface(LPDIRECTDRAW This
, LPDDSURFACEDESC pSDesc
,
207 LPDIRECTDRAWSURFACE
*ppSurface
,
210 LPDIRECTDRAWSURFACE7 pSurface7
;
211 IDirectDrawSurfaceImpl
*impl
;
214 /* the LPDDSURFACEDESC -> LPDDSURFACEDESC2 conversion should be ok,
215 * since the data layout is the same */
216 hr
= IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
220 (LPDDSURFACEDESC2
)pSDesc
, &pSurface7
, pUnkOuter
);
222 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
223 * IDirectDrawSurface vtable layout at the beginning */
224 *ppSurface
= (LPDIRECTDRAWSURFACE
) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
,
225 IDirectDrawSurface7
, IDirectDrawSurface3
,
228 impl
= ICOM_OBJECT(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
, pSurface7
);
237 static HRESULT WINAPI
238 IDirectDraw2Impl_CreateSurface(LPDIRECTDRAW2 This
, LPDDSURFACEDESC pSDesc
,
239 LPDIRECTDRAWSURFACE
*ppSurface
,
242 LPDIRECTDRAWSURFACE7 pSurface7
;
243 IDirectDrawSurfaceImpl
*impl
;
246 hr
= IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
250 (LPDDSURFACEDESC2
)pSDesc
, &pSurface7
, pUnkOuter
);
252 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
253 * IDirectDrawSurface vtable layout at the beginning */
254 *ppSurface
= (LPDIRECTDRAWSURFACE
)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
,
255 IDirectDrawSurface7
, IDirectDrawSurface3
,
258 impl
= ICOM_OBJECT(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
, pSurface7
);
267 static HRESULT WINAPI
268 IDirectDraw4Impl_CreateSurface(LPDIRECTDRAW4 This
, LPDDSURFACEDESC2 pSDesc
,
269 LPDIRECTDRAWSURFACE4
*ppSurface
,
273 IDirectDrawSurfaceImpl
*impl
;
275 hr
= IDirectDraw7_CreateSurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
280 (LPDIRECTDRAWSURFACE7
*)ppSurface
,
282 impl
= ICOM_OBJECT(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
, *ppSurface
);
290 static HRESULT WINAPI
291 IDirectDrawImpl_DuplicateSurface(LPDIRECTDRAW 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 IDirectDraw2Impl_DuplicateSurface(LPDIRECTDRAW2 This
, LPDIRECTDRAWSURFACE pSrc
,
316 LPDIRECTDRAWSURFACE
*ppDst
)
318 LPDIRECTDRAWSURFACE7 pDst7
;
321 hr
= IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
324 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
,
330 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
331 * IDirectDrawSurface vtable layout at the beginning */
332 *ppDst
= (LPDIRECTDRAWSURFACE
)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
,
333 IDirectDrawSurface3
, pDst7
);
338 static HRESULT WINAPI
339 IDirectDraw4Impl_DuplicateSurface(LPDIRECTDRAW4 This
,
340 LPDIRECTDRAWSURFACE4 pSrc
,
341 LPDIRECTDRAWSURFACE4
*ppDst
)
343 return IDirectDraw7_DuplicateSurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
347 (LPDIRECTDRAWSURFACE7
)pSrc
,
348 (LPDIRECTDRAWSURFACE7
*)ppDst
);
351 struct displaymodescallback_context
353 LPDDENUMMODESCALLBACK func
;
357 static HRESULT CALLBACK
358 EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2
, LPVOID context
)
361 struct displaymodescallback_context
*cbcontext
= context
;
363 memcpy(&DDSD
,pDDSD2
,sizeof(DDSD
));
364 DDSD
.dwSize
= sizeof(DDSD
);
366 return cbcontext
->func(&DDSD
, cbcontext
->context
);
369 static HRESULT WINAPI
370 IDirectDrawImpl_EnumDisplayModes(LPDIRECTDRAW This
, DWORD dwFlags
,
371 LPDDSURFACEDESC pDDSD
, LPVOID context
,
372 LPDDENUMMODESCALLBACK cb
)
374 struct displaymodescallback_context cbcontext
;
377 cbcontext
.context
= context
;
379 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl
,
383 dwFlags
, (LPDDSURFACEDESC2
)pDDSD
, &cbcontext
,
384 EnumDisplayModesCallbackThunk
);
387 static HRESULT WINAPI
388 IDirectDraw2Impl_EnumDisplayModes(LPDIRECTDRAW2 This
, DWORD dwFlags
,
389 LPDDSURFACEDESC pDDSD
, LPVOID context
,
390 LPDDENUMMODESCALLBACK cb
)
392 struct displaymodescallback_context cbcontext
;
395 cbcontext
.context
= context
;
397 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl
,
401 dwFlags
, (LPDDSURFACEDESC2
)pDDSD
, &cbcontext
,
402 EnumDisplayModesCallbackThunk
);
405 static HRESULT WINAPI
406 IDirectDraw4Impl_EnumDisplayModes(LPDIRECTDRAW4 This
, DWORD dwFlags
,
407 LPDDSURFACEDESC2 pDDSD
, LPVOID context
,
408 LPDDENUMMODESCALLBACK2 cb
)
410 return IDirectDraw7_EnumDisplayModes(COM_INTERFACE_CAST(IDirectDrawImpl
,
414 dwFlags
, pDDSD
, context
, cb
);
417 struct surfacescallback_context
419 LPDDENUMSURFACESCALLBACK func
;
423 static HRESULT CALLBACK
424 EnumSurfacesCallbackThunk(LPDIRECTDRAWSURFACE7 pSurf
, LPDDSURFACEDESC2 pDDSD
,
427 struct surfacescallback_context
*cbcontext
= context
;
429 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
430 * IDirectDrawSurface vtable layout at the beginning */
431 return cbcontext
->func((LPDIRECTDRAWSURFACE
)
432 COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
,
434 IDirectDrawSurface3
, pSurf
),
435 (LPDDSURFACEDESC
)pDDSD
, cbcontext
->context
);
438 static HRESULT WINAPI
439 IDirectDrawImpl_EnumSurfaces(LPDIRECTDRAW This
, DWORD dwFlags
,
440 LPDDSURFACEDESC pDDSD
, LPVOID context
,
441 LPDDENUMSURFACESCALLBACK cb
)
443 struct surfacescallback_context cbcontext
;
446 cbcontext
.context
= context
;
448 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl
,
451 dwFlags
, (LPDDSURFACEDESC2
)pDDSD
,
452 &cbcontext
, EnumSurfacesCallbackThunk
);
455 static HRESULT WINAPI
456 IDirectDraw2Impl_EnumSurfaces(LPDIRECTDRAW2 This
, DWORD dwFlags
,
457 LPDDSURFACEDESC pDDSD
, LPVOID context
,
458 LPDDENUMSURFACESCALLBACK cb
)
460 struct surfacescallback_context cbcontext
;
463 cbcontext
.context
= context
;
465 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl
,
468 dwFlags
, (LPDDSURFACEDESC2
)pDDSD
,
469 &cbcontext
, EnumSurfacesCallbackThunk
);
472 static HRESULT WINAPI
473 IDirectDraw4Impl_EnumSurfaces(LPDIRECTDRAW4 This
, DWORD dwFlags
,
474 LPDDSURFACEDESC2 pDDSD
, LPVOID context
,
475 LPDDENUMSURFACESCALLBACK2 cb
)
477 return IDirectDraw7_EnumSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl
,
480 dwFlags
, pDDSD
, context
,
481 (LPDDENUMSURFACESCALLBACK7
)cb
);
484 static HRESULT WINAPI
485 IDirectDrawImpl_FlipToGDISurface(LPDIRECTDRAW This
)
487 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
493 static HRESULT WINAPI
494 IDirectDraw2Impl_FlipToGDISurface(LPDIRECTDRAW2 This
)
496 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
502 static HRESULT WINAPI
503 IDirectDraw4Impl_FlipToGDISurface(LPDIRECTDRAW4 This
)
505 return IDirectDraw7_FlipToGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
511 static HRESULT WINAPI
512 IDirectDrawImpl_GetCaps(LPDIRECTDRAW This
, LPDDCAPS pDDC1
, LPDDCAPS pDDC2
)
514 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl
,
515 IDirectDraw
, IDirectDraw7
,
516 This
), pDDC1
, pDDC2
);
519 static HRESULT WINAPI
520 IDirectDraw2Impl_GetCaps(LPDIRECTDRAW2 This
, LPDDCAPS pDDC1
, LPDDCAPS pDDC2
)
522 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl
,
523 IDirectDraw2
, IDirectDraw7
,
524 This
), pDDC1
, pDDC2
);
527 static HRESULT WINAPI
528 IDirectDraw4Impl_GetCaps(LPDIRECTDRAW4 This
, LPDDCAPS pDDC1
, LPDDCAPS pDDC2
)
530 return IDirectDraw7_GetCaps(COM_INTERFACE_CAST(IDirectDrawImpl
,
531 IDirectDraw4
, IDirectDraw7
,
532 This
), pDDC1
, pDDC2
);
535 static HRESULT WINAPI
536 IDirectDrawImpl_GetDisplayMode(LPDIRECTDRAW This
, LPDDSURFACEDESC pDDSD
)
538 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
541 (LPDDSURFACEDESC2
)pDDSD
);
544 static HRESULT WINAPI
545 IDirectDraw2Impl_GetDisplayMode(LPDIRECTDRAW2 This
, LPDDSURFACEDESC pDDSD
)
547 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
550 (LPDDSURFACEDESC2
)pDDSD
);
553 static HRESULT WINAPI
554 IDirectDraw4Impl_GetDisplayMode(LPDIRECTDRAW4 This
, LPDDSURFACEDESC2 pDDSD
)
556 return IDirectDraw7_GetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
562 static HRESULT WINAPI
563 IDirectDrawImpl_GetFourCCCodes(LPDIRECTDRAW This
, LPDWORD lpNumCodes
,
566 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl
,
570 lpNumCodes
, lpCodes
);
573 static HRESULT WINAPI
574 IDirectDraw2Impl_GetFourCCCodes(LPDIRECTDRAW2 This
, LPDWORD lpNumCodes
,
577 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl
,
581 lpNumCodes
, lpCodes
);
584 static HRESULT WINAPI
585 IDirectDraw4Impl_GetFourCCCodes(LPDIRECTDRAW4 This
, LPDWORD lpNumCodes
,
588 return IDirectDraw7_GetFourCCCodes(COM_INTERFACE_CAST(IDirectDrawImpl
,
592 lpNumCodes
, lpCodes
);
595 static HRESULT WINAPI
596 IDirectDrawImpl_GetGDISurface(LPDIRECTDRAW This
, LPDIRECTDRAWSURFACE
*ppSurf
)
598 LPDIRECTDRAWSURFACE7 pSurf7
;
601 hr
= IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
606 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
607 * IDirectDrawSurface vtable layout at the beginning */
608 *ppSurf
= (LPDIRECTDRAWSURFACE
)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
,
609 IDirectDrawSurface3
, pSurf7
);
614 static HRESULT WINAPI
615 IDirectDraw2Impl_GetGDISurface(LPDIRECTDRAW2 This
, LPDIRECTDRAWSURFACE
*ppSurf
)
617 LPDIRECTDRAWSURFACE7 pSurf7
;
620 hr
= IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
625 /* This coercion is safe, since the IDirectDrawSurface3 vtable has the
626 * IDirectDrawSurface vtable layout at the beginning */
627 *ppSurf
= (LPDIRECTDRAWSURFACE
)COM_INTERFACE_CAST(IDirectDrawSurfaceImpl
, IDirectDrawSurface7
,
628 IDirectDrawSurface3
, pSurf7
);
633 static HRESULT WINAPI
634 IDirectDraw4Impl_GetGDISurface(LPDIRECTDRAW4 This
,
635 LPDIRECTDRAWSURFACE4
*ppSurf
)
637 return IDirectDraw7_GetGDISurface(COM_INTERFACE_CAST(IDirectDrawImpl
,
641 (LPDIRECTDRAWSURFACE7
*)ppSurf
);
644 static HRESULT WINAPI
645 IDirectDrawImpl_GetMonitorFrequency(LPDIRECTDRAW This
, LPDWORD pdwFreq
)
647 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl
,
654 static HRESULT WINAPI
655 IDirectDraw2Impl_GetMonitorFrequency(LPDIRECTDRAW2 This
, LPDWORD pdwFreq
)
657 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl
,
664 static HRESULT WINAPI
665 IDirectDraw4Impl_GetMonitorFrequency(LPDIRECTDRAW4 This
, LPDWORD pdwFreq
)
667 return IDirectDraw7_GetMonitorFrequency(COM_INTERFACE_CAST(IDirectDrawImpl
,
674 static HRESULT WINAPI
675 IDirectDrawImpl_GetScanLine(LPDIRECTDRAW This
, LPDWORD pdwLine
)
677 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl
,
683 static HRESULT WINAPI
684 IDirectDraw2Impl_GetScanLine(LPDIRECTDRAW2 This
, LPDWORD pdwLine
)
686 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl
,
692 static HRESULT WINAPI
693 IDirectDraw4Impl_GetScanLine(LPDIRECTDRAW4 This
, LPDWORD pdwLine
)
695 return IDirectDraw7_GetScanLine(COM_INTERFACE_CAST(IDirectDrawImpl
,
701 static HRESULT WINAPI
702 IDirectDrawImpl_GetVerticalBlankStatus(LPDIRECTDRAW This
, LPBOOL lpbIsInVB
)
704 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl
,
711 static HRESULT WINAPI
712 IDirectDraw2Impl_GetVerticalBlankStatus(LPDIRECTDRAW2 This
, LPBOOL lpbIsInVB
)
714 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl
,
721 static HRESULT WINAPI
722 IDirectDraw4Impl_GetVerticalBlankStatus(LPDIRECTDRAW4 This
, LPBOOL lpbIsInVB
)
724 return IDirectDraw7_GetVerticalBlankStatus(COM_INTERFACE_CAST(IDirectDrawImpl
,
731 static HRESULT WINAPI
732 IDirectDrawImpl_Initialize(LPDIRECTDRAW iface
, LPGUID pGUID
)
734 ICOM_THIS_FROM(IDirectDrawImpl
, IDirectDraw
, iface
);
737 ret_value
= IDirectDraw7_Initialize(ICOM_INTERFACE(This
, IDirectDraw7
), pGUID
);
742 static HRESULT WINAPI
743 IDirectDraw2Impl_Initialize(LPDIRECTDRAW2 iface
, LPGUID pGUID
)
745 ICOM_THIS_FROM(IDirectDrawImpl
, IDirectDraw2
, iface
);
748 ret_value
= IDirectDraw7_Initialize(ICOM_INTERFACE(This
, IDirectDraw7
), pGUID
);
753 static HRESULT WINAPI
754 IDirectDraw4Impl_Initialize(LPDIRECTDRAW4 iface
, LPGUID pGUID
)
756 ICOM_THIS_FROM(IDirectDrawImpl
, IDirectDraw4
, iface
);
759 ret_value
= IDirectDraw7_Initialize(ICOM_INTERFACE(This
, IDirectDraw7
), pGUID
);
765 static HRESULT WINAPI
766 IDirectDrawImpl_RestoreDisplayMode(LPDIRECTDRAW This
)
768 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
774 static HRESULT WINAPI
775 IDirectDraw2Impl_RestoreDisplayMode(LPDIRECTDRAW2 This
)
777 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
783 static HRESULT WINAPI
784 IDirectDraw4Impl_RestoreDisplayMode(LPDIRECTDRAW4 This
)
786 return IDirectDraw7_RestoreDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
792 static HRESULT WINAPI
793 IDirectDrawImpl_SetCooperativeLevel(LPDIRECTDRAW This
, HWND hWnd
,
796 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl
,
803 static HRESULT WINAPI
804 IDirectDraw2Impl_SetCooperativeLevel(LPDIRECTDRAW2 This
, HWND hWnd
,
807 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl
,
814 static HRESULT WINAPI
815 IDirectDraw4Impl_SetCooperativeLevel(LPDIRECTDRAW4 This
, HWND hWnd
,
818 return IDirectDraw7_SetCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl
,
825 static HRESULT WINAPI
826 IDirectDrawImpl_SetDisplayMode(LPDIRECTDRAW This
, DWORD a
, DWORD b
, DWORD c
)
828 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
835 static HRESULT WINAPI
836 IDirectDraw2Impl_SetDisplayMode(LPDIRECTDRAW2 This
, DWORD a
, DWORD b
, DWORD c
,
839 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
846 static HRESULT WINAPI
847 IDirectDraw4Impl_SetDisplayMode(LPDIRECTDRAW4 This
, DWORD a
, DWORD b
, DWORD c
,
850 return IDirectDraw7_SetDisplayMode(COM_INTERFACE_CAST(IDirectDrawImpl
,
857 static HRESULT WINAPI
858 IDirectDrawImpl_WaitForVerticalBlank(LPDIRECTDRAW This
, DWORD dwFlags
,
861 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl
,
868 static HRESULT WINAPI
869 IDirectDraw2Impl_WaitForVerticalBlank(LPDIRECTDRAW2 This
, DWORD dwFlags
,
872 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl
,
879 static HRESULT WINAPI
880 IDirectDraw4Impl_WaitForVerticalBlank(LPDIRECTDRAW4 This
, DWORD dwFlags
,
883 return IDirectDraw7_WaitForVerticalBlank(COM_INTERFACE_CAST(IDirectDrawImpl
,
890 static HRESULT WINAPI
891 IDirectDraw2Impl_GetAvailableVidMem(LPDIRECTDRAW2 This
, LPDDSCAPS pCaps
,
892 LPDWORD pdwTotal
, LPDWORD pdwFree
)
895 DDRAW_Convert_DDSCAPS_1_To_2(pCaps
, &Caps2
);
897 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl
,
901 &Caps2
, pdwTotal
, pdwFree
);
904 static HRESULT WINAPI
905 IDirectDraw4Impl_GetAvailableVidMem(LPDIRECTDRAW4 This
, LPDDSCAPS2 pCaps
,
906 LPDWORD pdwTotal
, LPDWORD pdwFree
)
908 return IDirectDraw7_GetAvailableVidMem(COM_INTERFACE_CAST(IDirectDrawImpl
,
912 pCaps
, pdwTotal
, pdwFree
);
915 static HRESULT WINAPI
916 IDirectDraw4Impl_GetSurfaceFromDC(LPDIRECTDRAW4 This
, HDC hDC
,
917 LPDIRECTDRAWSURFACE4
*pSurf
)
919 return IDirectDraw7_GetSurfaceFromDC(COM_INTERFACE_CAST(IDirectDrawImpl
,
923 hDC
, (LPDIRECTDRAWSURFACE7
*)pSurf
);
926 static HRESULT WINAPI
927 IDirectDraw4Impl_RestoreAllSurfaces(LPDIRECTDRAW4 This
)
929 return IDirectDraw7_RestoreAllSurfaces(COM_INTERFACE_CAST(IDirectDrawImpl
,
935 static HRESULT WINAPI
936 IDirectDraw4Impl_TestCooperativeLevel(LPDIRECTDRAW4 This
)
938 return IDirectDraw7_TestCooperativeLevel(COM_INTERFACE_CAST(IDirectDrawImpl
,
944 static HRESULT WINAPI
945 IDirectDraw4Impl_GetDeviceIdentifier(LPDIRECTDRAW4 This
,
946 LPDDDEVICEIDENTIFIER pDDDI
, DWORD dwFlags
)
948 DDDEVICEIDENTIFIER2 DDDI2
;
951 hr
= IDirectDraw7_GetDeviceIdentifier(COM_INTERFACE_CAST(IDirectDrawImpl
,
957 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&DDDI2
, pDDDI
);
962 const IDirectDrawVtbl IDirectDraw1_Vtbl
=
964 IDirectDrawImpl_QueryInterface
,
965 IDirectDrawImpl_AddRef
,
966 IDirectDrawImpl_Release
,
967 IDirectDrawImpl_Compact
,
968 IDirectDrawImpl_CreateClipper
,
969 IDirectDrawImpl_CreatePalette
,
970 IDirectDrawImpl_CreateSurface
,
971 IDirectDrawImpl_DuplicateSurface
,
972 IDirectDrawImpl_EnumDisplayModes
,
973 IDirectDrawImpl_EnumSurfaces
,
974 IDirectDrawImpl_FlipToGDISurface
,
975 IDirectDrawImpl_GetCaps
,
976 IDirectDrawImpl_GetDisplayMode
,
977 IDirectDrawImpl_GetFourCCCodes
,
978 IDirectDrawImpl_GetGDISurface
,
979 IDirectDrawImpl_GetMonitorFrequency
,
980 IDirectDrawImpl_GetScanLine
,
981 IDirectDrawImpl_GetVerticalBlankStatus
,
982 IDirectDrawImpl_Initialize
,
983 IDirectDrawImpl_RestoreDisplayMode
,
984 IDirectDrawImpl_SetCooperativeLevel
,
985 IDirectDrawImpl_SetDisplayMode
,
986 IDirectDrawImpl_WaitForVerticalBlank
,
989 const IDirectDraw2Vtbl IDirectDraw2_Vtbl
=
991 IDirectDraw2Impl_QueryInterface
,
992 IDirectDraw2Impl_AddRef
,
993 IDirectDraw2Impl_Release
,
994 IDirectDraw2Impl_Compact
,
995 IDirectDraw2Impl_CreateClipper
,
996 IDirectDraw2Impl_CreatePalette
,
997 IDirectDraw2Impl_CreateSurface
,
998 IDirectDraw2Impl_DuplicateSurface
,
999 IDirectDraw2Impl_EnumDisplayModes
,
1000 IDirectDraw2Impl_EnumSurfaces
,
1001 IDirectDraw2Impl_FlipToGDISurface
,
1002 IDirectDraw2Impl_GetCaps
,
1003 IDirectDraw2Impl_GetDisplayMode
,
1004 IDirectDraw2Impl_GetFourCCCodes
,
1005 IDirectDraw2Impl_GetGDISurface
,
1006 IDirectDraw2Impl_GetMonitorFrequency
,
1007 IDirectDraw2Impl_GetScanLine
,
1008 IDirectDraw2Impl_GetVerticalBlankStatus
,
1009 IDirectDraw2Impl_Initialize
,
1010 IDirectDraw2Impl_RestoreDisplayMode
,
1011 IDirectDraw2Impl_SetCooperativeLevel
,
1012 IDirectDraw2Impl_SetDisplayMode
,
1013 IDirectDraw2Impl_WaitForVerticalBlank
,
1014 IDirectDraw2Impl_GetAvailableVidMem
1017 const IDirectDraw4Vtbl IDirectDraw4_Vtbl
=
1019 IDirectDraw4Impl_QueryInterface
,
1020 IDirectDraw4Impl_AddRef
,
1021 IDirectDraw4Impl_Release
,
1022 IDirectDraw4Impl_Compact
,
1023 IDirectDraw4Impl_CreateClipper
,
1024 IDirectDraw4Impl_CreatePalette
,
1025 IDirectDraw4Impl_CreateSurface
,
1026 IDirectDraw4Impl_DuplicateSurface
,
1027 IDirectDraw4Impl_EnumDisplayModes
,
1028 IDirectDraw4Impl_EnumSurfaces
,
1029 IDirectDraw4Impl_FlipToGDISurface
,
1030 IDirectDraw4Impl_GetCaps
,
1031 IDirectDraw4Impl_GetDisplayMode
,
1032 IDirectDraw4Impl_GetFourCCCodes
,
1033 IDirectDraw4Impl_GetGDISurface
,
1034 IDirectDraw4Impl_GetMonitorFrequency
,
1035 IDirectDraw4Impl_GetScanLine
,
1036 IDirectDraw4Impl_GetVerticalBlankStatus
,
1037 IDirectDraw4Impl_Initialize
,
1038 IDirectDraw4Impl_RestoreDisplayMode
,
1039 IDirectDraw4Impl_SetCooperativeLevel
,
1040 IDirectDraw4Impl_SetDisplayMode
,
1041 IDirectDraw4Impl_WaitForVerticalBlank
,
1042 IDirectDraw4Impl_GetAvailableVidMem
,
1043 IDirectDraw4Impl_GetSurfaceFromDC
,
1044 IDirectDraw4Impl_RestoreAllSurfaces
,
1045 IDirectDraw4Impl_TestCooperativeLevel
,
1046 IDirectDraw4Impl_GetDeviceIdentifier