https://git.reactos.org/?p=reactos.git;a=commitdiff;h=244b4f99b384c921a16e5…
commit 244b4f99b384c921a16e5b39e9a0af608c263ad8
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Nov 5 10:59:49 2017 +0100
[CDFS] Don't allow FS opening when volume is locked
---
drivers/filesystems/cdfs/create.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/filesystems/cdfs/create.c b/drivers/filesystems/cdfs/create.c
index dde7a2404d..704a4cfc91 100644
--- a/drivers/filesystems/cdfs/create.c
+++ b/drivers/filesystems/cdfs/create.c
@@ -222,11 +222,6 @@ CdfsCreateFile(PDEVICE_OBJECT DeviceObject,
return STATUS_ACCESS_DENIED;
}
- if (BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED))
- {
- return STATUS_ACCESS_DENIED;
- }
-
Status = CdfsOpenFile(DeviceExt,
FileObject,
&FileObject->FileName);
@@ -274,6 +269,11 @@ CdfsCreate(
DeviceObject = IrpContext->DeviceObject;
DeviceExt = DeviceObject->DeviceExtension;
+ if (BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED))
+ {
+ return STATUS_ACCESS_DENIED;
+ }
+
if (DeviceObject == CdfsGlobalData->CdFsDeviceObject || DeviceObject ==
CdfsGlobalData->HddFsDeviceObject)
{
/* DeviceObject represents FileSystem instead of logical volume */