Fix IoGetDeviceProperty, which should never return STATUS_BUFFER_OVERFLOW, but STATUS_BUFFER_TOO_SMALL
Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c

Modified: trunk/reactos/ntoskrnl/io/pnpmgr.c
--- trunk/reactos/ntoskrnl/io/pnpmgr.c	2005-10-16 23:01:01 UTC (rev 18505)
+++ trunk/reactos/ntoskrnl/io/pnpmgr.c	2005-10-17 08:41:00 UTC (rev 18506)
@@ -325,15 +325,12 @@
         if (!NT_SUCCESS(Status))
         {
           ExFreePool(ValueInformation);
-          return Status;
+          if (Status == STATUS_BUFFER_OVERFLOW)
+            return STATUS_BUFFER_TOO_SMALL;
+          else
+            return Status;
         }
 
-        if (ValueInformation->DataLength > BufferLength)
-        {
-          ExFreePool(ValueInformation);
-          return STATUS_BUFFER_TOO_SMALL;
-        }
-
         /* FIXME: Verify the value (NULL-terminated, correct format). */
 
         RtlCopyMemory(PropertyBuffer, ValueInformation->Data,