/** @file\r
Misc BDS library function\r
\r
-Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation. <BR>\r
All rights reserved. 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
}\r
\r
Option = BdsLibVariableToOption (BdsCommonOptionList, OptionName);\r
- ASSERT (Option != NULL);\r
- Option->BootCurrent = OptionOrder[Index];\r
-\r
+ if (Option != NULL) {\r
+ Option->BootCurrent = OptionOrder[Index];\r
+ }\r
}\r
\r
FreePool (OptionOrder);\r
Root = NULL;\r
goto Done;\r
}\r
-\r
+ ASSERT (Root != NULL);\r
Status = Root->Open (Root, &ThisFile, FileName, EFI_FILE_MODE_READ, 0);\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
}\r
+ ASSERT (ThisFile != NULL);\r
\r
//\r
// Get file size\r
}\r
\r
\r
+/**\r
+ Identify a user and, if authenticated, returns the current user profile handle.\r
+\r
+ @param[out] User Point to user profile handle.\r
+ \r
+ @retval EFI_SUCCESS User is successfully identified, or user identification\r
+ is not supported.\r
+ @retval EFI_ACCESS_DENIED User is not successfully identified\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+BdsLibUserIdentify (\r
+ OUT EFI_USER_PROFILE_HANDLE *User\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+ EFI_USER_MANAGER_PROTOCOL *Manager;\r
+ \r
+ Status = gBS->LocateProtocol (\r
+ &gEfiUserManagerProtocolGuid,\r
+ NULL,\r
+ (VOID **) &Manager\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return EFI_SUCCESS;\r
+ }\r
+\r
+ return Manager->Identify (Manager, User);\r
+}\r
+\r