/* Remove a registered notification function from a particular keystroke. */
EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
/* Remove a registered notification function from a particular keystroke. */
EFI_STATUS EFIAPI USBKeyboardUnregisterKeyNotify(IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, IN VOID *NotificationHandle)
{
  USB_KB_DEV                     *UsbKeyboardDevice;
  KEYBOARD_CONSOLE_IN_EX_NOTIFY  *CurrentNotify;
  LIST_ENTRY                     *Link;
  LIST_ENTRY                     *NotifyList;
  if (NotificationHandle == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);
  NotifyList = &UsbKeyboardDevice->NotifyList;
  for (Link = GetFirstNode (NotifyList);
       !IsNull (NotifyList, Link);
       Link = GetNextNode (NotifyList, Link))
  {
    CurrentNotify = CR (
                      Link,
                      KEYBOARD_CONSOLE_IN_EX_NOTIFY,
                      NotifyEntry,
                      USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE
                      );
    if (CurrentNotify == NotificationHandle) {
      RemoveEntryList (&CurrentNotify->NotifyEntry);
      FreePool (CurrentNotify);
      return EFI_SUCCESS;
    }
  }
  return EFI_INVALID_PARAMETER;
}