mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +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,
|
FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PWCHAR DriverServiceName)
|
IN PWCHAR DriverServiceName)
|
||||||
{
|
{
|
||||||
UNICODE_STRING DriverName;
|
|
||||||
PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
|
||||||
NTSTATUS Status = STATUS_IMAGE_ALREADY_LOADED;
|
NTSTATUS Status = STATUS_IMAGE_ALREADY_LOADED;
|
||||||
|
PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
UNICODE_STRING DriverName;
|
||||||
|
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Make sure we haven't already been called */
|
/* Make sure we haven't already been called */
|
||||||
if (DeviceExtension->State != Loaded)
|
if (DeviceExtension->State != Loaded)
|
||||||
{
|
{
|
||||||
/* Acquire the load lock */
|
/* Acquire the load lock */
|
||||||
|
KeEnterCriticalRegion();
|
||||||
KeWaitForSingleObject(FsRecLoadSync,
|
KeWaitForSingleObject(FsRecLoadSync,
|
||||||
Executive,
|
Executive,
|
||||||
KernelMode,
|
KernelMode,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL);
|
NULL);
|
||||||
KeEnterCriticalRegion();
|
|
||||||
|
|
||||||
/* Make sure we're active */
|
/* Make sure we're active */
|
||||||
if (DeviceExtension->State == Pending)
|
if (DeviceExtension->State == Pending)
|
||||||
|
@ -67,11 +68,10 @@ FsRecLoadFileSystem(IN PDEVICE_OBJECT DeviceObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Release the lock */
|
/* Release the lock */
|
||||||
KeSetEvent(FsRecLoadSync, 0, FALSE);
|
KeSetEvent(FsRecLoadSync, IO_NO_INCREMENT, FALSE);
|
||||||
KeLeaveCriticalRegion();
|
KeLeaveCriticalRegion();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return */
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue