From 67ef5151744b347d4a30c985da6712fb0061e675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= Date: Mon, 15 Jun 2020 16:00:04 +0300 Subject: [PATCH] msscript.ocx: Implement IScriptModuleCollection::get_Count. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gabriel Ivăncescu Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- 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 e397044fd7e..8fb127e0e3c 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 6a0730368ca..fbbe83191ba 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);