Commit 429d0d3e authored by Peter Oberndorfer's avatar Peter Oberndorfer Committed by Alexandre Julliard

comctl32: EnumMRUListA/W fix getting list size by negative item pos.

parent dac63ff6
......@@ -834,8 +834,8 @@ INT WINAPI EnumMRUListW (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
const WINEMRUITEM *witem;
INT desired, datasize;
if (nItemPos >= mp->cursize) return -1;
if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
if (nItemPos >= mp->cursize) return -1;
desired = mp->realMRU[nItemPos];
desired -= 'a';
TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
......@@ -860,8 +860,8 @@ INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
INT desired, datasize;
DWORD lenA;
if (nItemPos >= mp->cursize) return -1;
if ((nItemPos < 0) || !lpBuffer) return mp->cursize;
if (nItemPos >= mp->cursize) return -1;
desired = mp->realMRU[nItemPos];
desired -= 'a';
TRACE("nItemPos=%d, desired=%d\n", nItemPos, desired);
......
......@@ -288,7 +288,6 @@ static void test_MRUListA(void)
iRet = pEnumMRUList(hMRU, 0, NULL, 0);
ok(iRet == 3, "EnumMRUList expected %d, got %d\n", LIST_SIZE, iRet);
todo_wine{
/* negative item pos = get list size */
iRet = pEnumMRUList(hMRU, -1, NULL, 0);
ok(iRet == 3, "EnumMRUList expected %d, got %d\n", LIST_SIZE, iRet);
......@@ -304,7 +303,6 @@ static void test_MRUListA(void)
/* negative item pos = get list size */
iRet = pEnumMRUList(hMRU, -5, buffer, 255);
ok(iRet == 3, "EnumMRUList expected %d, got %d\n", LIST_SIZE, iRet);
}
/* check entry 0 */
buffer[0] = 0;
......
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