Commit 9f4c67d5 authored by Michael Jung's avatar Michael Jung Committed by Alexandre Julliard

Return correct HRESULT code in UnixFolder's IEnumIDList::Next.

Corresponding test.
parent 199efb74
...@@ -1603,7 +1603,7 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Next(IEnumIDList* iface, ...@@ -1603,7 +1603,7 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Next(IEnumIDList* iface,
if (pceltFetched) if (pceltFetched)
*pceltFetched = i; *pceltFetched = i;
return i == celt ? S_OK : S_FALSE; return (i == 0) ? S_FALSE : S_OK;
} }
static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Skip(IEnumIDList* iface, ULONG celt) static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Skip(IEnumIDList* iface, ULONG celt)
......
...@@ -104,7 +104,7 @@ static void Cleanup(void) ...@@ -104,7 +104,7 @@ static void Cleanup(void)
static void test_EnumObjects(IShellFolder *iFolder) static void test_EnumObjects(IShellFolder *iFolder)
{ {
IEnumIDList *iEnumList; IEnumIDList *iEnumList;
ITEMIDLIST *newPIDL, *(idlArr [5]); LPITEMIDLIST newPIDL, idlArr[10];
ULONG NumPIDLs; ULONG NumPIDLs;
int i=0, j; int i=0, j;
HRESULT hr; HRESULT hr;
...@@ -131,10 +131,13 @@ static void test_EnumObjects(IShellFolder *iFolder) ...@@ -131,10 +131,13 @@ static void test_EnumObjects(IShellFolder *iFolder)
hr = IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList); hr = IShellFolder_EnumObjects(iFolder, NULL, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN, &iEnumList);
ok(hr == S_OK, "EnumObjects failed %08lx\n", hr); ok(hr == S_OK, "EnumObjects failed %08lx\n", hr);
while (IEnumIDList_Next(iEnumList, 1, &newPIDL, &NumPIDLs) == S_OK) /* This is to show that, contrary to what is said on MSDN on IEnumIDList::Next,
{ * the filesystem shellfolders return S_OK even if less then 'celt' items are
idlArr[i++] = newPIDL; * returned (in contrast to S_FALSE). We have to do it in a loop since WinXP
} * only ever returns a single entry per call. */
while (IEnumIDList_Next(iEnumList, 10-i, &idlArr[i], &NumPIDLs) == S_OK)
i += NumPIDLs;
ok (i == 5, "i: %d\n", i);
hr = IEnumIDList_Release(iEnumList); hr = IEnumIDList_Release(iEnumList);
ok(hr == S_OK, "IEnumIDList_Release failed %08lx\n", hr); ok(hr == S_OK, "IEnumIDList_Release failed %08lx\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment