Gabriel Ivăncescu : msscript.ocx: Implement IScriptModuleCollection::get_Count.

Alexandre Julliard julliard at winehq.org
Wed Jun 17 15:54:03 CDT 2020


Module: wine
Branch: master
Commit: 67ef5151744b347d4a30c985da6712fb0061e675
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=67ef5151744b347d4a30c985da6712fb0061e675

Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date:   Mon Jun 15 16:00:04 2020 +0300

msscript.ocx: Implement IScriptModuleCollection::get_Count.

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       |  7 +++++--
 dlls/msscript.ocx/tests/msscript.c | 12 ++++++------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/dlls/msscript.ocx/msscript.c b/dlls/msscript.ocx/msscript.c
index e397044fd7..8fb127e0e3 100644
--- a/dlls/msscript.ocx/msscript.c
+++ b/dlls/msscript.ocx/msscript.c
@@ -893,9 +893,12 @@ static HRESULT WINAPI ScriptModuleCollection_get_Count(IScriptModuleCollection *
 {
     ScriptControl *This = impl_from_IScriptModuleCollection(iface);
 
-    FIXME("(%p)->(%p)\n", This, plCount);
+    TRACE("(%p)->(%p)\n", This, plCount);
 
-    return E_NOTIMPL;
+    if (!plCount) return E_POINTER;
+
+    *plCount = This->module_count;
+    return S_OK;
 }
 
 static HRESULT WINAPI ScriptModuleCollection_Add(IScriptModuleCollection *iface, BSTR name,
diff --git a/dlls/msscript.ocx/tests/msscript.c b/dlls/msscript.ocx/tests/msscript.c
index 6a0730368c..fbbe83191b 100644
--- a/dlls/msscript.ocx/tests/msscript.c
+++ b/dlls/msscript.ocx/tests/msscript.c
@@ -2331,11 +2331,11 @@ static void test_IScriptControl_get_Modules(void)
     ok(hr == S_OK, "IScriptControl_get_Modules failed: 0x%08x.\n", hr);
 
     hr = IScriptModuleCollection_get_Count(mods, NULL);
-    todo_wine ok(hr == E_POINTER, "IScriptModuleCollection_get_Count returned: 0x%08x.\n", hr);
+    ok(hr == E_POINTER, "IScriptModuleCollection_get_Count returned: 0x%08x.\n", hr);
     count = 0;
     hr = IScriptModuleCollection_get_Count(mods, &count);
-    todo_wine ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
-    todo_wine ok(count == 1, "count is not 1, got %d.\n", count);
+    ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
+    ok(count == 1, "count is not 1, got %d.\n", count);
 
     V_VT(&var) = VT_I4;
     V_I4(&var) = -1;
@@ -2372,7 +2372,7 @@ static void test_IScriptControl_get_Modules(void)
     SysFreeString(str);
 
     hr = IScriptModuleCollection_get_Count(mods, &count);
-    todo_wine ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
+    ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
     todo_wine ok(count == 3, "count is not 3, got %d.\n", count);
     V_VT(&var) = VT_I4;
     V_I4(&var) = count + 1;
@@ -2411,8 +2411,8 @@ static void test_IScriptControl_get_Modules(void)
     SysFreeString(str);
 
     hr = IScriptModuleCollection_get_Count(mods, &count);
-    todo_wine ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
-    todo_wine ok(count == 1, "count is not 1, got %d.\n", count);
+    ok(hr == S_OK, "IScriptModuleCollection_get_Count failed: 0x%08x.\n", hr);
+    ok(count == 1, "count is not 1, got %d.\n", count);
 
     IScriptModuleCollection_Release(mods);
     IScriptControl_Release(sc);




More information about the wine-cvs mailing list