From 168bf9514ff7c3cf1a301d4139fd50768c379a4b Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 8 Jul 2020 10:27:17 -0600 Subject: [PATCH] MdeModulePkg/BMM: Unregister F9 and F10 hotkeys --- .../BootMaintenance.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c index f33045d423..5fc5524865 100644 --- a/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c +++ b/MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenance.c @@ -1646,6 +1646,28 @@ BmmInitialBootModeInfo ( mBmmModeInitialized = TRUE; } +STATIC +EFI_STATUS +UnregisterHotKeys(VOID) +{ + EFI_STATUS Status; + EFI_INPUT_KEY HotKey; + EDKII_FORM_BROWSER_EXTENSION2_PROTOCOL *FormBrowserEx2; + + Status = gBS->LocateProtocol (&gEdkiiFormBrowserEx2ProtocolGuid, NULL, (VOID **) &FormBrowserEx2); + if (!EFI_ERROR (Status)) { + HotKey.UnicodeChar = CHAR_NULL; + + HotKey.ScanCode = SCAN_F9; + FormBrowserEx2->RegisterHotKey(&HotKey, BROWSER_ACTION_UNREGISTER, 0, NULL); + + HotKey.ScanCode = SCAN_F10; + FormBrowserEx2->RegisterHotKey(&HotKey, BROWSER_ACTION_UNREGISTER, 0, NULL); + } + + return Status; +} + /** Install Boot Maintenance Manager Menu driver. @@ -1734,6 +1756,11 @@ BootMaintenanceManagerUiLibConstructor ( BmmInitialBootModeInfo(); + // + // Remove the F9 and F10 hotkeys + // + UnregisterHotKeys(); + return EFI_SUCCESS; }