[CDFS] Don't allow FS opening when volume is locked

This commit is contained in:
Pierre Schweitzer 2017-11-05 10:59:49 +01:00
parent 484f33f0d3
commit 244b4f99b3
No known key found for this signature in database
GPG key ID: 7545556C3D585B0B

View file

@ -222,11 +222,6 @@ CdfsCreateFile(PDEVICE_OBJECT DeviceObject,
return STATUS_ACCESS_DENIED; return STATUS_ACCESS_DENIED;
} }
if (BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED))
{
return STATUS_ACCESS_DENIED;
}
Status = CdfsOpenFile(DeviceExt, Status = CdfsOpenFile(DeviceExt,
FileObject, FileObject,
&FileObject->FileName); &FileObject->FileName);
@ -274,6 +269,11 @@ CdfsCreate(
DeviceObject = IrpContext->DeviceObject; DeviceObject = IrpContext->DeviceObject;
DeviceExt = DeviceObject->DeviceExtension; DeviceExt = DeviceObject->DeviceExtension;
if (BooleanFlagOn(DeviceExt->Flags, VCB_VOLUME_LOCKED))
{
return STATUS_ACCESS_DENIED;
}
if (DeviceObject == CdfsGlobalData->CdFsDeviceObject || DeviceObject == CdfsGlobalData->HddFsDeviceObject) if (DeviceObject == CdfsGlobalData->CdFsDeviceObject || DeviceObject == CdfsGlobalData->HddFsDeviceObject)
{ {
/* DeviceObject represents FileSystem instead of logical volume */ /* DeviceObject represents FileSystem instead of logical volume */