Module: wine Branch: master Commit: 01ea797c344afda604326808e13a48bc9ea93393 URL: https://source.winehq.org/git/wine.git/?a=commit;h=01ea797c344afda604326808e...
Author: Gabriel Ivăncescu gabrielopcode@gmail.com Date: Thu Sep 3 17:50:22 2020 +0300
msscript.ocx: Implement IScriptControl::put_SitehWnd.
Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msscript.ocx/msscript.c | 7 ++++++- dlls/msscript.ocx/tests/msscript.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c index ee0cf2537e..1ff330c78a 100644 --- a/dlls/msscript.ocx/msscript.c +++ b/dlls/msscript.ocx/msscript.c @@ -165,6 +165,7 @@ struct ScriptControl { IConnectionPointContainer IConnectionPointContainer_iface; LONG ref; IOleClientSite *site; + HWND site_hwnd; SIZEL extent; LONG timeout; VARIANT_BOOL allow_ui; @@ -2751,8 +2752,12 @@ static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwn { ScriptControl *This = impl_from_IScriptControl(iface);
- FIXME("(%p)->(%x)\n", This, hwnd); + TRACE("(%p)->(%x)\n", This, hwnd);
+ if (hwnd && !IsWindow(LongToHandle(hwnd))) + return CTL_E_INVALIDPROPERTYVALUE; + + This->site_hwnd = LongToHandle(hwnd); return S_OK; }
diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c index 5a29c7efc6..8b63e979f0 100644 --- a/dlls/msscript.ocx/tests/msscript.c +++ b/dlls/msscript.ocx/tests/msscript.c @@ -1929,7 +1929,7 @@ static void test_SitehWnd(void) todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
hr = IScriptControl_put_SitehWnd(sc, 1); - todo_wine ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr); + ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr);
site_hwnd = 0xdeadbeef; hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);