Skip to content

Commit 39c9f57

Browse files
xmine64binarymaster
authored andcommitted
[USER32_APITEST] Add LookupIconIdFromDirectoryEx invalid input test (reactos#9263)
Calling it with invalid pointer crashes the caller, while on Windows it returns 0 without error or crash. CORE-19544
1 parent 189eae4 commit 39c9f57

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎modules/rostests/apitests/user32/LookupIconIdFromDirectoryEx.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11

22
#include "precomp.h"
33

4+
#include <ndk/umtypes.h>
5+
46
START_TEST(LookupIconIdFromDirectoryEx)
57
{
68
HRSRC hResource;
@@ -124,4 +126,12 @@ START_TEST(LookupIconIdFromDirectoryEx)
124126
ok(ChangeDisplaySettingsExW(NULL, &dm, NULL, 0, NULL) == DISP_CHANGE_SUCCESSFUL, "\n");
125127

126128
FreeResource(hMem);
129+
130+
/* Test invalid directory */
131+
StartSeh()
132+
SetLastError(0xdeadbeef);
133+
wResId = LookupIconIdFromDirectoryEx((PBYTE)(LONG_PTR)0xdeadbeef, TRUE, 0, 0, LR_DEFAULTSIZE);
134+
ok_eq_int(wResId, 0);
135+
ok_eq_ulong(GetLastError(), 0xdeadbeef);
136+
EndSeh(STATUS_SUCCESS);
127137
}

0 commit comments

Comments
 (0)