From 244b4f99b384c921a16e5b39e9a0af608c263ad8 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 5 Nov 2017 10:59:49 +0100 Subject: [PATCH] [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 dde7a2404d2..704a4cfc917 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 */