setupapi: Fix some last errors for SetupFindFirstLine.
This commit is contained in:
parent
84308ffcde
commit
50e81d0e6d
|
@ -1371,7 +1371,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
|
|||
struct inf_file *file;
|
||||
int section_index;
|
||||
|
||||
SetLastError( ERROR_SECTION_NOT_FOUND );
|
||||
for (file = hinf; file; file = file->next)
|
||||
{
|
||||
if ((section_index = find_section( file, section )) == -1) continue;
|
||||
|
@ -1384,7 +1383,6 @@ BOOL WINAPI SetupFindFirstLineW( HINF hinf, PCWSTR section, PCWSTR key, INFCONTE
|
|||
ctx.Line = -1;
|
||||
return SetupFindNextMatchLineW( &ctx, key, context );
|
||||
}
|
||||
SetLastError( ERROR_LINE_NOT_FOUND ); /* found at least one section */
|
||||
if (file->sections[section_index]->nb_lines)
|
||||
{
|
||||
context->Inf = hinf;
|
||||
|
@ -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) );
|
||||
SetLastError( ERROR_LINE_NOT_FOUND );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -499,14 +499,12 @@ static void test_GLE(void)
|
|||
SetLastError(0xdeadbeef);
|
||||
retb = SetupFindFirstLineA( hinf, "ImNotThere", NULL, &context );
|
||||
ok(!retb, "Expected failure\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
|
||||
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
retb = SetupFindFirstLineA( hinf, "ImNotThere", "ImNotThere", &context );
|
||||
ok(!retb, "Expected failure\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
|
||||
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
|
||||
|
||||
|
@ -555,7 +553,6 @@ static void test_GLE(void)
|
|||
SetLastError(0xdeadbeef);
|
||||
retb = SetupGetLineTextA( NULL, hinf, "ImNotThere", "ImNotThere", buf, bufsize, &retsize);
|
||||
ok(!retb, "Expected failure\n");
|
||||
todo_wine
|
||||
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
|
||||
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());
|
||||
|
||||
|
|
Loading…
Reference in New Issue