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

commit 38ce67162f705c46ed33d06a959b23def370dfd0
Author:     Hermès Bélusca-Maïto <[email protected]>
AuthorDate: Fri Sep 24 17:51:40 2021 +0200
Commit:     Hermès Bélusca-Maïto <[email protected]>
CommitDate: Sun Sep 26 03:02:56 2021 +0200

    [FS_REC] Fix load-lock acquisition.
---
 drivers/filesystems/fs_rec/fs_rec.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/filesystems/fs_rec/fs_rec.c 
b/drivers/filesystems/fs_rec/fs_rec.c
index 2bd4da6da64..4ccb99f5952 100644
--- a/drivers/filesystems/fs_rec/fs_rec.c
+++ b/drivers/filesystems/fs_rec/fs_rec.c
@@ -23,21 +23,22 @@ NTAPI
 FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject,
                     IN PWCHAR DriverServiceName)
 {
-    UNICODE_STRING DriverName;
-    PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
     NTSTATUS Status = STATUS_IMAGE_ALREADY_LOADED;
+    PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
+    UNICODE_STRING DriverName;
+
     PAGED_CODE();
 
     /* Make sure we haven't already been called */
     if (DeviceExtension->State != Loaded)
     {
         /* Acquire the load lock */
+        KeEnterCriticalRegion();
         KeWaitForSingleObject(FsRecLoadSync,
                               Executive,
                               KernelMode,
                               FALSE,
                               NULL);
-        KeEnterCriticalRegion();
 
         /* Make sure we're active */
         if (DeviceExtension->State == Pending)
@@ -67,11 +68,10 @@ FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject,
         }
 
         /* Release the lock */
-        KeSetEvent(FsRecLoadSync, 0, FALSE);
+        KeSetEvent(FsRecLoadSync, IO_NO_INCREMENT, FALSE);
         KeLeaveCriticalRegion();
     }
 
-    /* Return */
     return Status;
 }
 

Reply via email to