Alex Henrie : shell32: Implement FolderItems_get_Count.
Alexandre Julliard
julliard at winehq.org
Tue Sep 12 15:40:39 CDT 2017
Module: wine
Branch: master
Commit: aac8d46c21677eca13a165e2d2380b3c92b7e3cb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=aac8d46c21677eca13a165e2d2380b3c92b7e3cb
Author: Alex Henrie <alexhenrie24 at gmail.com>
Date: Mon Sep 11 23:16:42 2017 -0600
shell32: Implement FolderItems_get_Count.
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
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 64ffd34..ec52c6d 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 63d6f94..0529bb2 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;
More information about the wine-cvs
mailing list