[PATCH v2 3/6] msscript.ocx: Implement IScriptControl::get_SitehWnd.

Gabriel Ivăncescu gabrielopcode at gmail.com
Thu Sep 3 09:50:23 CDT 2020


Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
---
 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 1ff330c..845d501 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 8b63e97..8e4fa1b 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);
-- 
2.21.0




More information about the wine-devel mailing list