setupapi: Fix some last errors for SetupGetLineByIndex.

oldstable
Paul Vriens 2008-03-28 16:41:20 +01:00 committed by Alexandre Julliard
parent 50e81d0e6d
commit a3557272f4
2 changed files with 1 additions and 3 deletions

View File

@ -1311,11 +1311,9 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
struct inf_file *file = hinf;
int section_index;
SetLastError( ERROR_SECTION_NOT_FOUND );
for (file = hinf; file; file = file->next)
{
if ((section_index = find_section( file, section )) == -1) continue;
SetLastError( ERROR_LINE_NOT_FOUND );
if (index < file->sections[section_index]->nb_lines)
{
context->Inf = hinf;
@ -1330,6 +1328,7 @@ BOOL WINAPI SetupGetLineByIndexW( HINF hinf, PCWSTR section, DWORD index, INFCON
index -= file->sections[section_index]->nb_lines;
}
TRACE( "(%p,%s) not found\n", hinf, debugstr_w(section) );
SetLastError( ERROR_LINE_NOT_FOUND );
return FALSE;
}

View File

@ -571,7 +571,6 @@ static void test_GLE(void)
SetLastError(0xdeadbeef);
retb = SetupGetLineByIndexA( hinf, "ImNotThere", 1, &context );
ok(!retb, "Expected failure\n");
todo_wine
ok(GetLastError() == ERROR_LINE_NOT_FOUND,
"Expected ERROR_LINE_NOT_FOUND, got %08x\n", GetLastError());