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)
ok(size == 0xdeadbeef, "Expected size to remain unchanged\n");
/* try an invalid inf filename */
size = 0xdeadbeef;
SetLastError(0xbeefcafe);
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");
/* do not use NULL as absolute inf filename on win9x (crash) */
if ((GetLastError() != ERROR_BAD_PATHNAME) && /* win95 */
(GetLastError() != ERROR_FILE_NOT_FOUND)) /* win98 */
{
size = 0xdeadbeef;
SetLastError(0xbeefcafe);
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);
......
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