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

commit ee697cfeef5dc1c2d6c0b3d07e6c8aaaf92d2fa1
Author:     George Bișoc <[email protected]>
AuthorDate: Thu Dec 30 21:03:42 2021 +0100
Commit:     George Bișoc <[email protected]>
CommitDate: Tue Jan 11 10:11:10 2022 +0100

    [NTOS:PS] Dereference the quota block during process cleanup
    
    Ensure that when we're cleaning up the EPROCESS object, that we are 
dereferencing the quota block the process in question was using. The routine 
will automatically request a quota block cleanup if the process that 
dereferenced the quota block was the last.
---
 ntoskrnl/ps/kill.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/ntoskrnl/ps/kill.c b/ntoskrnl/ps/kill.c
index 27d559ff510..115768687c4 100644
--- a/ntoskrnl/ps/kill.c
+++ b/ntoskrnl/ps/kill.c
@@ -381,8 +381,12 @@ PspDeleteProcess(IN PVOID ObjectBody)
     /* Dereference the Device Map */
     ObDereferenceDeviceMap(Process);
 
-    /* Destroy the Quota Block */
-    PspDestroyQuotaBlock(Process);
+    /*
+     * Dereference the quota block, the function
+     * will invoke a quota block cleanup if the
+     * block itself is no longer used by anybody.
+     */
+    PspDereferenceQuotaBlock(Process, Process->QuotaBlock);
 }
 
 VOID

Reply via email to