mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[FS_REC] Fix load-lock acquisition.
This commit is contained in:
parent
618076dc47
commit
38ce67162f
1 changed files with 5 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue