From 562c32e489aa6471d9ba517781c4fd79168c87d1 Mon Sep 17 00:00:00 2001 From: winesync Date: Thu, 14 Sep 2023 21:21:50 +0200 Subject: [PATCH] [WINESYNC] setupapi/tests: Add error tests for SetupDiDestroyDeviceInfoList. Signed-off-by: Jeff Smith Signed-off-by: Alexandre Julliard wine commit id f9028142d1e57322f893d7e47d846f72a8c6c72c by Jeff Smith --- modules/rostests/winetests/setupapi/devinst.c | 40 +++++++++++++++---- sdk/tools/winesync/setupapi.cfg | 2 +- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/modules/rostests/winetests/setupapi/devinst.c b/modules/rostests/winetests/setupapi/devinst.c index b94b84e9e21..8d3864e4204 100644 --- a/modules/rostests/winetests/setupapi/devinst.c +++ b/modules/rostests/winetests/setupapi/devinst.c @@ -2712,7 +2712,10 @@ static void test_class_installer(void) ok(*coinst_last_message == DIF_REMOVE, "Got unexpected message %#x.\n", *coinst_last_message); *coinst_callback_count = 0; - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine 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); @@ -2744,7 +2747,10 @@ static void test_class_installer(void) ok(GetLastError() == 0xdeadc0de, "Got unexpected error %#x.\n", GetLastError()); ok(!device_is_registered(set, &device), "Expected device not to be registered.\n"); - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError()); /* Test returning ERROR_DI_DO_DEFAULT. */ @@ -2770,7 +2776,10 @@ static void test_class_installer(void) ok(ret, "Failed to call class installer, error %#x.\n", GetLastError()); ok(!device_is_registered(set, &device), "Expected device not to be registered.\n"); - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError()); /* The default entry point is ClassInstall(). */ @@ -2790,7 +2799,10 @@ static void test_class_installer(void) ok(*coinst_last_message == DIF_ALLOW_INSTALL, "Got unexpected message %#x.\n", *coinst_last_message); *coinst_callback_count = 0; - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine 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); @@ -2858,7 +2870,10 @@ static void test_class_coinstaller(void) ok(*coinst_last_message == DIF_REMOVE, "Got unexpected message %#x.\n", *coinst_last_message); *coinst_callback_count = 0; - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine 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); @@ -2887,7 +2902,10 @@ static void test_class_coinstaller(void) ok(GetLastError() == 0xdeadc0de, "Got unexpected error %#x.\n", GetLastError()); ok(!device_is_registered(set, &device), "Expected device not to be registered.\n"); - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError()); /* The default entry point is CoDeviceInstall(). */ @@ -2910,7 +2928,10 @@ static void test_class_coinstaller(void) ok(*coinst_last_message == DIF_ALLOW_INSTALL, "Got unexpected message %#x.\n", *coinst_last_message); *coinst_callback_count = 0; - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine 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); @@ -2958,7 +2979,10 @@ static void test_call_class_installer(void) ok(ret, "Failed to call class installer, error %#x.\n", GetLastError()); ok(!device_is_registered(set, &device), "Expected device not to be registered.\n"); - SetupDiDestroyDeviceInfoList(set); + SetLastError(0xdeadbeef); + ret = SetupDiDestroyDeviceInfoList(set); + ok(ret, "Failed to destroy device list.\n"); + todo_wine ok(!GetLastError(), "Got unexpected error %#x.\n", GetLastError()); load_resource("coinst.dll", "C:\\windows\\system32\\winetest_coinst.dll"); diff --git a/sdk/tools/winesync/setupapi.cfg b/sdk/tools/winesync/setupapi.cfg index c4485259297..e17cb15e24c 100644 --- a/sdk/tools/winesync/setupapi.cfg +++ b/sdk/tools/winesync/setupapi.cfg @@ -10,4 +10,4 @@ files: dlls/setupapi/setupcab.c: dll/win32/setupapi/setupcab.c dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable_wine.c tags: - wine: cfde18c4904cd76eff40336e064cba86b9831633 + wine: f9028142d1e57322f893d7e47d846f72a8c6c72c