From aac8d46c21677eca13a165e2d2380b3c92b7e3cb Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Mon, 11 Sep 2017 23:16:42 -0600 Subject: [PATCH] shell32: Implement FolderItems_get_Count. Signed-off-by: Alex Henrie Signed-off-by: Nikolay Sivov Signed-off-by: Alexandre Julliard --- 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 64ffd347f7a..ec52c6d613d 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 63d6f94b264..0529bb2d107 100644 --- a/dlls/shell32/tests/shelldispatch.c +++ b/dlls/shell32/tests/shelldispatch.c @@ -444,9 +444,7 @@ static void test_items(void) r = FolderItems_get_Count(items, NULL); r = FolderItems_get_Count(items, &count); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!count, "expected 0 files, got %d\n", count); V_VT(&var) = VT_I4; @@ -484,9 +482,7 @@ todo_wine /* test that get_Count is not aware of the newly created files */ count = -1; r = FolderItems_get_Count(items, &count); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!count, "expected 0 files, got %d\n", count); /* test that the newly created files CAN be retrieved by string index */ @@ -514,9 +510,7 @@ todo_wine count = -1; r = FolderItems_get_Count(items, &count); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(count == sizeof(file_defs)/sizeof(file_defs[0]), "expected %d files, got %d\n", (LONG)(sizeof(file_defs)/sizeof(file_defs[0])), count); @@ -737,9 +731,7 @@ todo_wine /* test that everything stops working after the directory has been removed */ count = -1; r = FolderItems_get_Count(items, &count); -todo_wine ok(r == S_OK, "FolderItems::get_Count failed: %08x\n", r); -todo_wine ok(!count, "expected 0 files, got %d\n", count); item = NULL; -- 2.11.4.GIT