Commit 775d4ebd authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

setupapi/tests: Avoid a crash on Win9x.

parent 6ef8569c
...@@ -158,13 +158,18 @@ static void test_SetupGetInfInformation(void) ...@@ -158,13 +158,18 @@ static void test_SetupGetInfInformation(void)
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n"); ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
/* try an invalid inf filename */ /* try an invalid inf filename */
size = 0xdeadbeef; /* do not use NULL as absolute inf filename on win9x (crash) */
SetLastError(0xbeefcafe); if ((GetLastError() != ERROR_BAD_PATHNAME) && /* win95 */
ret = SetupGetInfInformationA(NULL, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size); (GetLastError() != ERROR_FILE_NOT_FOUND)) /* win98 */
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n"); {
ok(GetLastError() == ERROR_INVALID_PARAMETER, size = 0xdeadbeef;
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(0xbeefcafe);
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n"); ret = SetupGetInfInformationA(NULL, INFINFO_INF_NAME_IS_ABSOLUTE, NULL, 0, &size);
ok(ret == FALSE, "Expected SetupGetInfInformation to fail\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER,
"Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError());
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
}
create_inf_file(inf_filename); create_inf_file(inf_filename);
......
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