setupapi: Fix some last errors for SetupGetLineByIndex.
authorPaul Vriens <paul.vriens.wine@gmail.com>
Fri, 28 Mar 2008 15:41:20 +0000 (16:41 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 28 Mar 2008 20:42:15 +0000 (21:42 +0100)
dlls/setupapi/parser.c
dlls/setupapi/tests/parser.c

index d266cf8b3d696608e9cfb4baee8ab224e859178b..f6de4ed8550d9a544045cbb037142abc08c3258f 100644 (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;
 }
 
index 1c74bd31caaaeb0154ca57c70e0849fc40e86735..d49c37ff412de1bdbd34fab08e9d6a6ddddbf91a 100644 (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());