Commit 9b968811 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

setupapi: Fix a failing test in Vista.

parent 18c45d8b
...@@ -136,6 +136,7 @@ static void test_SetupGetInfInformation(void) ...@@ -136,6 +136,7 @@ static void test_SetupGetInfInformation(void)
PSP_INF_INFORMATION info; PSP_INF_INFORMATION info;
CHAR inf_filename[MAX_PATH]; CHAR inf_filename[MAX_PATH];
CHAR inf_one[MAX_PATH], inf_two[MAX_PATH]; CHAR inf_one[MAX_PATH], inf_two[MAX_PATH];
LPSTR revfile;
DWORD size; DWORD size;
HINF hinf; HINF hinf;
BOOL ret; BOOL ret;
...@@ -240,11 +241,6 @@ static void test_SetupGetInfInformation(void) ...@@ -240,11 +241,6 @@ static void test_SetupGetInfInformation(void)
ok(check_info_filename(info, inf_filename), "Expected returned filename to be equal\n"); ok(check_info_filename(info, inf_filename), "Expected returned filename to be equal\n");
SetupCloseInfFile(hinf); SetupCloseInfFile(hinf);
lstrcpyA(inf_one, WIN_DIR);
lstrcatA(inf_one, "\\inf\\");
lstrcatA(inf_one, "test.inf");
create_inf_file(inf_one);
lstrcpyA(inf_two, WIN_DIR); lstrcpyA(inf_two, WIN_DIR);
lstrcatA(inf_two, "\\system32\\"); lstrcatA(inf_two, "\\system32\\");
lstrcatA(inf_two, "test.inf"); lstrcatA(inf_two, "test.inf");
...@@ -253,9 +249,24 @@ static void test_SetupGetInfInformation(void) ...@@ -253,9 +249,24 @@ static void test_SetupGetInfInformation(void)
HeapFree(GetProcessHeap(), 0, info); HeapFree(GetProcessHeap(), 0, info);
info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size); info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
/* check if system32 is searched for inf */
ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size);
if (!ret && GetLastError() == ERROR_FILE_NOT_FOUND)
revfile = inf_one; /* Vista */
else
revfile = inf_two;
lstrcpyA(inf_one, WIN_DIR);
lstrcatA(inf_one, "\\inf\\");
lstrcatA(inf_one, "test.inf");
create_inf_file(inf_one);
HeapFree(GetProcessHeap(), 0, info);
info = alloc_inf_info("test.inf", INFINFO_DEFAULT_SEARCH, &size);
/* test the INFINFO_DEFAULT_SEARCH search flag */ /* test the INFINFO_DEFAULT_SEARCH search flag */
ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size); ret = SetupGetInfInformationA("test.inf", INFINFO_DEFAULT_SEARCH, info, size, &size);
ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n"); ok(ret == TRUE, "Expected SetupGetInfInformation to succeed: %d\n", GetLastError());
ok(check_info_filename(info, inf_one), "Expected returned filename to be equal\n"); ok(check_info_filename(info, inf_one), "Expected returned filename to be equal\n");
HeapFree(GetProcessHeap(), 0, info); HeapFree(GetProcessHeap(), 0, info);
...@@ -264,7 +275,7 @@ static void test_SetupGetInfInformation(void) ...@@ -264,7 +275,7 @@ static void test_SetupGetInfInformation(void)
/* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */ /* test the INFINFO_REVERSE_DEFAULT_SEARCH search flag */
ret = SetupGetInfInformationA("test.inf", INFINFO_REVERSE_DEFAULT_SEARCH, info, size, &size); ret = SetupGetInfInformationA("test.inf", INFINFO_REVERSE_DEFAULT_SEARCH, info, size, &size);
ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n"); ok(ret == TRUE, "Expected SetupGetInfInformation to succeed\n");
ok(check_info_filename(info, inf_two), "Expected returned filename to be equal\n"); ok(check_info_filename(info, revfile), "Expected returned filename to be equal\n");
HeapFree(GetProcessHeap(), 0, info); HeapFree(GetProcessHeap(), 0, info);
......
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