]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.c
Clean up package/platform DSC files by the following steps:
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Hotkey.c
index 8843ec0b70d30efb798b612a08fb33531174f947..b6cf4539af75e38f5805ab30ecac2fce70bed2e8 100644 (file)
@@ -2,8 +2,8 @@
   Provides a way for 3rd party applications to register themselves for launch by the\r
   Boot Manager based on hot key\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -311,6 +311,7 @@ UnregisterHotkey (
   @return  EFI_NOT_FOUND Fail to find boot option variable.\r
 **/\r
 EFI_STATUS\r
+EFIAPI\r
 HotkeyCallback (\r
   IN EFI_KEY_DATA     *KeyData\r
 )\r
@@ -348,7 +349,7 @@ HotkeyCallback (
     HotkeyData = &Hotkey->KeyData[Hotkey->WaitingKey];\r
     if ((KeyData->Key.ScanCode == HotkeyData->Key.ScanCode) &&\r
        (KeyData->Key.UnicodeChar == HotkeyData->Key.UnicodeChar) &&\r
-       ((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
+       (((HotkeyData->KeyState.KeyShiftState & EFI_SHIFT_STATE_VALID) != 0) ? (KeyData->KeyState.KeyShiftState == HotkeyData->KeyState.KeyShiftState) : TRUE)) {\r
       //\r
       // Receive an expecting key stroke\r
       //\r
@@ -468,7 +469,7 @@ HotkeyRegisterNotify (
         return Status;\r
       }\r
       Index ++;\r
-    } while (Index < Hotkey->CodeCount);\r
+    } while ((Index < Hotkey->CodeCount) && (Index < (sizeof (Hotkey->KeyData) / sizeof (EFI_KEY_DATA))));\r
 \r
     Link = GetNextNode (&mHotkeyList, Link);\r
   }\r