[PATCH 4/6] shell32: Fix IEnumIDList::Next() called for multiple items

Nikolay Sivov nsivov at codeweavers.com
Wed Sep 27 03:13:45 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/shell32/shelldispatch.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/shelldispatch.c b/dlls/shell32/shelldispatch.c
index 3763ff8f94..148c45fe75 100644
--- a/dlls/shell32/shelldispatch.c
+++ b/dlls/shell32/shelldispatch.c
@@ -1284,7 +1284,10 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
 
     if (This->item_count)
     {
-        LPITEMIDLIST *pidls = HeapAlloc(GetProcessHeap(), 0, This->item_count * sizeof(*pidls));
+        LPITEMIDLIST *pidls;
+        ULONG fetched;
+
+        pidls = HeapAlloc(GetProcessHeap(), 0, This->item_count * sizeof(*pidls));
         This->item_names = HeapAlloc(GetProcessHeap(), 0, This->item_count * sizeof(*This->item_names));
 
         if (!pidls || !This->item_names)
@@ -1296,7 +1299,7 @@ static HRESULT FolderItems_Constructor(FolderImpl *folder, FolderItems **ret)
         }
 
         IEnumIDList_Reset(enumidlist);
-        if (IEnumIDList_Next(enumidlist, This->item_count, pidls, NULL) == S_OK)
+        if (IEnumIDList_Next(enumidlist, This->item_count, pidls, &fetched) == S_OK)
             idlist_sort(pidls, 0, This->item_count - 1, folder->folder);
 
         for (i = 0; i < This->item_count; i++)
-- 
2.14.1




More information about the wine-patches mailing list