Author: akhaldi
Date: Sun Dec 27 17:49:53 2015
New Revision: 70440

URL: http://svn.reactos.org/svn/reactos?rev=70440&view=rev
Log:
[0.4.0] * Merge the enumerating device lists fix by Ged in r70408.

Modified:
    branches/ros-branch-0_4_0/   (props changed)
    branches/ros-branch-0_4_0/reactos/   (props changed)
    branches/ros-branch-0_4_0/reactos/ntoskrnl/io/iomgr/device.c

Propchange: branches/ros-branch-0_4_0/
------------------------------------------------------------------------------
--- svn:mergeinfo       (original)
+++ svn:mergeinfo       Sun Dec 27 17:49:53 2015
@@ -1 +1 @@
-/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70436-70437
+/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70436-70437

Propchange: branches/ros-branch-0_4_0/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo       (original)
+++ svn:mergeinfo       Sun Dec 27 17:49:53 2015
@@ -20,4 +20,4 @@
 
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
 /branches/wlan-bringup:54809-54998
-/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70436-70437
+/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70436-70437

Modified: branches/ros-branch-0_4_0/reactos/ntoskrnl/io/iomgr/device.c
URL: 
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/ntoskrnl/io/iomgr/device.c?rev=70440&r1=70439&r2=70440&view=diff
==============================================================================
--- branches/ros-branch-0_4_0/reactos/ntoskrnl/io/iomgr/device.c        
[iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/ntoskrnl/io/iomgr/device.c        
[iso-8859-1] Sun Dec 27 17:49:53 2015
@@ -1088,6 +1088,10 @@
 {
     ULONG ActualDevices = 1;
     PDEVICE_OBJECT CurrentDevice = DriverObject->DeviceObject;
+    KIRQL OldIrql;
+
+    /* Raise to dispatch level */
+    KeRaiseIrql(DISPATCH_LEVEL, &OldIrql);
 
     /* Find out how many devices we'll enumerate */
     while ((CurrentDevice = CurrentDevice->NextDevice)) ActualDevices++;
@@ -1099,13 +1103,14 @@
     *ActualNumberDeviceObjects = ActualDevices;
 
     /* Check if we can support so many */
-    if ((ActualDevices * 4) > DeviceObjectListSize)
+    if ((ActualDevices * sizeof(PDEVICE_OBJECT)) > DeviceObjectListSize)
     {
         /* Fail because the buffer was too small */
+        KeLowerIrql(OldIrql);
         return STATUS_BUFFER_TOO_SMALL;
     }
 
-    /* Check if the caller only wanted the size */
+    /* Check if the caller wanted the device list */
     if (DeviceObjectList)
     {
         /* Loop through all the devices */
@@ -1123,6 +1128,9 @@
             DeviceObjectList++;
         }
     }
+
+    /* Return back to previous IRQL */
+    KeLowerIrql(OldIrql);
 
     /* Return the status */
     return STATUS_SUCCESS;


Reply via email to