comctl32: EnumMRUListA/W fix getting list size by negative item pos.
This commit is contained in:
parent
dac63ff680
commit
429d0d3eb3
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue