aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattiwatti <mattiwatti@gmail.com>2019-05-06 20:24:05 +0200
committerMattiwatti <mattiwatti@gmail.com>2019-05-06 20:24:05 +0200
commitd7d203c6401ddbabb3582498e31de1857d0bb379 (patch)
tree74b4b65231b460a70745d403abfae9dea634b4d3
parent3f11dbb68bd292cae04a6ef371f3403297a74a0c (diff)
Call driver unload if a non-Windows OS is being booted
-rw-r--r--EfiGuardDxe/EfiGuardDxe.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/EfiGuardDxe/EfiGuardDxe.c b/EfiGuardDxe/EfiGuardDxe.c
index df2528f..6d9dd2c 100644
--- a/EfiGuardDxe/EfiGuardDxe.c
+++ b/EfiGuardDxe/EfiGuardDxe.c
@@ -16,6 +16,15 @@ EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gEfiGuardSupportedEfiVersion =
};
//
+// Driver unload
+//
+EFI_STATUS
+EFIAPI
+EfiGuardUnload(
+ IN EFI_HANDLE ImageHandle
+ );
+
+//
// EfiGuard driver protocol
//
EFI_STATUS
@@ -205,6 +214,11 @@ HookedLoadImage(
LoadedImage->ImageBase,
LoadedImage->ImageSize);
}
+ else
+ {
+ // A non-Windows OS is being booted. Unload ourselves
+ EfiGuardUnload(gImageHandle);
+ }
}
}