Commit 3ff98740 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

setupapi: Implement SetupDiRemoveDeviceInterface().

parent 0cc68cf8
......@@ -556,6 +556,19 @@ static BOOL SETUPDI_SetDeviceRegistryPropertyW(struct device *device,
return FALSE;
}
static void remove_device_iface(struct device_iface *iface)
{
RegDeleteTreeW(iface->refstr_key, NULL);
RegDeleteKeyW(iface->refstr_key, emptyW);
RegCloseKey(iface->refstr_key);
iface->refstr_key = NULL;
/* Also remove the class key if it's empty. */
RegDeleteKeyW(iface->class_key, emptyW);
RegCloseKey(iface->class_key);
iface->class_key = NULL;
iface->flags |= SPINT_REMOVED;
}
static void SETUPDI_RemoveDevice(struct device *device)
{
struct device_iface *iface, *next;
......@@ -1537,11 +1550,18 @@ BOOL WINAPI SetupDiRemoveDevice(
/***********************************************************************
* SetupDiRemoveDeviceInterface (SETUPAPI.@)
*/
BOOL WINAPI SetupDiRemoveDeviceInterface(HDEVINFO info, PSP_DEVICE_INTERFACE_DATA data)
BOOL WINAPI SetupDiRemoveDeviceInterface(HDEVINFO devinfo, SP_DEVICE_INTERFACE_DATA *iface_data)
{
FIXME("(%p, %p): stub\n", info, data);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return FALSE;
struct device_iface *iface;
TRACE("devinfo %p, iface_data %p.\n", devinfo, iface_data);
if (!(iface = get_device_iface(devinfo, iface_data)))
return FALSE;
remove_device_iface(iface);
return TRUE;
}
/***********************************************************************
......
......@@ -552,7 +552,6 @@ static void check_device_iface_(int line, HDEVINFO set, SP_DEVINFO_DATA *device,
ok_(__FILE__, line)(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError());
ok_(__FILE__, line)(IsEqualGUID(&iface.InterfaceClassGuid, class),
"Got unexpected class %s.\n", wine_dbgstr_guid(&iface.InterfaceClassGuid));
todo_wine_if(flags & SPINT_REMOVED)
ok_(__FILE__, line)(iface.Flags == flags, "Got unexpected flags %#x.\n", iface.Flags);
ret = SetupDiGetDeviceInterfaceDetailA(set, &iface, detail, sizeof(buffer), NULL, NULL);
ok_(__FILE__, line)(ret, "Failed to get interface detail, error %#x.\n", GetLastError());
......@@ -656,7 +655,6 @@ static void test_device_iface(void)
ret = SetupDiEnumDeviceInterfaces(set, &device, &guid2, 0, &iface);
ok(ret, "Failed to enumerate interfaces, error %#x.\n", GetLastError());
ret = SetupDiRemoveDeviceInterface(set, &iface);
todo_wine
ok(ret, "Failed to remove interface, error %#x.\n", GetLastError());
check_device_iface(set, &device, &guid2, 0, SPINT_REMOVED, "\\\\?\\ROOT#LEGACY_BOGUS#0000#{6A55B5A5-3F65-11DB-B704-0011955C2BDB}");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment