setupapi: Clear error on SetupDiDestroyDeviceInfoList success.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49332
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jeff Smith 2020-07-29 09:29:25 -05:00 committed by Alexandre Julliard
parent f9028142d1
commit babb1019d1
2 changed files with 9 additions and 8 deletions

View File

@ -2854,6 +2854,7 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
}
heap_free(set);
SetLastError(ERROR_SUCCESS);
return TRUE;
}

View File

@ -2711,7 +2711,7 @@ static void test_class_installer(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2746,7 +2746,7 @@ static void test_class_installer(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* Test returning ERROR_DI_DO_DEFAULT. */
@ -2775,7 +2775,7 @@ static void test_class_installer(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* The default entry point is ClassInstall(). */
@ -2798,7 +2798,7 @@ static void test_class_installer(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2869,7 +2869,7 @@ static void test_class_coinstaller(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
todo_wine ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
todo_wine ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2901,7 +2901,7 @@ static void test_class_coinstaller(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
/* The default entry point is CoDeviceInstall(). */
@ -2927,7 +2927,7 @@ static void test_class_coinstaller(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(*coinst_callback_count == 1, "Got %d callbacks.\n", *coinst_callback_count);
ok(*coinst_last_message == DIF_DESTROYPRIVATEDATA, "Got unexpected message %#x.\n", *coinst_last_message);
@ -2978,7 +2978,7 @@ static void test_call_class_installer(void)
SetLastError(0xdeadbeef);
ret = SetupDiDestroyDeviceInfoList(set);
ok(ret, "Failed to destroy device list.\n");
todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError());
load_resource("coinst.dll", "C:\\windows\\system32\\winetest_coinst.dll");