From: Alex Henrie Subject: [PATCH v12 3/3] shell32: Implement FolderItems_get_Count. Message-Id: <20160909060254.6294-3-alexhenrie24@gmail.com> Date: Fri, 9 Sep 2016 00:02:24 -0600 In-Reply-To: <20160909060254.6294-1-alexhenrie24@gmail.com> References: <20160909060254.6294-1-alexhenrie24@gmail.com> Cc: Sebastian Lackner Signed-off-by: Alex Henrie --- dlls/shell32/shelldispatch.c | 7 +++++-- dlls/shell32/tests/shelldispatch.c | 8 -------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c index 0aa9bf0..1a2874d7 100644 --- a/dlls/shell32/shelldispatch.c +++ b/dlls/shell32/shelldispatch.c @@ -1061,9 +1061,12 @@ static HRESULT WINAPI FolderItemsImpl_Invoke(FolderItems3 *iface, static HRESULT WINAPI FolderItemsImpl_get_Count(FolderItems3 *iface, LONG *count) { - FIXME("(%p,%p)\n", iface, count); + FolderItemsImpl *This = impl_from_FolderItems(iface); - return E_NOTIMPL; + TRACE("(%p,%p)\n", iface, count); + + *count = PathIsDirectoryW(V_BSTR(&This->dir)) ? This->item_count : 0; + return S_OK; } static HRESULT WINAPI FolderItemsImpl_get_Application(FolderItems3 *iface, IDispatch **ppid) diff --git a/dlls/shell32/tests/shelldispatch.c b/dlls/shell32/tests/shelldispatch.c index e18bb6a..a390876 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -378,9 +378,7 @@ static void test_items(void) r = FolderItems_get_Count(items, NULL); r = FolderItems_get_Count(items, &lcount); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!lcount, "expected 0 files, got %d\n", lcount); V_VT(&var) = VT_I4; @@ -435,9 +433,7 @@ todo_wine lcount = -1; r = FolderItems_get_Count(items, &lcount); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!lcount, "expected 0 files, got %d\n", lcount); MultiByteToWideChar(CP_ACP, 0, file_defs[0].name, -1, wstr, MAX_PATH); @@ -464,9 +460,7 @@ todo_wine lcount = -1; r = FolderItems_get_Count(items, &lcount); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(lcount == sizeof(file_defs)/sizeof(file_defs[0]), "expected %d files, got %d\n", sizeof(file_defs)/sizeof(file_defs[0]), lcount); @@ -676,9 +670,7 @@ todo_wine lcount = -1; r = FolderItems_get_Count(items, &lcount); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!lcount, "expected 0 files, got %d\n", lcount); item = NULL; -- 2.9.3