ntoskrnl: Dereference the device children in IoDeleteDevice().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
6460f72db4
commit
e56e4f97a4
|
@ -1628,9 +1628,17 @@ void WINAPI IoDeleteDevice( DEVICE_OBJECT *device )
|
|||
{
|
||||
struct wine_device *wine_device = CONTAINING_RECORD(device, struct wine_device, device_obj);
|
||||
DEVICE_OBJECT **prev = &device->DriverObject->DeviceObject;
|
||||
DEVICE_RELATIONS *children;
|
||||
unsigned int i;
|
||||
|
||||
while (*prev && *prev != device) prev = &(*prev)->NextDevice;
|
||||
if (*prev) *prev = (*prev)->NextDevice;
|
||||
ExFreePool( wine_device->children );
|
||||
if ((children = wine_device->children))
|
||||
{
|
||||
for (i = 0; i < children->Count; ++i)
|
||||
ObDereferenceObject( children->Objects[i] );
|
||||
ExFreePool( children );
|
||||
}
|
||||
ObDereferenceObject( device );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue