From 88cc8a00f4a7fc34003b961c572d5a78462dd682 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Tue, 4 Jul 2017 11:19:53 +0200 Subject: Windows: correctly handle SEH exceptions during self-tests in order to disable CPU extended features in such case. --- src/Driver/Ntdriver.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Driver/Ntdriver.c') diff --git a/src/Driver/Ntdriver.c b/src/Driver/Ntdriver.c index 8f6f151f..7ada065b 100644 --- a/src/Driver/Ntdriver.c +++ b/src/Driver/Ntdriver.c @@ -153,7 +153,16 @@ NTSTATUS DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) if (startKeyValue->Type == REG_DWORD && *((uint32 *) startKeyValue->Data) == SERVICE_BOOT_START) { if (!SelfTestsPassed) - TC_BUG_CHECK (STATUS_INVALID_PARAMETER); + { + // in case of system encryption, if self-tests fail, disable all extended CPU + // features and try again in order to workaround faulty configurations + DisableCPUExtendedFeatures (); + SelfTestsPassed = AutoTestAlgorithms(); + + // BUG CHECK if the self-tests still fail + if (!SelfTestsPassed) + TC_BUG_CHECK (STATUS_INVALID_PARAMETER); + } LoadBootArguments(); VolumeClassFilterRegistered = IsVolumeClassFilterRegistered(); -- cgit v1.2.3