UsbKeyboardDevice->SimpleInputEx.ReadKeyStrokeEx = USBKeyboardReadKeyStrokeEx;\r
UsbKeyboardDevice->SimpleInputEx.SetState = USBKeyboardSetState;\r
UsbKeyboardDevice->SimpleInputEx.RegisterKeyNotify = USBKeyboardRegisterKeyNotify;\r
- UsbKeyboardDevice->SimpleInputEx.UnregisterKeyNotify = USBKeyboardUnregisterKeyNotify; \r
+ UsbKeyboardDevice->SimpleInputEx.UnregisterKeyNotify = USBKeyboardUnregisterKeyNotify;\r
\r
InitializeListHead (&UsbKeyboardDevice->NotifyList);\r
\r
UsbKeyboardDevice,\r
&(UsbKeyboardDevice->SimpleInput.WaitForKey)\r
);\r
-\r
- if (EFI_ERROR (Status)) {\r
- goto ErrorExit;\r
- }\r
-\r
- Status = InitKeyboardLayout (UsbKeyboardDevice);\r
if (EFI_ERROR (Status)) {\r
goto ErrorExit;\r
}\r
goto ErrorExit;\r
}\r
\r
+ UsbKeyboardDevice->ControllerHandle = Controller;\r
+ Status = InitKeyboardLayout (UsbKeyboardDevice);\r
+ if (EFI_ERROR (Status)) {\r
+ gBS->UninstallMultipleProtocolInterfaces (\r
+ Controller,\r
+ &gEfiSimpleTextInProtocolGuid,\r
+ &UsbKeyboardDevice->SimpleInput,\r
+ &gEfiSimpleTextInputExProtocolGuid,\r
+ &UsbKeyboardDevice->SimpleInputEx,\r
+ NULL\r
+ );\r
+ goto ErrorExit;\r
+ }\r
+\r
+\r
//\r
// Reset USB Keyboard Device exhaustively.\r
//\r
\r
@retval EFI_SUCCESS The notification function was unregistered successfully.\r
@retval EFI_INVALID_PARAMETER The NotificationHandle is invalid\r
- @retval EFI_NOT_FOUND Cannot find the matching entry in database.\r
\r
**/\r
EFI_STATUS\r
if (NotificationHandle == NULL) {\r
return EFI_INVALID_PARAMETER;\r
} \r
+\r
+ if (((KEYBOARD_CONSOLE_IN_EX_NOTIFY *) NotificationHandle)->Signature != USB_KB_CONSOLE_IN_EX_NOTIFY_SIGNATURE) {\r
+ return EFI_INVALID_PARAMETER;\r
+ } \r
\r
UsbKeyboardDevice = TEXT_INPUT_EX_USB_KB_DEV_FROM_THIS (This);\r
\r
}\r
}\r
\r
- return EFI_NOT_FOUND; \r
+ //\r
+ // Cannot find the matching entry in database.\r
+ //\r
+ return EFI_INVALID_PARAMETER; \r
}\r
\r