Fix IoGetDeviceProperty, which should never return STATUS_BUFFER_OVERFLOW, but STATUS...
authorHervé Poussineau <hpoussin@reactos.org>
Mon, 17 Oct 2005 08:41:00 +0000 (08:41 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Mon, 17 Oct 2005 08:41:00 +0000 (08:41 +0000)
svn path=/trunk/; revision=18506

reactos/ntoskrnl/io/pnpmgr.c

index 2408d4b..c81aedf 100644 (file)
@@ -325,13 +325,10 @@ IoGetDeviceProperty(
         if (!NT_SUCCESS(Status))
         {
           ExFreePool(ValueInformation);
         if (!NT_SUCCESS(Status))
         {
           ExFreePool(ValueInformation);
-          return Status;
-        }
-
-        if (ValueInformation->DataLength > BufferLength)
-        {
-          ExFreePool(ValueInformation);
-          return STATUS_BUFFER_TOO_SMALL;
+          if (Status == STATUS_BUFFER_OVERFLOW)
+            return STATUS_BUFFER_TOO_SMALL;
+          else
+            return Status;
         }
 
         /* FIXME: Verify the value (NULL-terminated, correct format). */
         }
 
         /* FIXME: Verify the value (NULL-terminated, correct format). */