Fixed regression in DPA_Search.

This commit is contained in:
Alexandre Julliard 2005-08-01 14:50:36 +00:00
parent 068fa0aa21
commit 90c3c89aea
2 changed files with 5 additions and 2 deletions

View File

@ -815,8 +815,7 @@ INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
else /* (n > 0) */
l = x + 1;
}
return l;
if (uOptions & (DPAS_INSERTBEFORE|DPAS_INSERTAFTER)) return l;
}
else {
/* array is not sorted --> use linear search */

View File

@ -307,6 +307,10 @@ static void test_dpa(void)
i = pDPA_Search(dpa, (PVOID)3, 0,
CB_CmpLT, 0xdeadbeef, DPAS_SORTED|DPAS_INSERTBEFORE);
ok(i == 2, "i=%d\n", i);
/* without DPAS_INSERTBEFORE/AFTER */
i = pDPA_Search(dpa, (PVOID)3, 0,
CB_CmpLT, 0xdeadbeef, DPAS_SORTED);
ok(i == -1, "i=%d\n", i);
/* Re-insert the item */
ret = pDPA_InsertPtr(dpa, 2, (PVOID)3);