Jeff Smith : setupapi: Clear error on SetupDiDestroyDeviceInfoList success.

Alexandre Julliard julliard at winehq.org
Mon Aug 3 16:35:36 CDT 2020


Module: wine
Branch: master
Commit: babb1019d1a6adaa5a52398c192b55a083327f45
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=babb1019d1a6adaa5a52398c192b55a083327f45

Author: Jeff Smith <whydoubt at gmail.com>
Date:   Wed Jul 29 09:29:25 2020 -0500

setupapi: Clear error on SetupDiDestroyDeviceInfoList success.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49332
Signed-off-by: Jeff Smith <whydoubt at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/devinst.c       |  1 +
 dlls/setupapi/tests/devinst.c | 16 ++++++++--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 9dacde29ac..de0413e74f 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -2854,6 +2854,7 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
     }
     heap_free(set);
 
+    SetLastError(ERROR_SUCCESS);
     return TRUE;
 }
 
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 58b6303608..48b84c21e8 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -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");
 




More information about the wine-cvs mailing list