X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=IntelFrameworkModulePkg%2FLibrary%2FGenericBdsLib%2FBdsMisc.c;h=487807b3018f2a394bbdf0c13c91e32d236428cc;hp=f46efd86363161412cb25be237174dfd818dd4bc;hb=2b649f74775d0efd1e75c91f77c3045ae6249cb4;hpb=8c81cb83b96c81a9891e36d16cc13e789c6f8901 diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c index f46efd8636..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 @@ -572,9 +572,9 @@ BdsLibBuildOptionFromVar ( } Option = BdsLibVariableToOption (BdsCommonOptionList, OptionName); - ASSERT (Option != NULL); - Option->BootCurrent = OptionOrder[Index]; - + if (Option != NULL) { + Option->BootCurrent = OptionOrder[Index]; + } } FreePool (OptionOrder); @@ -795,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; } @@ -811,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. // @@ -938,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); @@ -1006,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 @@ -1234,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); +} +