[NTOSKNRL] Always reference a newly created VACB
authorPierre Schweitzer <pierre@reactos.org>
Sun, 18 Mar 2018 17:14:17 +0000 (18:14 +0100)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 18 Mar 2018 17:16:55 +0000 (18:16 +0100)
This allows being consistent between newly created and looked up
so that VACB can always safely be released.

Should really help with reference issues.

CORE-14481
CORE-14480
CORE-14482

ntoskrnl/cc/view.c

index 6a29550..e896c57 100644 (file)
@@ -808,6 +808,9 @@ CcRosCreateVacb (
         ExFreeToNPagedLookasideList(&VacbLookasideList, current);
     }
 
+    /* Reference it to allow release */
+    CcRosVacbIncRefCount(current);
+
     return Status;
 }
 
@@ -842,8 +845,6 @@ CcRosGetVacb (
         {
             return Status;
         }
-
-        CcRosVacbIncRefCount(current);
     }
 
     KeAcquireGuardedMutex(&ViewLock);