https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9c3c0d123bf2306b808262fba1d3a224be9fac96

commit 9c3c0d123bf2306b808262fba1d3a224be9fac96
Author:     Pierre Schweitzer <[email protected]>
AuthorDate: Sun Jun 2 10:48:35 2019 +0200
Commit:     Pierre Schweitzer <[email protected]>
CommitDate: Sun Jun 2 10:48:35 2019 +0200

    [NTOSKRNL] In case IopMountVolume call is a success, return its VPB
    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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ntoskrnl/io/iomgr/volume.c b/ntoskrnl/io/iomgr/volume.c
index 6c2e3191e9a..1d1e31e5c0d 100644
--- a/ntoskrnl/io/iomgr/volume.c
+++ b/ntoskrnl/io/iomgr/volume.c
@@ -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);

Reply via email to