)\r
{\r
USB_KB_DEV *UsbKeyboardDevice;\r
- EFI_STATUS Status;\r
KEYBOARD_CONSOLE_IN_EX_NOTIFY *NewNotify;\r
LIST_ENTRY *Link;\r
LIST_ENTRY *NotifyList;\r
\r
NewNotify->Signature = USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE; \r
NewNotify->KeyNotificationFn = KeyNotificationFunction;\r
+ NewNotify->NotifyHandle = (EFI_HANDLE) NewNotify;\r
CopyMem (&NewNotify->KeyData, KeyData, sizeof (EFI_KEY_DATA));\r
InsertTailList (&UsbKeyboardDevice->NotifyList, &NewNotify->NotifyEntry);\r
\r
- //\r
- // Use gSimpleTextInExNotifyGuid to get a valid EFI_HANDLE\r
- // \r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &NewNotify->NotifyHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
- \r
+\r
*NotifyHandle = NewNotify->NotifyHandle; \r
\r
return EFI_SUCCESS;\r
)\r
{\r
USB_KB_DEV *UsbKeyboardDevice;\r
- EFI_STATUS Status;\r
KEYBOARD_CONSOLE_IN_EX_NOTIFY *CurrentNotify;\r
LIST_ENTRY *Link;\r
LIST_ENTRY *NotifyList;\r
\r
UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);\r
\r
- //\r
- // Check if NotificationHandle is returned from RegisterKeyNotify().\r
- //\r
- Status = gBS->OpenProtocol (\r
- NotificationHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL,\r
- NULL,\r
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL\r
- );\r
- if (EFI_ERROR (Status)) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
-\r
//\r
// Traverse notify list of USB keyboard and remove the entry of NotificationHandle.\r
//\r
// Remove the notification function from NotifyList and free resources\r
//\r
RemoveEntryList (&CurrentNotify->NotifyEntry); \r
- Status = gBS->UninstallMultipleProtocolInterfaces (\r
- CurrentNotify->NotifyHandle,\r
- &gSimpleTextInExNotifyGuid,\r
- NULL,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
+\r
FreePool (CurrentNotify); \r
return EFI_SUCCESS;\r
}\r