diff --git a/nt/shvos.c b/nt/shvos.c index 532fcf0..4017525 100644 --- a/nt/shvos.c +++ b/nt/shvos.c @@ -418,6 +418,17 @@ DriverEntry ( // // Load the hypervisor // - return ShvOsErrorToError(ShvLoad()); + status = ShvOsErrorToError(ShvLoad()); + + // + // If load of the hypervisor happened to fail, unregister previously registered + // power callback, otherwise we would get BSOD on shutdown. + // + if (!NT_SUCCESS(status)) + { + ExUnregisterCallback(g_PowerCallbackRegistration); + } + + return status; } diff --git a/shvvmx.c b/shvvmx.c index 06d5303..d7e9958 100644 --- a/shvvmx.c +++ b/shvvmx.c @@ -361,12 +361,10 @@ ShvVmxSetupVmcsForVp ( CPU_BASED_ACTIVATE_SECONDARY_CONTROLS)); // - // If any interrupts were pending upon entering the hypervisor, acknowledge - // them when we're done. And make sure to enter us in x64 mode at all times + // Make sure to enter us in x64 mode at all times. // __vmx_vmwrite(VM_EXIT_CONTROLS, ShvUtilAdjustMsr(VpData->MsrData[15], - VM_EXIT_ACK_INTR_ON_EXIT | VM_EXIT_IA32E_MODE)); //