mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 04:35:53 +00:00
[NTOSKRNL]
- Handle NULL device relations better svn path=/trunk/; revision=53292
This commit is contained in:
parent
14345748e5
commit
e1776e956d
1 changed files with 10 additions and 7 deletions
|
@ -1773,7 +1773,7 @@ IopHandleDeviceRemoval(
|
|||
NextChild = Child->Sibling;
|
||||
Found = FALSE;
|
||||
|
||||
for (i = 0; i < DeviceRelations->Count; i++)
|
||||
for (i = 0; DeviceRelations && i < DeviceRelations->Count; i++)
|
||||
{
|
||||
if (IopGetDeviceNode(DeviceRelations->Objects[i]) == Child)
|
||||
{
|
||||
|
@ -1839,18 +1839,21 @@ IopEnumerateDevice(
|
|||
|
||||
DeviceRelations = (PDEVICE_RELATIONS)IoStatusBlock.Information;
|
||||
|
||||
/*
|
||||
* Send removal IRPs for devices that have disappeared
|
||||
* NOTE: This code handles the case where no relations are specified
|
||||
*/
|
||||
IopHandleDeviceRemoval(DeviceNode, DeviceRelations);
|
||||
|
||||
/* Now we bail if nothing was returned */
|
||||
if (!DeviceRelations)
|
||||
{
|
||||
/* We're all done */
|
||||
DPRINT("No PDOs\n");
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
DPRINT("Got %u PDOs\n", DeviceRelations->Count);
|
||||
|
||||
/*
|
||||
* Send removal IRPs for devices that have disappeared
|
||||
*/
|
||||
IopHandleDeviceRemoval(DeviceNode, DeviceRelations);
|
||||
|
||||
/*
|
||||
* Create device nodes for all discovered devices
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue