setupapi: Call DIF_DESTROYPRIVATEDATA when deleting a device.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-05-22 11:15:40 -05:00 committed by Alexandre Julliard
parent fce26e60cc
commit afba7d9d93
2 changed files with 9 additions and 4 deletions

View File

@ -724,6 +724,11 @@ static void remove_device(struct device *device)
static void delete_device(struct device *device)
{
struct device_iface *iface, *next;
SP_DEVINFO_DATA device_data;
device_data.cbSize = sizeof(device_data);
copy_device_data(&device_data, device);
SetupDiCallClassInstaller(DIF_DESTROYPRIVATEDATA, device->set, &device_data);
if (device->phantom)
remove_device(device);

View File

@ -2420,8 +2420,8 @@ static void test_class_installer(void)
SetupDiDestroyDeviceInfoList(set);
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);
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);
*coinst_callback_count = 0;
/* Test returning an error. */
@ -2498,8 +2498,8 @@ static void test_class_installer(void)
SetupDiDestroyDeviceInfoList(set);
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);
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);
*coinst_callback_count = 0;
res = RegDeleteKeyA(class_key, "");