Commit 50e81d0e authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

setupapi: Fix some last errors for SetupFindFirstLine.

parent 84308ffc
...@@ -1371,7 +1371,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE ...@@ -1371,7 +1371,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
struct inf_file *file; struct inf_file *file;
int section_index; int section_index;
SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next) for (file = hinf; file; file = file->next)
{ {
if ((section_index = find_section( file, section )) == -1) continue; if ((section_index = find_section( file, section )) == -1) continue;
...@@ -1384,7 +1383,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE ...@@ -1384,7 +1383,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
ctx.Line = -1; ctx.Line = -1;
return SetupFindNextMatchLineW( &ctx, key, context ); return SetupFindNextMatchLineW( &ctx, key, context );
} }
SetLastError( ERROR_LINE_NOT_FOUND ); /* found at least one section */
if (file->sections[section_index]->nb_lines) if (file->sections[section_index]->nb_lines)
{ {
context->Inf = hinf; context->Inf = hinf;
...@@ -1398,6 +1396,7 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE ...@@ -1398,6 +1396,7 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
} }
} }
TRACE( "(%p,%s,%s): not found\n", hinf, debugstr_w(section), debugstr_w(key) ); TRACE( "(%p,%s,%s): not found\n", hinf, debugstr_w(section), debugstr_w(key) );
SetLastError( ERROR_LINE_NOT_FOUND );
return FALSE; return FALSE;
} }
......
...@@ -499,14 +499,12 @@ static void test_GLE(void) ...@@ -499,14 +499,12 @@ static void test_GLE(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "ImNotThere", NULL, &context ); retb = SetupFindFirstLineA( hinf, "ImNotThere", NULL, &context );
ok(!retb, "Expected failure\n"); ok(!retb, "Expected failure\n");
todo_wine
ok(GetLastError() == ERROR_LINE_NOT_FOUND, ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError()); "Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
retb = SetupFindFirstLineA( hinf, "ImNotThere", "ImNotThere", &context ); retb = SetupFindFirstLineA( hinf, "ImNotThere", "ImNotThere", &context );
ok(!retb, "Expected failure\n"); ok(!retb, "Expected failure\n");
todo_wine
ok(GetLastError() == ERROR_LINE_NOT_FOUND, ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError()); "Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
...@@ -555,7 +553,6 @@ static void test_GLE(void) ...@@ -555,7 +553,6 @@ static void test_GLE(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
retb = SetupGetLineTextA( NULL, hinf, "ImNotThere", "ImNotThere", buf, bufsize, &retsize); retb = SetupGetLineTextA( NULL, hinf, "ImNotThere", "ImNotThere", buf, bufsize, &retsize);
ok(!retb, "Expected failure\n"); ok(!retb, "Expected failure\n");
todo_wine
ok(GetLastError() == ERROR_LINE_NOT_FOUND, ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError()); "Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
......
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