[NTOSKRNL] In case IopMountVolume call is a success, return its VPB
authorPierre Schweitzer <pierre@reactos.org>
Sun, 2 Jun 2019 08:48:35 +0000 (10:48 +0200)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 2 Jun 2019 08:48:35 +0000 (10:48 +0200)
This fixes an extra (erroneous) reference being set on the VPB.

Based on a patch by Vadim Galyant

CORE-16080

ntoskrnl/io/iomgr/volume.c

index 6c2e319..1d1e31e 100644 (file)
@@ -123,6 +123,14 @@ IopCheckVpbMounted(IN POPEN_PACKET OpenPacket,
             *Status = STATUS_WRONG_VOLUME;
             return NULL;
         }
+        /*
+         * In case IopMountVolume returns a valid VPB
+         * Then, the volume is mounted, return it
+         */
+        else if (Vpb != NULL)
+        {
+            return Vpb;
+        }
 
         /* Re-acquire the lock */
         IoAcquireVpbSpinLock(&OldIrql);