From a8b3b1c7362634502f6062bdac4798c985056128 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Mon, 26 Sep 2022 22:22:15 +0200 Subject: [PATCH] add GetHWnd and SetHWnd clipper functions --- inc/IDirectDrawClipper.h | 1 + inc/ddclipper.h | 2 ++ src/IDirectDraw/IDirectDrawClipper.c | 24 ++++++++++++++++-------- src/ddclipper.c | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/inc/IDirectDrawClipper.h b/inc/IDirectDrawClipper.h index c51648b..a1ae9bc 100644 --- a/inc/IDirectDrawClipper.h +++ b/inc/IDirectDrawClipper.h @@ -14,6 +14,7 @@ typedef struct IDirectDrawClipperImpl struct IDirectDrawClipperImplVtbl* lpVtbl; ULONG ref; + HWND hwnd; } IDirectDrawClipperImpl; diff --git a/inc/ddclipper.h b/inc/ddclipper.h index 355e446..11ecc39 100644 --- a/inc/ddclipper.h +++ b/inc/ddclipper.h @@ -7,6 +7,8 @@ #include "IDirectDrawClipper.h" +HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd); +HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd); HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter); #endif diff --git a/src/IDirectDraw/IDirectDrawClipper.c b/src/IDirectDraw/IDirectDrawClipper.c index 304cf69..9b7e32a 100644 --- a/src/IDirectDraw/IDirectDrawClipper.c +++ b/src/IDirectDraw/IDirectDrawClipper.c @@ -41,17 +41,25 @@ HRESULT __stdcall IDirectDrawClipper__GetClipList( LPRGNDATA lpClipList, LPDWORD lpdwSiz) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This); + TRACE( + "NOT_IMPLEMENTED -> %s(This=%p, lpRect=%p, lpClipList=%p, lpdwSiz=%p)\n", + __FUNCTION__, + This, + lpRect, + lpClipList, + lpdwSiz); + HRESULT ret = DDERR_NOCLIPLIST; + TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); return ret; } HRESULT __stdcall IDirectDrawClipper__GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This); - HRESULT ret = DDERR_INVALIDOBJECT; - TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); + TRACE("-> %s(This=%p, lphWnd=%p)\n", __FUNCTION__, This, lphWnd); + HRESULT ret = ddc_GetHWnd(This, lphWnd); + TRACE("<- %s\n", __FUNCTION__); return ret; } @@ -73,7 +81,7 @@ HRESULT __stdcall IDirectDrawClipper__IsClipListChanged(IDirectDrawClipperImpl* HRESULT __stdcall IDirectDrawClipper__SetClipList(IDirectDrawClipperImpl* This, LPRGNDATA lpClipList, DWORD dwFlags) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This); + TRACE("NOT_IMPLEMENTED -> %s(This=%p, lpClipList=%p, dwFlags=%08X)\n", __FUNCTION__, This, lpClipList, dwFlags); HRESULT ret = DD_OK; TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); return ret; @@ -81,9 +89,9 @@ HRESULT __stdcall IDirectDrawClipper__SetClipList(IDirectDrawClipperImpl* This, HRESULT __stdcall IDirectDrawClipper__SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd) { - TRACE("NOT_IMPLEMENTED -> %s(This=%p)\n", __FUNCTION__, This); - HRESULT ret = DD_OK; - TRACE("NOT_IMPLEMENTED <- %s\n", __FUNCTION__); + TRACE("-> %s(This=%p, dwFlags=%08X, hWnd=%p)\n", __FUNCTION__, This, dwFlags, hWnd); + HRESULT ret = ddc_SetHWnd(This, dwFlags, hWnd); + TRACE("<- %s\n", __FUNCTION__); return ret; } diff --git a/src/ddclipper.c b/src/ddclipper.c index b09e880..cf80077 100644 --- a/src/ddclipper.c +++ b/src/ddclipper.c @@ -5,6 +5,23 @@ #include "debug.h" +HRESULT ddc_GetHWnd(IDirectDrawClipperImpl* This, HWND FAR* lphWnd) +{ + if (!lphWnd) + return DDERR_INVALIDPARAMS; + + *lphWnd = This->hwnd; + + return DD_OK; +} + +HRESULT ddc_SetHWnd(IDirectDrawClipperImpl* This, DWORD dwFlags, HWND hWnd) +{ + This->hwnd = hWnd; + + return DD_OK; +} + HRESULT dd_CreateClipper(DWORD dwFlags, IDirectDrawClipperImpl** lplpDDClipper, IUnknown FAR* pUnkOuter) { if (!lplpDDClipper)