diff --git a/Changelog.md b/Changelog.md index 57ea4af2..3b7724d7 100644 --- a/Changelog.md +++ b/Changelog.md @@ -5,11 +5,12 @@ OpenCore Changelog - Added background image support in OpenCanopy - Fixed selector boot option choice in OpenCanopy - Relaxed selector dimensions for OpenCanopy -- Add `MaxBIOSVersion` option to `Generic` -- Fix MLB verification feature in macrecovery +- Added `MaxBIOSVersion` option to `Generic` +- Fixed MLB verification feature in macrecovery - Replaced `VBoxHfs` driver with `OpenHfsPlus` - Added audio codec dumping to `SysReport` -- Fix compatibility with page protection for all binaries +- Fixed compatibility with page protection for all binaries +- Fixed crashes in OpenUsbKbDxe when handling unsupported devices #### v0.6.5 - Fixed installing OpenDuet on protected volumes diff --git a/Platform/OpenUsbKbDxe/AppleKey.c b/Platform/OpenUsbKbDxe/AppleKey.c index 1e291c00..9fabb65f 100644 --- a/Platform/OpenUsbKbDxe/AppleKey.c +++ b/Platform/OpenUsbKbDxe/AppleKey.c @@ -24,8 +24,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ASSERT ((UsbKbDev)->Signature == USB_KB_DEV_SIGNATURE); \ } while (FALSE) -STATIC VOID *mAppleKeyMapDbRegistration = NULL; - STATIC VOID UsbKbSetAppleKeyMapDb ( @@ -71,18 +69,19 @@ UsbKbAppleKeyMapDbInstallNotify ( ASSERT_USB_KB_DEV_VALID ((USB_KB_DEV *)Context); ASSERT (((USB_KB_DEV *)Context)->KeyMapInstallNotifyEvent == Event); + UsbKeyboardDevice = (USB_KB_DEV *)Context; Status = gBS->LocateProtocol ( &gAppleKeyMapDatabaseProtocolGuid, - mAppleKeyMapDbRegistration, + UsbKeyboardDevice->KeyMapInstallRegistration, (VOID **)&KeyMapDb ); ASSERT (Status != EFI_NOT_FOUND); - UsbKeyboardDevice = (USB_KB_DEV *)Context; UsbKbSetAppleKeyMapDb (UsbKeyboardDevice, KeyMapDb); gBS->CloseEvent (UsbKeyboardDevice->KeyMapInstallNotifyEvent); UsbKeyboardDevice->KeyMapInstallNotifyEvent = NULL; + UsbKeyboardDevice->KeyMapInstallRegistration = NULL; } VOID @@ -115,7 +114,7 @@ UsbKbLocateAppleKeyMapDb ( Status = gBS->RegisterProtocolNotify ( &gAppleKeyMapDatabaseProtocolGuid, UsbKeyboardDevice->KeyMapInstallNotifyEvent, - &mAppleKeyMapDbRegistration + &UsbKeyboardDevice->KeyMapInstallRegistration ); ASSERT_EFI_ERROR (Status); } diff --git a/Platform/OpenUsbKbDxe/EfiKey.c b/Platform/OpenUsbKbDxe/EfiKey.c index c3330ed2..bba388cf 100644 --- a/Platform/OpenUsbKbDxe/EfiKey.c +++ b/Platform/OpenUsbKbDxe/EfiKey.c @@ -482,6 +482,7 @@ ErrorExit: gBS->CloseEvent (UsbKeyboardDevice->KeyNotifyProcessEvent); } ReleaseKeyboardLayoutResources (UsbKeyboardDevice); + UsbKbFreeAppleKeyMapDb (UsbKeyboardDevice); FreePool (UsbKeyboardDevice); UsbKeyboardDevice = NULL; } diff --git a/Platform/OpenUsbKbDxe/EfiKey.h b/Platform/OpenUsbKbDxe/EfiKey.h index d1a6488f..02779bc7 100644 --- a/Platform/OpenUsbKbDxe/EfiKey.h +++ b/Platform/OpenUsbKbDxe/EfiKey.h @@ -156,6 +156,7 @@ typedef struct { UINTN KeyMapDbIndex; EFI_EVENT KeyMapInstallNotifyEvent; + VOID *KeyMapInstallRegistration; EFI_EVENT ExitBootServicesEvent; } USB_KB_DEV;