Gabriel Ivăncescu : msscript.ocx: Implement IScriptControl::get_SitehWnd.
Alexandre Julliard
julliard at winehq.org
Fri Sep 4 15:47:32 CDT 2020
Module: wine
Branch: master
Commit: a46810c67af50843b7c6e4dcc41473e4a677b795
URL: https://source.winehq.org/git/wine.git/?a=commit;h=a46810c67af50843b7c6e4dcc41473e4a677b795
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Thu Sep 3 17:50:23 2020 +0300
msscript.ocx: Implement IScriptControl::get_SitehWnd.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/msscript.ocx/msscript.c | 9 +++++++--
dlls/msscript.ocx/tests/msscript.c | 30 +++++++++++++++---------------
2 files changed, 22 insertions(+), 17 deletions(-)
diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c
index 1ff330c78a..845d501814 100644
--- a/dlls/msscript.ocx/msscript.c
+++ b/dlls/msscript.ocx/msscript.c
@@ -2764,8 +2764,13 @@ static HRESULT WINAPI ScriptControl_put_SitehWnd(IScriptControl *iface, LONG hwn
static HRESULT WINAPI ScriptControl_get_SitehWnd(IScriptControl *iface, LONG *p)
{
ScriptControl *This = impl_from_IScriptControl(iface);
- FIXME("(%p)->(%p)\n", This, p);
- return E_NOTIMPL;
+
+ TRACE("(%p)->(%p)\n", This, p);
+
+ if (!p) return E_POINTER;
+
+ *p = HandleToLong(This->site_hwnd);
+ return S_OK;
}
static HRESULT WINAPI ScriptControl_get_Timeout(IScriptControl *iface, LONG *p)
diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c
index 8b63e979f0..8e4fa1bfcf 100644
--- a/dlls/msscript.ocx/tests/msscript.c
+++ b/dlls/msscript.ocx/tests/msscript.c
@@ -1921,20 +1921,20 @@ static void test_SitehWnd(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_SitehWnd(sc, NULL);
- todo_wine ok(hr == E_POINTER, "got 0x%08x\n", hr);
+ ok(hr == E_POINTER, "got 0x%08x\n", hr);
site_hwnd = 0xdeadbeef;
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
hr = IScriptControl_put_SitehWnd(sc, 1);
ok(hr == CTL_E_INVALIDPROPERTYVALUE, "got 0x%08x\n", hr);
site_hwnd = 0xdeadbeef;
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
hr = IScriptControl_put_SitehWnd(sc, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
@@ -1949,8 +1949,8 @@ static void test_SitehWnd(void)
site_hwnd = 0;
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
IScriptControl_Release(sc);
@@ -1989,8 +1989,8 @@ static void test_SitehWnd(void)
site_hwnd = 0;
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
window = NULL;
hr = IActiveScriptSiteWindow_GetWindow(site_window, NULL);
@@ -2008,8 +2008,8 @@ static void test_SitehWnd(void)
hr = IScriptControl_put_SitehWnd(sc, 0);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok(!site_hwnd, "got %p\n", (HWND)(LONG_PTR)site_hwnd);
window = (HWND)0xdeadbeef;
hr = IActiveScriptSiteWindow_GetWindow(site_window, &window);
@@ -2020,8 +2020,8 @@ static void test_SitehWnd(void)
hr = IScriptControl_put_SitehWnd(sc, (LONG)(LONG_PTR)hwnd);
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
window = NULL;
hr = IActiveScriptSiteWindow_GetWindow(site_window, &window);
@@ -2032,8 +2032,8 @@ static void test_SitehWnd(void)
ok(hr == S_OK, "got 0x%08x\n", hr);
hr = IScriptControl_get_SitehWnd(sc, &site_hwnd);
- todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
- todo_wine ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ ok((HWND)(LONG_PTR)site_hwnd == hwnd, "got %p, expected %p\n", (HWND)(LONG_PTR)site_hwnd, hwnd);
window = NULL;
hr = IActiveScriptSiteWindow_GetWindow(site_window, &window);
More information about the wine-cvs
mailing list