X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FLibrary%2FGenericBdsLib%2FBdsMisc.c;h=487807b3018f2a394bbdf0c13c91e32d236428cc;hp=acf61ebcb6627a371ee3d466a7bd06fb0ad83743;hb=2b649f74775d0efd1e75c91f77c3045ae6249cb4;hpb=5c08e1173703234cc2913757f237ee916087498a diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c index acf61ebcb6..487807b301 100644 --- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c +++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c @@ -1,8 +1,8 @@ /** @file Misc BDS library function -Copyright (c) 2004 - 2008, Intel Corporation.
-All rights reserved. This program and the accompanying materials +Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -22,42 +22,6 @@ BOOLEAN mResetRequired = FALSE; extern UINT16 gPlatformBootTimeOutDefault; - -/** - Return the default value for system Timeout variable. - - @return Timeout value. - -**/ -UINT16 -EFIAPI -BdsLibGetTimeout ( - VOID - ) -{ - UINT16 Timeout; - UINTN Size; - EFI_STATUS Status; - - // - // Return Timeout variable or 0xffff if no valid - // Timeout variable exists. - // - Size = sizeof (UINT16); - Status = gRT->GetVariable (L"Timeout", &gEfiGlobalVariableGuid, NULL, &Size, &Timeout); - if (EFI_ERROR (Status)) { - // - // According to UEFI 2.0 spec, it should treat the Timeout value as 0xffff - // (default value PcdPlatformBootTimeOutDefault) when L"Timeout" variable is not present. - // To make the current EFI Automatic-Test activity possible, platform can choose other value - // for automatic boot when the variable is not present. - // - Timeout = PcdGet16 (PcdPlatformBootTimeOutDefault); - } - - return Timeout; -} - /** The function will go through the driver option link list, load and start every driver the driver option device path point to. @@ -608,9 +572,9 @@ BdsLibBuildOptionFromVar ( } Option = BdsLibVariableToOption (BdsCommonOptionList, OptionName); - ASSERT (Option != NULL); - Option->BootCurrent = OptionOrder[Index]; - + if (Option != NULL) { + Option->BootCurrent = OptionOrder[Index]; + } } FreePool (OptionOrder); @@ -831,7 +795,7 @@ BdsLibOutputStrings ( // If String is NULL, then it's the end of the list // String = VA_ARG (Args, CHAR16 *); - if (String != NULL) { + if (String == NULL) { break; } @@ -847,7 +811,7 @@ BdsLibOutputStrings ( } // -// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature. +// Following are BDS Lib functions which contain all the code about setup browser reset reminder feature. // Setup Browser reset reminder feature is that an reset reminder will be given before user leaves the setup browser if // user change any option setting which needs a reset to be effective, and the reset will be applied according to the user selection. // @@ -974,7 +938,7 @@ SetupResetReminder ( // Popup a menu to notice user // do { - IfrLibCreatePopUp (2, &Key, StringBuffer1, StringBuffer2); + CreatePopUp (EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE, &Key, StringBuffer1, StringBuffer2, NULL); } while ((Key.ScanCode != SCAN_ESC) && (Key.UnicodeChar != CHAR_CARRIAGE_RETURN)); FreePool (StringBuffer1); @@ -1042,11 +1006,12 @@ BdsLibGetImageHeader ( Root = NULL; goto Done; } - + ASSERT (Root != NULL); Status = Root->Open (Root, &ThisFile, FileName, EFI_FILE_MODE_READ, 0); if (EFI_ERROR (Status)) { goto Done; } + ASSERT (ThisFile != NULL); // // Get file size @@ -1270,3 +1235,34 @@ BdsLibSaveMemoryTypeInformation ( } +/** + Identify a user and, if authenticated, returns the current user profile handle. + + @param[out] User Point to user profile handle. + + @retval EFI_SUCCESS User is successfully identified, or user identification + is not supported. + @retval EFI_ACCESS_DENIED User is not successfully identified + +**/ +EFI_STATUS +EFIAPI +BdsLibUserIdentify ( + OUT EFI_USER_PROFILE_HANDLE *User + ) +{ + EFI_STATUS Status; + EFI_USER_MANAGER_PROTOCOL *Manager; + + Status = gBS->LocateProtocol ( + &gEfiUserManagerProtocolGuid, + NULL, + (VOID **) &Manager + ); + if (EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + + return Manager->Identify (Manager, User); +} +