setupapi: When freeing an interface, delete it from the registry if its device is a phantom.

This commit is contained in:
Juan Lang 2007-09-21 17:08:51 -07:00 committed by Alexandre Julliard
parent dadcb201d9
commit 7de0f1d583
1 changed files with 9 additions and 0 deletions

View File

@ -152,6 +152,15 @@ static void SETUPDI_FreeInterfaceInstances(struct InterfaceInstances *instances)
struct InterfaceInfo *ifaceInfo =
(struct InterfaceInfo *)instances->instances[i].Reserved;
if (ifaceInfo->device && ifaceInfo->device->Reserved)
{
struct DeviceInfo *devInfo =
(struct DeviceInfo *)ifaceInfo->device->Reserved;
if (devInfo->phantom)
SetupDiDeleteDeviceInterfaceRegKey(devInfo->set,
&instances->instances[i], 0);
}
HeapFree(GetProcessHeap(), 0, ifaceInfo->referenceString);
HeapFree(GetProcessHeap(), 0, ifaceInfo->symbolicLink);
}