shell32: Fix IEnumIDList::Next() called for multiple items.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2017-09-27 11:13:45 +03:00 committed by Alexandre Julliard
parent d484650b6d
commit c14c2ebfb7
1 changed files with 5 additions and 2 deletions

View File

@ -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++)