]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtGopDxe/WinNtGopInput.c
Retired gSimpleTextInExNotifyGuid, used local structure address to be notify handle.
[mirror_edk2.git] / Nt32Pkg / WinNtGopDxe / WinNtGopInput.c
index 0ea802355d29de52f378951815b2167f72eda1ea..be41a8e854e080e0fe235bdfed2aef73726bc6f4 100644 (file)
@@ -158,7 +158,6 @@ GopPrivateCheckQ (
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
 BOOLEAN\r
 GopPrivateIsKeyRegistered (\r
   IN EFI_KEY_DATA  *RegsiteredData,\r
@@ -205,7 +204,6 @@ Returns:
 }\r
 \r
 \r
-STATIC\r
 VOID\r
 GopPrivateInvokeRegisteredFunction (\r
   IN GOP_PRIVATE_DATA                     *Private,\r
@@ -245,7 +243,6 @@ Returns:
   }    \r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 GopPrivateUpdateStatusLight (\r
   IN GOP_PRIVATE_DATA                     *Private\r
@@ -277,7 +274,6 @@ Returns:
 }\r
 \r
 \r
-STATIC\r
 EFI_STATUS\r
 GopPrivateResetWorker (\r
   IN GOP_PRIVATE_DATA                     *Private\r
@@ -326,7 +322,7 @@ Returns:
   Private->CapsLock                = FALSE;\r
   Private->NumLock                 = FALSE;\r
   Private->ScrollLock              = FALSE;\r
-  \r
\r
   Private->KeyState.KeyShiftState  = EFI_SHIFT_STATE_VALID;\r
   Private->KeyState.KeyToggleState = EFI_TOGGLE_STATE_VALID;\r
 \r
@@ -338,7 +334,6 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 GopPrivateReadKeyStrokeWorker (\r
   IN GOP_PRIVATE_DATA                   *Private,\r
@@ -491,7 +486,6 @@ WinNtGopSimpleTextInReset (
   @return TODO: add return values\r
 \r
 **/\r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 WinNtGopSimpleTextInReadKeyStroke (\r
@@ -525,7 +519,6 @@ WinNtGopSimpleTextInReadKeyStroke (
   @return TODO: add return values\r
 \r
 **/\r
-STATIC\r
 VOID\r
 EFIAPI\r
 WinNtGopSimpleTextInWaitForKey (\r
@@ -570,7 +563,6 @@ WinNtGopSimpleTextInWaitForKey (
 // Simple Text Input Ex protocol functions\r
 //\r
 \r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 WinNtGopSimpleTextInExResetEx (\r
@@ -598,7 +590,6 @@ WinNtGopSimpleTextInExResetEx (
   return GopPrivateResetWorker (Private);\r
 }\r
 \r
-STATIC\r
 EFI_STATUS\r
 EFIAPI\r
 WinNtGopSimpleTextInExReadKeyStrokeEx (\r
@@ -728,15 +719,14 @@ WinNtGopSimpleTextInExRegisterKeyNotify (
                               \r
 --*/   \r
 {\r
-  EFI_STATUS                         Status;\r
   GOP_PRIVATE_DATA                   *Private;\r
   WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *CurrentNotify;\r
   LIST_ENTRY                         *Link;\r
   WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *NewNotify;      \r
 \r
-  if (KeyData == NULL || NotifyHandle == NULL) {\r
+  if (KeyData == NULL || KeyNotificationFunction == NULL || NotifyHandle == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
-  }  \r
+  }\r
 \r
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
 \r
@@ -768,20 +758,10 @@ WinNtGopSimpleTextInExRegisterKeyNotify (
 \r
   NewNotify->Signature         = WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY_SIGNATURE;     \r
   NewNotify->KeyNotificationFn = KeyNotificationFunction;\r
+  NewNotify->NotifyHandle      = (EFI_HANDLE) NewNotify;\r
   CopyMem (&NewNotify->KeyData, KeyData, sizeof (KeyData));\r
   InsertTailList (&Private->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
   *NotifyHandle = NewNotify->NotifyHandle;  \r
   \r
   return EFI_SUCCESS;\r
@@ -810,7 +790,6 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
                               \r
 --*/   \r
 {\r
-  EFI_STATUS                         Status;\r
   GOP_PRIVATE_DATA                   *Private;\r
   LIST_ENTRY                         *Link;\r
   WIN_NT_GOP_SIMPLE_TEXTIN_EX_NOTIFY *CurrentNotify;\r
@@ -819,18 +798,6 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
     return EFI_INVALID_PARAMETER;\r
   } \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
   Private = GOP_PRIVATE_DATA_FROM_TEXT_IN_EX_THIS (This);\r
 \r
   for (Link = Private->NotifyList.ForwardLink; Link != &Private->NotifyList; Link = Link->ForwardLink) {\r
@@ -845,13 +812,7 @@ WinNtGopSimpleTextInExUnregisterKeyNotify (
       // 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
       gBS->FreePool (CurrentNotify);            \r
       return EFI_SUCCESS;\r
     }\r