File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
reactos/ntoskrnl/io/pnpmgr Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -1773,7 +1773,7 @@ IopHandleDeviceRemoval(
1773
1773
NextChild = Child -> Sibling ;
1774
1774
Found = FALSE;
1775
1775
1776
- for (i = 0 ; i < DeviceRelations -> Count ; i ++ )
1776
+ for (i = 0 ; DeviceRelations && i < DeviceRelations -> Count ; i ++ )
1777
1777
{
1778
1778
if (IopGetDeviceNode (DeviceRelations -> Objects [i ]) == Child )
1779
1779
{
@@ -1839,18 +1839,21 @@ IopEnumerateDevice(
1839
1839
1840
1840
DeviceRelations = (PDEVICE_RELATIONS )IoStatusBlock .Information ;
1841
1841
1842
+ /*
1843
+ * Send removal IRPs for devices that have disappeared
1844
+ * NOTE: This code handles the case where no relations are specified
1845
+ */
1846
+ IopHandleDeviceRemoval (DeviceNode , DeviceRelations );
1847
+
1848
+ /* Now we bail if nothing was returned */
1842
1849
if (!DeviceRelations )
1843
1850
{
1851
+ /* We're all done */
1844
1852
DPRINT ("No PDOs\n" );
1845
- return STATUS_UNSUCCESSFUL ;
1853
+ return STATUS_SUCCESS ;
1846
1854
}
1847
1855
1848
1856
DPRINT ("Got %u PDOs\n" , DeviceRelations -> Count );
1849
-
1850
- /*
1851
- * Send removal IRPs for devices that have disappeared
1852
- */
1853
- IopHandleDeviceRemoval (DeviceNode , DeviceRelations );
1854
1857
1855
1858
/*
1856
1859
* Create device nodes for all discovered devices
You can’t perform that action at this time.
0 commit comments