Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ionescu007/SimpleVisor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nt/shvos.c13
1 files changed, 12 insertions, 1 deletions
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;
}