There's no guarantee that 0xffffffff is an invalid handle on 64-bit.
Signed-off-by: Alex Henrie alexhenrie24@gmail.com --- dlls/kernel32/tests/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 8ec3a5433ee..77338e7f767 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -206,13 +206,13 @@ static void testGetModuleFileName_Wrong(void) if (is_unicode_enabled) { bufW[0] = '*'; - ok(GetModuleFileNameW((void*)0xffffffff, bufW, ARRAY_SIZE(bufW)) == 0, + ok(GetModuleFileNameW(INVALID_HANDLE_VALUE, bufW, ARRAY_SIZE(bufW)) == 0, "Unexpected success in module handle\n"); ok(bufW[0] == '*', "When failing, buffer shouldn't be written to\n"); }
bufA[0] = '*'; - ok(GetModuleFileNameA((void*)0xffffffff, bufA, sizeof(bufA)) == 0, "Unexpected success in module handle\n"); + ok(GetModuleFileNameA(INVALID_HANDLE_VALUE, bufA, sizeof(bufA)) == 0, "Unexpected success in module handle\n"); ok(bufA[0] == '*', "When failing, buffer shouldn't be written to\n"); }
Alex Henrie alexhenrie24@gmail.com writes:
There's no guarantee that 0xffffffff is an invalid handle on 64-bit.
It can't possibly be a valid module handle, though something like 0xdeadbeef may be preferable. Note also that INVALID_HANDLE_VALUE is for file handles, not for modules.