Commit 2b19e357 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

user32: win2k3's GetWindowModuleFileName does return ERROR_INSUFFICIENT_BUFFER.

parent 4c928d39
...@@ -4695,22 +4695,30 @@ static void test_GetWindowModuleFileName(void) ...@@ -4695,22 +4695,30 @@ static void test_GetWindowModuleFileName(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret2 = GetModuleFileName(hinst, buf2, ret1 - 2); ret2 = GetModuleFileName(hinst, buf2, ret1 - 2);
ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2); ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3 */
"expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret2 = GetModuleFileName(hinst, buf2, 0); ret2 = GetModuleFileName(hinst, buf2, 0);
ok(!ret2, "GetModuleFileName should return 0\n"); ok(!ret2, "GetModuleFileName should return 0\n");
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3 */
"expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret2 = pGetWindowModuleFileNameA(hwnd, buf2, ret1 - 2); ret2 = pGetWindowModuleFileNameA(hwnd, buf2, ret1 - 2);
ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2); ok(ret2 == ret1 - 2, "expected %u, got %u\n", ret1 - 2, ret2);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3 */
"expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret2 = pGetWindowModuleFileNameA(hwnd, buf2, 0); ret2 = pGetWindowModuleFileNameA(hwnd, buf2, 0);
ok(!ret2, "expected 0, got %u\n", ret2); ok(!ret2, "expected 0, got %u\n", ret2);
ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); ok(GetLastError() == 0xdeadbeef ||
GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3 */
"expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError());
DestroyWindow(hwnd); DestroyWindow(hwnd);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment