X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FConsole%2FTerminalDxe%2FTerminalConIn.c;h=ae4ea818deb95e63610fe26e5d57ac707c65ee82;hb=7fc80d44841dbc1f1b68d75312ab7ec9e6d63613;hp=4aa8c73f061b68673bac71084e1bf4c527148284;hpb=df80a83c8a5a45a979c6dfa4a54f7aafbde5a671;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c index 4aa8c73f06..ae4ea818de 100644 --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConIn.c @@ -365,7 +365,6 @@ TerminalConInRegisterKeyNotify ( OUT EFI_HANDLE *NotifyHandle ) { - EFI_STATUS Status; TERMINAL_DEV *TerminalDevice; TERMINAL_CONSOLE_IN_EX_NOTIFY *NewNotify; LIST_ENTRY *Link; @@ -407,18 +406,10 @@ TerminalConInRegisterKeyNotify ( NewNotify->Signature = TERMINAL_CONSOLE_IN_EX_NOTIFY_SIGNATURE; NewNotify->KeyNotificationFn = KeyNotificationFunction; + NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify; CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData)); InsertTailList (&TerminalDevice->NotifyList, &NewNotify->NotifyEntry); - // - // Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE - // - Status = gBS->InstallMultipleProtocolInterfaces ( - &NewNotify->NotifyHandle, - &gSimpleTextInExNotifyGuid, - NULL, - NULL - ); - ASSERT_EFI_ERROR (Status); + *NotifyHandle = NewNotify->NotifyHandle; return EFI_SUCCESS; @@ -445,7 +436,6 @@ TerminalConInUnregisterKeyNotify ( IN EFI_HANDLE NotificationHandle ) { - EFI_STATUS Status; TERMINAL_DEV *TerminalDevice; LIST_ENTRY *Link; TERMINAL_CONSOLE_IN_EX_NOTIFY *CurrentNotify; @@ -455,18 +445,6 @@ TerminalConInUnregisterKeyNotify ( return EFI_INVALID_PARAMETER; } - Status = gBS->OpenProtocol ( - NotificationHandle, - &gSimpleTextInExNotifyGuid, - NULL, - NULL, - NULL, - EFI_OPEN_PROTOCOL_TEST_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return EFI_INVALID_PARAMETER; - } - TerminalDevice = TERMINAL_CON_IN_EX_DEV_FROM_THIS (This); NotifyList = &TerminalDevice->NotifyList; @@ -482,13 +460,7 @@ TerminalConInUnregisterKeyNotify ( // Remove the notification function from NotifyList and free resources // RemoveEntryList (&CurrentNotify->NotifyEntry); - Status = gBS->UninstallMultipleProtocolInterfaces ( - CurrentNotify->NotifyHandle, - &gSimpleTextInExNotifyGuid, - NULL, - NULL - ); - ASSERT_EFI_ERROR (Status); + gBS->FreePool (CurrentNotify); return EFI_SUCCESS; }