setupapi: Fix SetupCloseInfFile when a NULL handle is given, with tests.
This commit is contained in:
parent
251d76888d
commit
bce44161f1
|
@ -1220,6 +1220,8 @@ void WINAPI SetupCloseInfFile( HINF hinf )
|
|||
struct inf_file *file = hinf;
|
||||
unsigned int i;
|
||||
|
||||
if (!file) return;
|
||||
|
||||
for (i = 0; i < file->nb_sections; i++) HeapFree( GetProcessHeap(), 0, file->sections[i] );
|
||||
HeapFree( GetProcessHeap(), 0, file->filename );
|
||||
HeapFree( GetProcessHeap(), 0, file->sections );
|
||||
|
|
|
@ -387,10 +387,18 @@ static void test_key_names(void)
|
|||
|
||||
}
|
||||
|
||||
static void test_close_inf_file(void)
|
||||
{
|
||||
SetLastError(0xdeadbeef);
|
||||
SetupCloseInfFile(NULL);
|
||||
ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %ld\n", GetLastError());
|
||||
}
|
||||
|
||||
START_TEST(parser)
|
||||
{
|
||||
test_invalid_files();
|
||||
test_section_names();
|
||||
test_key_names();
|
||||
test_close_inf_file();
|
||||
DeleteFileA( tmpfile );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue