From f84d235cf17a92bb51031833da502660d364013f Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 13 Aug 2023 22:50:37 +0200 Subject: Windows: Implement support for mounting partially encrypted system partitions For now, we force ReadOnly mounting for such partitions. --- src/Driver/Ntvol.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Driver/Ntvol.c') diff --git a/src/Driver/Ntvol.c b/src/Driver/Ntvol.c index 177c0bf3..6f2ff399 100644 --- a/src/Driver/Ntvol.c +++ b/src/Driver/Ntvol.c @@ -88,6 +88,7 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject, } mount->VolumeMountedReadOnlyAfterDeviceWriteProtected = FALSE; + mount->VolumeMountedReadOnlyAfterPartialSysEnc = FALSE; // If we are opening a device, query its size first if (bRawDevice) @@ -677,10 +678,9 @@ NTSTATUS TCOpenVolume (PDEVICE_OBJECT DeviceObject, if (Extension->cryptoInfo->EncryptedAreaLength.Value != Extension->cryptoInfo->VolumeSize.Value) { - // Partial encryption is not supported for volumes mounted as regular - mount->nReturnCode = ERR_ENCRYPTION_NOT_COMPLETED; - ntStatus = STATUS_SUCCESS; - goto error; + // mount as readonly in case of partial system encryption + Extension->bReadOnly = mount->bMountReadOnly = TRUE; + mount->VolumeMountedReadOnlyAfterPartialSysEnc = TRUE; } } else if (Extension->cryptoInfo->HeaderFlags & TC_HEADER_FLAG_NONSYS_INPLACE_ENC) -- cgit v1.2.3