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

This commit is contained in:
Peter Oberndorfer 2007-12-05 20:10:55 +01:00 committed by Alexandre Julliard
parent dac63ff680
commit 429d0d3eb3
2 changed files with 2 additions and 4 deletions

View File

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

View File

@ -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;