Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- 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 ee0cf25..1ff330c 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 5a29c7e..8b63e97 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);