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 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2013, 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
BDS_HOTKEY_OPTION *HotkeyLeft;\r
BDS_HOTKEY_OPTION *HotkeyRight;\r
UINTN Index;\r
+ EFI_BOOT_KEY_DATA KeyOptions;\r
UINT32 KeyShiftStateLeft;\r
UINT32 KeyShiftStateRight;\r
EFI_INPUT_KEY *InputKey;\r
\r
HotkeyLeft->Signature = BDS_HOTKEY_OPTION_SIGNATURE;\r
HotkeyLeft->BootOptionNumber = KeyOption->BootOption;\r
- HotkeyLeft->CodeCount = (UINT8) KEY_OPTION_INPUT_KEY_COUNT (KeyOption);\r
+\r
+ KeyOptions = KeyOption->KeyData;\r
+\r
+ HotkeyLeft->CodeCount = (UINT8) KeyOptions.Options.InputKeyCount;\r
\r
//\r
// Map key shift state from KeyOptions to EFI_KEY_DATA.KeyState\r
//\r
KeyShiftStateRight = EFI_SHIFT_STATE_VALID;\r
- if (KEY_OPTION_SHIFT_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.ShiftPressed) {\r
KeyShiftStateRight |= EFI_RIGHT_SHIFT_PRESSED;\r
}\r
- if (KEY_OPTION_CONTROL_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.ControlPressed) {\r
KeyShiftStateRight |= EFI_RIGHT_CONTROL_PRESSED;\r
}\r
- if (KEY_OPTION_ALT_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.AltPressed) {\r
KeyShiftStateRight |= EFI_RIGHT_ALT_PRESSED;\r
}\r
- if (KEY_OPTION_LOGO_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.LogoPressed) {\r
KeyShiftStateRight |= EFI_RIGHT_LOGO_PRESSED;\r
}\r
- if (KEY_OPTION_MENU_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.MenuPressed) {\r
KeyShiftStateRight |= EFI_MENU_KEY_PRESSED;\r
}\r
- if (KEY_OPTION_SYS_REQ_PRESSED (KeyOption)) {\r
+ if (KeyOptions.Options.SysReqPressed) {\r
KeyShiftStateRight |= EFI_SYS_REQ_PRESSED;\r
}\r
\r
UINTN Index;\r
\r
if (!CompareGuid (Guid, &gEfiGlobalVariableGuid) ||\r
- (StrSize (Name) != sizeof (L"Key####")) &&\r
+ (StrSize (Name) != sizeof (L"Key####")) ||\r
(StrnCmp (Name, L"Key", 3) != 0)\r
) {\r
return FALSE;\r
\r
NameSize = sizeof (CHAR16);\r
Name = AllocateZeroPool (NameSize);\r
+ ASSERT (Name != NULL);\r
while (TRUE) {\r
NewNameSize = NameSize;\r
Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);\r
if (Status == EFI_BUFFER_TOO_SMALL) {\r
Name = ReallocatePool (NameSize, NewNameSize, Name);\r
+ ASSERT (Name != NULL);\r
Status = gRT->GetNextVariableName (&NewNameSize, Name, &Guid);\r
NameSize = NewNameSize;\r
}\r
(*Count + 1) * sizeof (UINT16),\r
OptionNumbers\r
);\r
+ ASSERT (OptionNumbers != NULL);\r
for (Index = 0; Index < *Count; Index++) {\r
if (OptionNumber < OptionNumbers[Index]) {\r
break;\r
KeyOptionNumbers = HotkeyGetOptionNumbers (&KeyOptionCount);\r
for (Index = 0; Index < KeyOptionCount; Index ++) {\r
UnicodeSPrint (KeyOptionName, sizeof (KeyOptionName), L"Key%04x", KeyOptionNumbers[Index]);\r
- GetEfiGlobalVariable2 (KeyOptionName, &KeyOption, NULL);\r
+ GetEfiGlobalVariable2 (KeyOptionName, (VOID **) &KeyOption, NULL);\r
ASSERT (KeyOption != NULL);\r
if (IsKeyOptionValid (KeyOption)) {\r
HotkeyInsertList (KeyOption);\r