]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/UserIdentification/UserIdentifyManagerDxe/UserIdentifyManager.c
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
[mirror_edk2.git] / SecurityPkg / UserIdentification / UserIdentifyManagerDxe / UserIdentifyManager.c
index a7467b366290e4bcc8a962292646a4c5c7d94cf2..fd941792c1fe2c1dfd38c62ac3bfab28796a650e 100644 (file)
@@ -1,13 +1,14 @@
 /** @file\r
   This driver manages user information and produces user manager protocol.\r
-  \r
-Copyright (c) 2009 - 2014, 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
+\r
+Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r
+(C) Copyright 2018 Hewlett Packard Enterprise Development LP<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
 \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
 **/\r
@@ -80,20 +81,20 @@ EFI_USER_MANAGER_PROTOCOL gUserIdentifyManager = {
 /**\r
   Find the specified user in the user database.\r
 \r
-  This function searches the specified user from the beginning of the user database. \r
-  And if NextUser is TRUE, return the next User in the user database.  \r
-  \r
-  @param[in, out] User         On entry, points to the user profile entry to search. \r
+  This function searches the specified user from the beginning of the user database.\r
+  And if NextUser is TRUE, return the next User in the user database.\r
+\r
+  @param[in, out] User         On entry, points to the user profile entry to search.\r
                                On return, points to the user profile entry or NULL if not found.\r
   @param[in]      NextUser     If FALSE, find the user in user profile database specifyed by User\r
-                               If TRUE, find the next user in user profile database specifyed \r
-                               by User. \r
-  @param[out]     ProfileIndex A pointer to the index of user profile database that matches the \r
+                               If TRUE, find the next user in user profile database specifyed\r
+                               by User.\r
+  @param[out]     ProfileIndex A pointer to the index of user profile database that matches the\r
                                user specifyed by User.\r
 \r
   @retval EFI_NOT_FOUND        User was NULL, or User was not found, or the next user was not found.\r
   @retval EFI_SUCCESS          User or the next user are found in user profile database\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 FindUserProfile (\r
@@ -110,7 +111,7 @@ FindUserProfile (
   if ((mUserProfileDb == NULL) || (User == NULL)) {\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   //\r
   // Check whether the user profile is in the user profile database.\r
   //\r
@@ -151,22 +152,22 @@ FindUserProfile (
 /**\r
   Find the specified user information record in the specified User profile.\r
 \r
-  This function searches the specified user information record from the beginning of the user \r
-  profile. And if NextInfo is TRUE, return the next info in the user profile.  \r
-  \r
-  @param[in]      User     Points to the user profile entry.                             \r
+  This function searches the specified user information record from the beginning of the user\r
+  profile. And if NextInfo is TRUE, return the next info in the user profile.\r
+\r
+  @param[in]      User     Points to the user profile entry.\r
   @param[in, out] Info     On entry, points to the user information record or NULL to start\r
                            searching with the first user information record.\r
-                           On return, points to the user information record or NULL if not found.                           \r
+                           On return, points to the user information record or NULL if not found.\r
   @param[in]      NextInfo If FALSE, find the user information record in profile specifyed by User.\r
-                           If TRUE, find the next user information record in profile specifyed \r
-                           by User. \r
+                           If TRUE, find the next user information record in profile specifyed\r
+                           by User.\r
   @param[out]     Offset   A pointer to the offset of the information record in the user profile.\r
 \r
   @retval EFI_INVALID_PARAMETER Info is NULL\r
   @retval EFI_NOT_FOUND         Info was not found, or the next Info was not found.\r
   @retval EFI_SUCCESS           Info or the next info are found in user profile.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 FindUserInfo (\r
@@ -183,7 +184,7 @@ FindUserInfo (
   if (Info == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check user profile entry\r
   //\r
@@ -206,7 +207,7 @@ FindUserInfo (
     }\r
     InfoLen += ALIGN_VARIABLE (UserInfo->InfoSize);\r
   }\r
-  \r
+\r
   //\r
   // Check whether to find the next user information.\r
   //\r
@@ -244,21 +245,21 @@ FindUserInfo (
 /**\r
   Find a user infomation record by the information record type.\r
 \r
-  This function searches all user information records of User. The search starts with the \r
-  user information record following Info and continues until either the information is found \r
+  This function searches all user information records of User. The search starts with the\r
+  user information record following Info and continues until either the information is found\r
   or there are no more user infomation record.\r
   A match occurs when a Info.InfoType field matches the user information record type.\r
 \r
-  @param[in]      User     Points to the user profile record to search.                          \r
+  @param[in]      User     Points to the user profile record to search.\r
   @param[in, out] Info     On entry, points to the user information record or NULL to start\r
                            searching with the first user information record.\r
                            On return, points to the user information record or NULL if not found.\r
   @param[in]      InfoType The infomation type to be searched.\r
 \r
   @retval EFI_SUCCESS           User information was found. Info points to the user information record.\r
-  @retval EFI_NOT_FOUND         User information was not found.                           \r
+  @retval EFI_NOT_FOUND         User information was not found.\r
   @retval EFI_INVALID_PARAMETER User is NULL or Info is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 FindUserInfoByType (\r
@@ -274,7 +275,7 @@ FindUserInfoByType (
   if (Info == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check whether the user has the specified user information.\r
   //\r
@@ -288,7 +289,7 @@ FindUserInfoByType (
   if (EFI_ERROR (Status)) {\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   while (InfoLen < User->UserProfileSize) {\r
     UserInfo = (EFI_USER_INFO *) (User->ProfileInfo + InfoLen);\r
     if (UserInfo->InfoType == InfoType) {\r
@@ -308,27 +309,27 @@ FindUserInfoByType (
 /**\r
   Find a user using a user information record.\r
 \r
-  This function searches all user profiles for the specified user information record. The \r
-  search starts with the user information record handle following UserInfo and continues \r
+  This function searches all user profiles for the specified user information record. The\r
+  search starts with the user information record handle following UserInfo and continues\r
   until either the information is found or there are no more user profiles.\r
-  A match occurs when the Info.InfoType field matches the user information record type and the \r
+  A match occurs when the Info.InfoType field matches the user information record type and the\r
   user information record data matches the portion of Info passed the EFI_USER_INFO header.\r
 \r
-  @param[in, out] User     On entry, points to the previously returned user profile record, \r
-                           or NULL to start searching with the first user profile. \r
+  @param[in, out] User     On entry, points to the previously returned user profile record,\r
+                           or NULL to start searching with the first user profile.\r
                            On return, points to the user profile entry, or NULL if not found.\r
-  @param[in, out] UserInfo On entry, points to the previously returned user information record, \r
-                           or NULL to start searching with the first. \r
+  @param[in, out] UserInfo On entry, points to the previously returned user information record,\r
+                           or NULL to start searching with the first.\r
                            On return, points to the user information record, or NULL if not found.\r
-  @param[in]      Info     Points to the buffer containing the user information to be compared \r
+  @param[in]      Info     Points to the buffer containing the user information to be compared\r
                            to the user information record.\r
   @param[in]      InfoSize The size of Info, in bytes. Same as Info->InfoSize.\r
 \r
-  @retval EFI_SUCCESS           User information was found. User points to the user profile record, \r
+  @retval EFI_SUCCESS           User information was found. User points to the user profile record,\r
                                 and UserInfo points to the user information record.\r
-  @retval EFI_NOT_FOUND         User information was not found.                           \r
+  @retval EFI_NOT_FOUND         User information was not found.\r
   @retval EFI_INVALID_PARAMETER User is NULL; Info is NULL; or, InfoSize is too small.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 FindUserProfileByInfo (\r
@@ -361,7 +362,7 @@ FindUserProfileByInfo (
   if (*User == NULL) {\r
     *User = mUserProfileDb->UserProfile[0];\r
   }\r
-  \r
+\r
   //\r
   // Check user profile handle.\r
   //\r
@@ -376,7 +377,7 @@ FindUserProfileByInfo (
       if (EFI_ERROR (Status)) {\r
         break;\r
       }\r
-      \r
+\r
       if (InfoSize == Info->InfoSize) {\r
         if (CompareMem ((UINT8 *) (InfoEntry + 1), (UINT8 *) (Info + 1), InfoSize - sizeof (EFI_USER_INFO)) == 0) {\r
           //\r
@@ -387,9 +388,9 @@ FindUserProfileByInfo (
           }\r
           return EFI_SUCCESS;\r
         }\r
-      }      \r
+      }\r
     }\r
-    \r
+\r
     //\r
     // Get next user profile.\r
     //\r
@@ -409,7 +410,7 @@ FindUserProfileByInfo (
 \r
   @retval TRUE     The policy is a valid access policy.\r
   @retval FALSE    The access policy is not a valid access policy.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckAccessPolicy (\r
@@ -429,7 +430,7 @@ CheckAccessPolicy (
     //\r
     // Check access policy according to type.\r
     //\r
-    CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access));    \r
+    CopyMem (&Access, PolicyInfo + TotalLen, sizeof (Access));\r
     ValueLen = Access.Size - sizeof (EFI_USER_INFO_ACCESS_CONTROL);\r
     switch (Access.Type) {\r
     case EFI_USER_INFO_ACCESS_FORBID_LOAD:\r
@@ -491,7 +492,7 @@ CheckAccessPolicy (
 \r
   @retval TRUE     The policy is a valid identity policy.\r
   @retval FALSE    The access policy is not a valid identity policy.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckIdentityPolicy (\r
@@ -601,7 +602,7 @@ CheckIdentityPolicy (
 \r
   @retval TRUE     The info is a valid user information record.\r
   @retval FALSE    The info is not a valid user information record.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckUserInfo (\r
@@ -696,7 +697,7 @@ CheckUserInfo (
 \r
   @retval TRUE     It is a valid user profile.\r
   @retval FALSE    It is not a valid user profile.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckProfileInfo (\r
@@ -710,7 +711,7 @@ CheckProfileInfo (
   if (UserProfileInfo == NULL) {\r
     return FALSE;\r
   }\r
-  \r
+\r
   //\r
   // Check user profile information length.\r
   //\r
@@ -741,10 +742,10 @@ CheckProfileInfo (
   @param[in]  RightType      Could be EFI_USER_INFO_ACCESS_MANAGE,\r
                              EFI_USER_INFO_ACCESS_ENROLL_OTHERS or\r
                              EFI_USER_INFO_ACCESS_ENROLL_SELF.\r
-  \r
+\r
   @retval TRUE     Find the specified RightType in current user profile.\r
   @retval FALSE    Can't find the right in the profile.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckCurrentUserAccessRight (\r
@@ -881,7 +882,7 @@ GenerateUserId (
 \r
   @retval TRUE     Success to expand user profile database.\r
   @retval FALSE    Fail to expand user profile database.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 ExpandUsermUserProfileDb (\r
@@ -934,11 +935,11 @@ ExpandUsermUserProfileDb (
   Expand user profile\r
 \r
   @param[in]  User                    Points to user profile.\r
-  @param[in]  ExpandSize              The size of user profile. \r
+  @param[in]  ExpandSize              The size of user profile.\r
 \r
   @retval TRUE     Success to expand user profile size.\r
   @retval FALSE    Fail to expand user profile size.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 ExpandUserProfile (\r
@@ -958,7 +959,7 @@ ExpandUserProfile (
   if (Info == NULL) {\r
     return FALSE;\r
   }\r
-  \r
+\r
   //\r
   // Copy exist information.\r
   //\r
@@ -980,7 +981,7 @@ ExpandUserProfile (
                            If FALSE, save the user profile.\r
   @retval EFI_SUCCESS      Save or delete user profile successfully.\r
   @retval Others           Fail to change the profile.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 SaveNvUserProfile (\r
@@ -997,7 +998,7 @@ SaveNvUserProfile (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Save the user profile to non-volatile memory.\r
   //\r
@@ -1039,7 +1040,7 @@ AddUserInfo (
   if ((Info == NULL) || (User == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check user profile handle.\r
   //\r
@@ -1047,7 +1048,7 @@ AddUserInfo (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Check user information memory size.\r
   //\r
@@ -1056,7 +1057,7 @@ AddUserInfo (
       return EFI_OUT_OF_RESOURCES;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Add new user information.\r
   //\r
@@ -1082,9 +1083,9 @@ AddUserInfo (
 \r
   @param[in]      User            Point to the user profile.\r
   @param[in]      UserInfo        Point to the user information record to get.\r
-  @param[out]     Info            On entry, points to a buffer of at least *InfoSize bytes. \r
+  @param[out]     Info            On entry, points to a buffer of at least *InfoSize bytes.\r
                                   On exit, holds the user information.\r
-  @param[in, out] InfoSize        On entry, points to the size of Info. \r
+  @param[in, out] InfoSize        On entry, points to the size of Info.\r
                                   On return, points to the size of the user information.\r
   @param[in]      ChkRight        If TRUE, check the user info attribute.\r
                                   If FALSE, don't check the user info attribute.\r
@@ -1092,7 +1093,7 @@ AddUserInfo (
 \r
   @retval EFI_ACCESS_DENIED       The information cannot be accessed by the current user.\r
   @retval EFI_INVALID_PARAMETER   InfoSize is NULL or UserInfo is NULL.\r
-  @retval EFI_BUFFER_TOO_SMALL    The number of bytes specified by *InfoSize is too small to hold the \r
+  @retval EFI_BUFFER_TOO_SMALL    The number of bytes specified by *InfoSize is too small to hold the\r
                                   returned data. The actual size required is returned in *InfoSize.\r
   @retval EFI_SUCCESS             Information returned successfully.\r
 \r
@@ -1115,7 +1116,7 @@ GetUserInfo (
   if ((*InfoSize != 0) && (Info == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Find the user information to get.\r
   //\r
@@ -1123,7 +1124,7 @@ GetUserInfo (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Check information attributes.\r
   //\r
@@ -1144,7 +1145,7 @@ GetUserInfo (
       break;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Get user information.\r
   //\r
@@ -1196,7 +1197,7 @@ DelUserInfo (
   if (Info->InfoType == EFI_USER_INFO_IDENTIFIER_RECORD) {\r
     return EFI_ACCESS_DENIED;\r
   }\r
-  \r
+\r
   //\r
   // Delete the specified user information.\r
   //\r
@@ -1219,7 +1220,7 @@ DelUserInfo (
 \r
   @param[in]      User           Point to the user profile.\r
   @param[in, out] UserInfo       On entry, points to the user information to modify,\r
-                                 or NULL to add a new UserInfo. \r
+                                 or NULL to add a new UserInfo.\r
                                  On return, points to the modified user information.\r
   @param[in]      Info           Points to the new user information.\r
   @param[in]      InfoSize       The size of Info,in bytes.\r
@@ -1248,14 +1249,14 @@ ModifyUserInfo (
   if (InfoSize < sizeof (EFI_USER_INFO) || InfoSize != Info->InfoSize) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check user information.\r
   //\r
   if (Info->InfoType == EFI_USER_INFO_IDENTIFIER_RECORD) {\r
     return EFI_ACCESS_DENIED;\r
   }\r
-  \r
+\r
   if (!CheckUserInfo (Info)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -1273,7 +1274,7 @@ ModifyUserInfo (
       }\r
       ASSERT (OldInfo != NULL);\r
 \r
-      if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) || \r
+      if (((OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) ||\r
            ((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0)) {\r
         //\r
         //  Same type can not co-exist for exclusive information.\r
@@ -1291,7 +1292,7 @@ ModifyUserInfo (
       if (!CompareGuid (&OldInfo->Credential, &Info->Credential)) {\r
         continue;\r
       }\r
-  \r
+\r
       PayloadLen = Info->InfoSize - sizeof (EFI_USER_INFO);\r
       if (PayloadLen == 0) {\r
         continue;\r
@@ -1310,7 +1311,7 @@ ModifyUserInfo (
     Status = AddUserInfo (User, (UINT8 *) Info, InfoSize, UserInfo, TRUE);\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Modify existing user information.\r
   //\r
@@ -1318,11 +1319,11 @@ ModifyUserInfo (
   if (OldInfo->InfoType != Info->InfoType) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
-  if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) && \r
+\r
+  if (((Info->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) != 0) &&\r
        (OldInfo->InfoAttribs & EFI_USER_INFO_EXCLUSIVE) == 0) {\r
     //\r
-    // Try to add exclusive attrib in new info. \r
+    // Try to add exclusive attrib in new info.\r
     // Check whether there is another information with the same type in profile.\r
     //\r
     OldInfo = NULL;\r
@@ -1338,7 +1339,7 @@ ModifyUserInfo (
         //\r
         return EFI_ACCESS_DENIED;\r
       }\r
-    } while (TRUE);    \r
+    } while (TRUE);\r
   }\r
 \r
   Status = DelUserInfo (User, *UserInfo, FALSE);\r
@@ -1357,7 +1358,7 @@ ModifyUserInfo (
 \r
   @retval EFI_SUCCESS      Delete user from the user profile successfully.\r
   @retval Others           Fail to delete user from user profile\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 DelUserProfile (\r
@@ -1374,14 +1375,14 @@ DelUserProfile (
   if (EFI_ERROR (Status)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check whether it is the current user.\r
   //\r
   if (User == mCurrentUser) {\r
     return EFI_ACCESS_DENIED;\r
   }\r
-  \r
+\r
   //\r
   // Delete user profile from the non-volatile memory.\r
   //\r
@@ -1448,7 +1449,7 @@ AddUserProfile (
   if (!CheckProfileInfo (ProfileInfo, ProfileSize)) {\r
     return EFI_SECURITY_VIOLATION;\r
   }\r
-  \r
+\r
   //\r
   // Create user profile entry.\r
   //\r
@@ -1467,9 +1468,9 @@ AddUserProfile (
   }\r
 \r
   UnicodeSPrint (\r
-    User->UserVarName, \r
+    User->UserVarName,\r
     sizeof (User->UserVarName),\r
-    L"User%04x", \r
+    L"User%04x",\r
     mUserProfileDb->UserProfileNum\r
     );\r
   User->UserProfileSize = 0;\r
@@ -1531,7 +1532,7 @@ CreateUserProfile (
   UserInfo->InfoSize    = sizeof (EFI_USER_INFO) + sizeof (EFI_USER_INFO_IDENTIFIER);\r
   UserInfo->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | EFI_USER_INFO_PUBLIC | EFI_USER_INFO_EXCLUSIVE;\r
   GenerateUserId ((UINT8 *) (UserInfo + 1));\r
-  \r
+\r
   //\r
   // Add user profile to the user profile database.\r
   //\r
@@ -1546,7 +1547,7 @@ CreateUserProfile (
 \r
   @retval EFI_SUCCESS             A default user profile is added successfully.\r
   @retval Others                  Fail to add a default user profile\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 AddDefaultUserProfile (\r
@@ -1561,7 +1562,7 @@ AddDefaultUserProfile (
   EFI_USER_INFO_USAGE_COUNT     UsageCount;\r
   EFI_USER_INFO_ACCESS_CONTROL  *Access;\r
   EFI_USER_INFO_IDENTITY_POLICY *Policy;\r
-  \r
+\r
   //\r
   // Create a user profile.\r
   //\r
@@ -1569,7 +1570,7 @@ AddDefaultUserProfile (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
\r
+\r
   //\r
   // Allocate a buffer to add all default user information.\r
   //\r
@@ -1590,7 +1591,7 @@ AddDefaultUserProfile (
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
   }\r
-  \r
+\r
   //\r
   // Add user profile create date record.\r
   //\r
@@ -1608,7 +1609,7 @@ AddDefaultUserProfile (
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
   }\r
-  \r
+\r
   //\r
   // Add user profile usage count record.\r
   //\r
@@ -1622,7 +1623,7 @@ AddDefaultUserProfile (
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
   }\r
\r
+\r
   //\r
   // Add user access right.\r
   //\r
@@ -1637,7 +1638,7 @@ AddDefaultUserProfile (
   if (EFI_ERROR (Status)) {\r
     goto Done;\r
   }\r
-  \r
+\r
   //\r
   // Add user identity policy.\r
   //\r
@@ -1645,7 +1646,7 @@ AddDefaultUserProfile (
   Info->InfoAttribs = EFI_USER_INFO_STORAGE_PLATFORM_NV | EFI_USER_INFO_PRIVATE | EFI_USER_INFO_EXCLUSIVE;\r
   Policy            = (EFI_USER_INFO_IDENTITY_POLICY *) (Info + 1);\r
   Policy->Type      = EFI_USER_INFO_IDENTITY_TRUE;\r
-  Policy->Length    = sizeof (EFI_USER_INFO_IDENTITY_POLICY);  \r
+  Policy->Length    = sizeof (EFI_USER_INFO_IDENTITY_POLICY);\r
   Info->InfoSize    = sizeof (EFI_USER_INFO) + Policy->Length;\r
   NewInfo = NULL;\r
   Status  = ModifyUserInfo (User, &NewInfo, Info, Info->InfoSize);\r
@@ -1659,7 +1660,7 @@ Done:
 /**\r
   Publish current user information into EFI System Configuration Table.\r
 \r
-  By UEFI spec, the User Identity Manager will publish the current user profile \r
+  By UEFI spec, the User Identity Manager will publish the current user profile\r
   into the EFI System Configuration Table. Currently, only the user identifier and user\r
   name are published.\r
 \r
@@ -1684,7 +1685,7 @@ PublishUserTable (
              );\r
   if (!EFI_ERROR (Status)) {\r
     //\r
-    // The table existed! \r
+    // The table existed!\r
     //\r
     return EFI_SUCCESS;\r
   }\r
@@ -1706,13 +1707,13 @@ PublishUserTable (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Allocate a buffer for user information table.\r
   //\r
   UserInfoTable = (EFI_USER_INFO_TABLE *) AllocateRuntimePool (\r
-                                            sizeof (EFI_USER_INFO_TABLE) + \r
-                                            IdInfo->InfoSize + \r
+                                            sizeof (EFI_USER_INFO_TABLE) +\r
+                                            IdInfo->InfoSize +\r
                                             NameInfo->InfoSize\r
                                             );\r
   if (UserInfoTable == NULL) {\r
@@ -1720,8 +1721,8 @@ PublishUserTable (
     return Status;\r
   }\r
 \r
-  UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE);  \r
-  \r
+  UserInfoTable->Size = sizeof (EFI_USER_INFO_TABLE);\r
+\r
   //\r
   // Append the user information to the user info table\r
   //\r
@@ -1739,7 +1740,7 @@ PublishUserTable (
 /**\r
   Get the user's identity type.\r
 \r
-  The identify manager only supports the identity policy in which the credential \r
+  The identify manager only supports the identity policy in which the credential\r
   provider handles are connected by the operator 'AND' or 'OR'.\r
 \r
 \r
@@ -1770,7 +1771,7 @@ GetIdentifyType (
     return Status;\r
   }\r
   ASSERT (IdentifyInfo != NULL);\r
-  \r
+\r
   //\r
   // Search the user identify policy according to type.\r
   //\r
@@ -1822,7 +1823,7 @@ IdentifyByProviderId (
   if (Provider == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check the user ID identified by the specified credential provider.\r
   //\r
@@ -1842,12 +1843,12 @@ IdentifyByProviderId (
         // Get credential provider form.\r
         //\r
         Status = UserCredential->Form (\r
-                                   UserCredential, \r
-                                   &HiiHandle, \r
-                                   &FormSetId, \r
+                                   UserCredential,\r
+                                   &HiiHandle,\r
+                                   &FormSetId,\r
                                    &FormId\r
                                    );\r
-        if (!EFI_ERROR (Status)) {        \r
+        if (!EFI_ERROR (Status)) {\r
           //\r
           // Send form to get user input.\r
           //\r
@@ -1862,8 +1863,8 @@ IdentifyByProviderId (
                                                   );\r
           if (EFI_ERROR (Status)) {\r
             return Status;\r
-          }                                            \r
-        }        \r
+          }\r
+        }\r
       }\r
 \r
       Status = UserCredential->User (UserCredential, User, &UserId);\r
@@ -1875,7 +1876,7 @@ IdentifyByProviderId (
       if (EFI_ERROR (Status)) {\r
         return Status;\r
       }\r
-      \r
+\r
       return EFI_SUCCESS;\r
     }\r
   }\r
@@ -1913,7 +1914,7 @@ UpdateUserInfo (
   if (Info == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Check create date record.\r
   //\r
@@ -1937,7 +1938,7 @@ UpdateUserInfo (
       return Status;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Update usage date record.\r
   //\r
@@ -1960,7 +1961,7 @@ UpdateUserInfo (
       return Status;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Update usage count record.\r
   //\r
@@ -2042,7 +2043,7 @@ AddProviderSelection (
   Add a username item in form.\r
 \r
   @param[in]  Index            The index of the user in the user name list.\r
-  @param[in]  User             Points to the user profile whose username is added. \r
+  @param[in]  User             Points to the user profile whose username is added.\r
   @param[in]  OpCodeHandle     Points to container for dynamic created opcodes.\r
 \r
   @retval EFI_SUCCESS          Add a username successfully.\r
@@ -2065,7 +2066,7 @@ AddUserSelection (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Add user name selection.\r
   //\r
@@ -2089,12 +2090,12 @@ AddUserSelection (
 \r
 /**\r
   Identify the user whose identity policy does not contain the operator 'OR'.\r
-  \r
+\r
   @param[in]  User             Points to the user profile.\r
 \r
   @retval EFI_SUCCESS          The specified user is identified successfully.\r
   @retval Others               Fail to identify the user.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 IdentifyAndTypeUser (\r
@@ -2117,7 +2118,7 @@ IdentifyAndTypeUser (
     return Status;\r
   }\r
   ASSERT (IdentifyInfo != NULL);\r
-  \r
+\r
   //\r
   // Check each part of identification policy expression.\r
   //\r
@@ -2212,12 +2213,12 @@ IdentifyAndTypeUser (
 \r
 /**\r
   Identify the user whose identity policy does not contain the operator 'AND'.\r
-  \r
+\r
   @param[in]  User             Points to the user profile.\r
 \r
   @retval EFI_SUCCESS          The specified user is identified successfully.\r
   @retval Others               Fail to identify the user.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 IdentifyOrTypeUser (\r
@@ -2243,7 +2244,7 @@ IdentifyOrTypeUser (
     return Status;\r
   }\r
   ASSERT (IdentifyInfo != NULL);\r
-  \r
+\r
   //\r
   // Initialize the container for dynamic opcodes.\r
   //\r
@@ -2353,16 +2354,16 @@ UserIdentifyManagerCallback (
       if (QuestionId != FORM_OPEN_QUESTION_ID) {\r
         return EFI_SUCCESS;\r
       }\r
-  \r
+\r
       //\r
       // Initialize the container for dynamic opcodes.\r
       //\r
       StartOpCodeHandle = HiiAllocateOpCodeHandle ();\r
       ASSERT (StartOpCodeHandle != NULL);\r
-  \r
+\r
       EndOpCodeHandle = HiiAllocateOpCodeHandle ();\r
       ASSERT (EndOpCodeHandle != NULL);\r
-  \r
+\r
       //\r
       // Create Hii Extend Label OpCode.\r
       //\r
@@ -2374,7 +2375,7 @@ UserIdentifyManagerCallback (
                                             );\r
       StartLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;\r
       StartLabel->Number        = LABEL_USER_NAME;\r
-  \r
+\r
       EndLabel = (EFI_IFR_GUID_LABEL *) HiiCreateGuidOpCode (\r
                                           EndOpCodeHandle,\r
                                           &gEfiIfrTianoGuid,\r
@@ -2383,7 +2384,7 @@ UserIdentifyManagerCallback (
                                           );\r
       EndLabel->ExtendOpCode  = EFI_IFR_EXTEND_OP_LABEL;\r
       EndLabel->Number        = LABEL_END;\r
-  \r
+\r
       //\r
       // Add all the user profile in the user profile database.\r
       //\r
@@ -2391,7 +2392,7 @@ UserIdentifyManagerCallback (
         User = (USER_PROFILE_ENTRY *) mUserProfileDb->UserProfile[Index];\r
         AddUserSelection ((UINT16)(LABEL_USER_NAME + Index), User, StartOpCodeHandle);\r
       }\r
-  \r
+\r
       HiiUpdateForm (\r
         mCallbackInfo->HiiHandle, // HII handle\r
         &gUserIdentifyManagerGuid,// Formset GUID\r
@@ -2399,10 +2400,10 @@ UserIdentifyManagerCallback (
         StartOpCodeHandle,        // Label for where to insert opcodes\r
         EndOpCodeHandle           // Replace data\r
         );\r
-  \r
+\r
       HiiFreeOpCodeHandle (StartOpCodeHandle);\r
       HiiFreeOpCodeHandle (EndOpCodeHandle);\r
-  \r
+\r
       return EFI_SUCCESS;\r
     }\r
     break;\r
@@ -2414,7 +2415,7 @@ UserIdentifyManagerCallback (
   case EFI_BROWSER_ACTION_CHANGED:\r
     if (QuestionId >= LABEL_PROVIDER_NAME) {\r
       //\r
-      // QuestionId comes from the second Form (Select a Credential Provider if identity  \r
+      // QuestionId comes from the second Form (Select a Credential Provider if identity\r
       // policy is OR type). Identify the user by the selected provider.\r
       //\r
       Status = IdentifyByProviderId (mCurrentUser, &mProviderDb->Provider[QuestionId & 0xFFF]->Identifier);\r
@@ -2425,7 +2426,7 @@ UserIdentifyManagerCallback (
       return EFI_SUCCESS;\r
     }\r
     break;\r
-    \r
+\r
   case EFI_BROWSER_ACTION_CHANGING:\r
     //\r
     // QuestionId comes from the first Form (Select a user to identify).\r
@@ -2482,12 +2483,12 @@ UserIdentifyManagerCallback (
 \r
 /**\r
   This function construct user profile database from user data saved in the Flash.\r
-  If no user is found in Flash, add one default user "administrator" in the user \r
+  If no user is found in Flash, add one default user "administrator" in the user\r
   profile database.\r
 \r
   @retval EFI_SUCCESS            Init user profile database successfully.\r
   @retval Others                 Fail to init user profile database.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 InitUserProfileDb (\r
@@ -2521,7 +2522,7 @@ InitUserProfileDb (
   if (VarData == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   //\r
   // Get all user proifle entries.\r
   //\r
@@ -2531,9 +2532,9 @@ InitUserProfileDb (
     // Get variable name.\r
     //\r
     UnicodeSPrint (\r
-      VarName, \r
+      VarName,\r
       sizeof (VarName),\r
-      L"User%04x", \r
+      L"User%04x",\r
       Index\r
       );\r
     Index++;\r
@@ -2561,7 +2562,7 @@ InitUserProfileDb (
       }\r
       break;\r
     }\r
-    \r
+\r
     //\r
     // Check variable attributes.\r
     //\r
@@ -2569,7 +2570,7 @@ InitUserProfileDb (
       Status = gRT->SetVariable (VarName, &gUserIdentifyManagerGuid, VarAttr, 0, NULL);\r
       continue;\r
     }\r
-    \r
+\r
     //\r
     // Add user profile to the user profile database.\r
     //\r
@@ -2601,7 +2602,7 @@ InitUserProfileDb (
   if (EFI_ERROR (Status)) {\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Check whether the user profile database is empty.\r
   //\r
@@ -2628,7 +2629,7 @@ InitProviderInfo (
   EFI_STATUS  Status;\r
   UINTN       HandleCount;\r
   EFI_HANDLE  *HandleBuf;\r
-  UINTN       Index; \r
+  UINTN       Index;\r
 \r
   if (mProviderDb != NULL) {\r
     //\r
@@ -2657,8 +2658,8 @@ InitProviderInfo (
   // Get provider infomation.\r
   //\r
   mProviderDb = AllocateZeroPool (\r
-                  sizeof (CREDENTIAL_PROVIDER_INFO) - \r
-                  sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) + \r
+                  sizeof (CREDENTIAL_PROVIDER_INFO) -\r
+                  sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *) +\r
                   HandleCount * sizeof (EFI_USER_CREDENTIAL2_PROTOCOL *)\r
                   );\r
   if (mProviderDb == NULL) {\r
@@ -2752,6 +2753,8 @@ FakeRouteConfig (
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  *Progress = Configuration;\r
+\r
   return EFI_NOT_FOUND;\r
 }\r
 \r
@@ -2815,7 +2818,7 @@ InitFormBrowser (
 \r
   CallbackInfo->FormBrowser2  = FormBrowser2;\r
   CallbackInfo->DriverHandle  = NULL;\r
-  \r
+\r
   //\r
   // Install Device Path Protocol and Config Access protocol to driver handle.\r
   //\r
@@ -2889,7 +2892,7 @@ IdentifyAutoLogonUser (
     FreePool (Info);\r
     return Status;\r
   }\r
-  \r
+\r
   //\r
   // Find user with the specified user ID.\r
   //\r
@@ -2908,7 +2911,7 @@ IdentifyAutoLogonUser (
     //\r
     return EFI_NOT_READY;\r
   }\r
-  \r
+\r
   return Status;\r
 }\r
 \r
@@ -2917,22 +2920,22 @@ IdentifyAutoLogonUser (
   Check whether the given console is ready.\r
 \r
   @param[in]   ProtocolGuid   Points to the protocol guid of sonsole .\r
-  \r
+\r
   @retval TRUE     The given console is ready.\r
   @retval FALSE    The given console is not ready.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 CheckConsole (\r
-  EFI_GUID                     *ProtocolGuid  \r
+  EFI_GUID                     *ProtocolGuid\r
   )\r
 {\r
   EFI_STATUS                   Status;\r
   UINTN                        HandleCount;\r
   EFI_HANDLE                   *HandleBuf;\r
-  UINTN                        Index; \r
+  UINTN                        Index;\r
   EFI_DEVICE_PATH_PROTOCOL     *DevicePath;\r
-  \r
+\r
   //\r
   // Try to find all the handle driver.\r
   //\r
@@ -2956,7 +2959,7 @@ CheckConsole (
       return TRUE;\r
     }\r
   }\r
-  FreePool (HandleBuf);  \r
+  FreePool (HandleBuf);\r
   return FALSE;\r
 }\r
 \r
@@ -2966,7 +2969,7 @@ CheckConsole (
 \r
   @retval TRUE     The console is ready.\r
   @retval FALSE    The console is not ready.\r
-  \r
+\r
 **/\r
 BOOLEAN\r
 IsConsoleReady (\r
@@ -2982,7 +2985,7 @@ IsConsoleReady (
     return FALSE;\r
     }\r
   }\r
-  \r
+\r
   return TRUE;\r
 }\r
 \r
@@ -3038,7 +3041,7 @@ IdentifyUser (
       return EFI_SUCCESS;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Find and login the default & AutoLogon user.\r
   //\r
@@ -3059,7 +3062,7 @@ IdentifyUser (
       }\r
     }\r
   }\r
-  \r
+\r
   if (!IsConsoleReady ()) {\r
     //\r
     // The console is still not ready for user selection.\r
@@ -3079,20 +3082,20 @@ IdentifyUser (
                                  NULL,\r
                                  NULL\r
                                  );\r
-  \r
+\r
   if (mIdentified) {\r
     *User = (USER_PROFILE_ENTRY *) mCurrentUser;\r
     UpdateUserInfo (*User);\r
     return EFI_SUCCESS;\r
   }\r
-  \r
+\r
   return EFI_ACCESS_DENIED;\r
 }\r
 \r
 \r
 /**\r
   An empty function to pass error checking of CreateEventEx ().\r
\r
+\r
   @param  Event         Event whose notification function is being invoked.\r
   @param  Context       Pointer to the notification function's context,\r
                         which is implementation-dependent.\r
@@ -3137,19 +3140,19 @@ SignalEventUserProfileChanged (
 /**\r
   Create a new user profile.\r
 \r
-  This function creates a new user profile with only a new user identifier attached and returns \r
+  This function creates a new user profile with only a new user identifier attached and returns\r
   its handle. The user profile is non-volatile, but the handle User can change across reboots.\r
 \r
   @param[in]  This               Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[out] User               On return, points to the new user profile handle. \r
+  @param[out] User               On return, points to the new user profile handle.\r
                                  The user profile handle is unique only during this boot.\r
\r
+\r
   @retval EFI_SUCCESS            User profile was successfully created.\r
-  @retval EFI_ACCESS_DENIED      Current user does not have sufficient permissions to create a \r
+  @retval EFI_ACCESS_DENIED      Current user does not have sufficient permissions to create a\r
                                  user profile.\r
   @retval EFI_UNSUPPORTED        Creation of new user profiles is not supported.\r
   @retval EFI_INVALID_PARAMETER  The User parameter is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3172,7 +3175,7 @@ UserProfileCreate (
       return EFI_ACCESS_DENIED;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Create new user profile\r
   //\r
@@ -3188,14 +3191,14 @@ UserProfileCreate (
   Delete an existing user profile.\r
 \r
   @param[in] This                Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in] User                User profile handle. \r
+  @param[in] User                User profile handle.\r
 \r
   @retval EFI_SUCCESS            User profile was successfully deleted.\r
   @retval EFI_ACCESS_DENIED      Current user does not have sufficient permissions to delete a user\r
                                  profile or there is only one user profile.\r
   @retval EFI_UNSUPPORTED        Deletion of new user profiles is not supported.\r
   @retval EFI_INVALID_PARAMETER  User does not refer to a valid user profile.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3209,14 +3212,14 @@ UserProfileDelete (
   if (This == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check the right of the current user.\r
   //\r
   if (!CheckCurrentUserAccessRight (EFI_USER_INFO_ACCESS_MANAGE)) {\r
     return EFI_ACCESS_DENIED;\r
   }\r
-  \r
+\r
   //\r
   // Delete user profile.\r
   //\r
@@ -3235,16 +3238,16 @@ UserProfileDelete (
 /**\r
   Enumerate all of the enrolled users on the platform.\r
 \r
-  This function returns the next enrolled user profile. To retrieve the first user profile handle,  \r
-  point User at a NULL. Each subsequent call will retrieve another user profile handle until there \r
-  are no more, at which point User will point to NULL. \r
+  This function returns the next enrolled user profile. To retrieve the first user profile handle,\r
+  point User at a NULL. Each subsequent call will retrieve another user profile handle until there\r
+  are no more, at which point User will point to NULL.\r
 \r
   @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in, out] User           On entry, points to the previous user profile handle or NULL to \r
+  @param[in, out] User           On entry, points to the previous user profile handle or NULL to\r
                                  start enumeration. On exit, points to the next user profile handle\r
                                  or NULL if there are no more user profiles.\r
 \r
-  @retval EFI_SUCCESS            Next enrolled user profile successfully returned. \r
+  @retval EFI_SUCCESS            Next enrolled user profile successfully returned.\r
   @retval EFI_ACCESS_DENIED      Next enrolled user profile was not successfully returned.\r
   @retval EFI_INVALID_PARAMETER  The User parameter is NULL.\r
 **/\r
@@ -3260,7 +3263,7 @@ UserProfileGetNext (
   if ((This == NULL) || (User == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   Status = FindUserProfile ((USER_PROFILE_ENTRY **) User, TRUE, NULL);\r
   if (EFI_ERROR (Status)) {\r
     return EFI_ACCESS_DENIED;\r
@@ -3275,9 +3278,9 @@ UserProfileGetNext (
   @param[in]  This               Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
   @param[out] CurrentUser        On return, points to the current user profile handle.\r
 \r
-  @retval EFI_SUCCESS            Current user profile handle returned successfully. \r
+  @retval EFI_SUCCESS            Current user profile handle returned successfully.\r
   @retval EFI_INVALID_PARAMETER  The CurrentUser parameter is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3285,7 +3288,7 @@ UserProfileCurrent (
   IN CONST  EFI_USER_MANAGER_PROTOCOL           *This,\r
   OUT       EFI_USER_PROFILE_HANDLE             *CurrentUser\r
   )\r
-{  \r
+{\r
   //\r
   // Get current user profile.\r
   //\r
@@ -3303,8 +3306,8 @@ UserProfileCurrent (
 \r
   Identify the user and, if authenticated, returns the user handle and changes the current\r
   user profile. All user information marked as private in a previously selected profile\r
-  is no longer available for inspection. \r
-  Whenever the current user profile is changed then the an event with the GUID \r
+  is no longer available for inspection.\r
+  Whenever the current user profile is changed then the an event with the GUID\r
   EFI_EVENT_GROUP_USER_PROFILE_CHANGED is signaled.\r
 \r
   @param[in]  This               Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
@@ -3314,7 +3317,7 @@ UserProfileCurrent (
   @retval EFI_SUCCESS            User was successfully identified.\r
   @retval EFI_ACCESS_DENIED      User was not successfully identified.\r
   @retval EFI_INVALID_PARAMETER  The User parameter is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3333,7 +3336,7 @@ UserProfileIdentify (
     *User = mCurrentUser;\r
     return EFI_SUCCESS;\r
   }\r
-  \r
+\r
   //\r
   // Identify user\r
   //\r
@@ -3341,7 +3344,7 @@ UserProfileIdentify (
   if (EFI_ERROR (Status)) {\r
     return EFI_ACCESS_DENIED;\r
   }\r
-  \r
+\r
   //\r
   // Publish the user info into the EFI system configuration table.\r
   //\r
@@ -3358,35 +3361,35 @@ UserProfileIdentify (
   Find a user using a user information record.\r
 \r
   This function searches all user profiles for the specified user information record.\r
-  The search starts with the user information record handle following UserInfo and \r
+  The search starts with the user information record handle following UserInfo and\r
   continues until either the information is found or there are no more user profiles.\r
   A match occurs when the Info.InfoType field matches the user information record\r
   type and the user information record data matches the portion of Info.\r
 \r
   @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in, out] User           On entry, points to the previously returned user profile \r
+  @param[in, out] User           On entry, points to the previously returned user profile\r
                                  handle, or NULL to start searching with the first user profile.\r
                                  On return, points to the user profile handle, or NULL if not\r
                                  found.\r
   @param[in, out] UserInfo       On entry, points to the previously returned user information\r
-                                 handle, or NULL to start searching with the first. On return, \r
+                                 handle, or NULL to start searching with the first. On return,\r
                                  points to the user information handle of the user information\r
-                                 record, or NULL if not found. Can be NULL, in which case only \r
-                                 one user information record per user can be returned. \r
-  @param[in]      Info           Points to the buffer containing the user information to be \r
-                                 compared to the user information record. If the user information \r
-                                 record data is empty, then only the user information record type \r
-                                 is compared. If InfoSize is 0, then the user information record \r
+                                 record, or NULL if not found. Can be NULL, in which case only\r
+                                 one user information record per user can be returned.\r
+  @param[in]      Info           Points to the buffer containing the user information to be\r
+                                 compared to the user information record. If the user information\r
+                                 record data is empty, then only the user information record type\r
+                                 is compared. If InfoSize is 0, then the user information record\r
                                  must be empty.\r
 \r
-  @param[in]      InfoSize       The size of Info, in bytes. \r
+  @param[in]      InfoSize       The size of Info, in bytes.\r
 \r
   @retval EFI_SUCCESS            User information was found. User points to the user profile\r
                                  handle, and UserInfo points to the user information handle.\r
-  @retval EFI_NOT_FOUND          User information was not found. User points to NULL, and  \r
+  @retval EFI_NOT_FOUND          User information was not found. User points to NULL, and\r
                                  UserInfo points to NULL.\r
-  @retval EFI_INVALID_PARAMETER  User is NULL. Or Info is NULL.                           \r
-  \r
+  @retval EFI_INVALID_PARAMETER  User is NULL. Or Info is NULL.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3417,8 +3420,8 @@ UserProfileFind (
       return EFI_INVALID_PARAMETER;\r
     }\r
   }\r
-  Size = Info->InfoSize;  \r
-  \r
+  Size = Info->InfoSize;\r
+\r
   //\r
   // Find user profile accdoring to user information.\r
   //\r
@@ -3435,7 +3438,7 @@ UserProfileFind (
     }\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -3443,31 +3446,31 @@ UserProfileFind (
 /**\r
   Return information attached to the user.\r
 \r
-  This function returns user information. The format of the information is described in User \r
-  Information. The function may return EFI_ACCESS_DENIED if the information is marked private \r
-  and the handle specified by User is not the current user profile. The function may return \r
-  EFI_ACCESS_DENIED if the information is marked protected and the information is associated \r
+  This function returns user information. The format of the information is described in User\r
+  Information. The function may return EFI_ACCESS_DENIED if the information is marked private\r
+  and the handle specified by User is not the current user profile. The function may return\r
+  EFI_ACCESS_DENIED if the information is marked protected and the information is associated\r
   with a credential provider for which the user has not been authenticated.\r
 \r
   @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in]      User           Handle of the user whose profile will be retrieved. \r
-  @param[in]      UserInfo       Handle of the user information data record.   \r
-  @param[out]     Info           On entry, points to a buffer of at least *InfoSize bytes. On exit,  \r
-                                 holds the user information. If the buffer is too small to hold the  \r
-                                 information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is \r
-                                 updated to contain the number of bytes actually required. \r
-  @param[in, out] InfoSize       On entry, points to the size of Info. On return, points to the size  \r
-                                 of the user information. \r
+  @param[in]      User           Handle of the user whose profile will be retrieved.\r
+  @param[in]      UserInfo       Handle of the user information data record.\r
+  @param[out]     Info           On entry, points to a buffer of at least *InfoSize bytes. On exit,\r
+                                 holds the user information. If the buffer is too small to hold the\r
+                                 information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is\r
+                                 updated to contain the number of bytes actually required.\r
+  @param[in, out] InfoSize       On entry, points to the size of Info. On return, points to the size\r
+                                 of the user information.\r
 \r
   @retval EFI_SUCCESS            Information returned successfully.\r
-  @retval EFI_ACCESS_DENIED      The information about the specified user cannot be accessed by the \r
+  @retval EFI_ACCESS_DENIED      The information about the specified user cannot be accessed by the\r
                                  current user.\r
-  @retval EFI_BUFFER_TOO_SMALL   The number of bytes specified by *InfoSize is too small to hold the \r
+  @retval EFI_BUFFER_TOO_SMALL   The number of bytes specified by *InfoSize is too small to hold the\r
                                  returned data. The actual size required is returned in *InfoSize.\r
-  @retval EFI_NOT_FOUND          User does not refer to a valid user profile or UserInfo does not refer \r
+  @retval EFI_NOT_FOUND          User does not refer to a valid user profile or UserInfo does not refer\r
                                  to a valid user info handle.\r
   @retval EFI_INVALID_PARAMETER  Info is NULL or InfoSize is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3488,11 +3491,11 @@ UserProfileGetInfo (
   if ((*InfoSize != 0) && (Info == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   if ((User == NULL) || (UserInfo == NULL)) {\r
     return EFI_NOT_FOUND;\r
   }\r
-  \r
+\r
   Status = GetUserInfo (User, UserInfo, Info, InfoSize, TRUE);\r
   if (EFI_ERROR (Status)) {\r
     if (Status == EFI_BUFFER_TOO_SMALL) {\r
@@ -3507,32 +3510,32 @@ UserProfileGetInfo (
 /**\r
   Add or update user information.\r
 \r
-  This function changes user information.  If NULL is pointed to by UserInfo, then a new user \r
-  information record is created and its handle is returned in UserInfo. Otherwise, the existing  \r
+  This function changes user information.  If NULL is pointed to by UserInfo, then a new user\r
+  information record is created and its handle is returned in UserInfo. Otherwise, the existing\r
   one is replaced.\r
-  If EFI_USER_INFO_IDENITTY_POLICY_RECORD is changed, it is the caller's responsibility to keep \r
+  If EFI_USER_INFO_IDENITTY_POLICY_RECORD is changed, it is the caller's responsibility to keep\r
   it to be synced with the information on credential providers.\r
-  If EFI_USER_INFO_EXCLUSIVE is specified in Info and a user information record of the same \r
+  If EFI_USER_INFO_EXCLUSIVE is specified in Info and a user information record of the same\r
   type already exists in the user profile, then EFI_ACCESS_DENIED will be returned and UserInfo\r
   will point to the handle of the existing record.\r
 \r
   @param[in]      This            Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in]      User            Handle of the user whose profile will be retrieved. \r
-  @param[in, out] UserInfo        Handle of the user information data record.   \r
-  @param[in]      Info            On entry, points to a buffer of at least *InfoSize bytes. On exit, \r
-                                  holds the user information. If the buffer is too small to hold the \r
-                                  information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is \r
-                                  updated to contain the number of bytes actually required. \r
-  @param[in]      InfoSize        On entry, points to the size of Info. On return, points to the size \r
-                                  of the user information. \r
+  @param[in]      User            Handle of the user whose profile will be retrieved.\r
+  @param[in, out] UserInfo        Handle of the user information data record.\r
+  @param[in]      Info            On entry, points to a buffer of at least *InfoSize bytes. On exit,\r
+                                  holds the user information. If the buffer is too small to hold the\r
+                                  information, then EFI_BUFFER_TOO_SMALL is returned and InfoSize is\r
+                                  updated to contain the number of bytes actually required.\r
+  @param[in]      InfoSize        On entry, points to the size of Info. On return, points to the size\r
+                                  of the user information.\r
 \r
   @retval EFI_SUCCESS             Information returned successfully.\r
   @retval EFI_ACCESS_DENIED       The record is exclusive.\r
-  @retval EFI_SECURITY_VIOLATION  The current user does not have permission to change the specified \r
+  @retval EFI_SECURITY_VIOLATION  The current user does not have permission to change the specified\r
                                   user profile or user information record.\r
-  @retval EFI_NOT_FOUND           User does not refer to a valid user profile or UserInfo does not  \r
+  @retval EFI_NOT_FOUND           User does not refer to a valid user profile or UserInfo does not\r
                                   refer to a valid user info handle.\r
-  @retval EFI_INVALID_PARAMETER   UserInfo is NULL or Info is NULL. \r
+  @retval EFI_INVALID_PARAMETER   UserInfo is NULL or Info is NULL.\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3549,7 +3552,7 @@ UserProfileSetInfo (
   if ((This == NULL) || (User == NULL) || (UserInfo == NULL) || (Info == NULL)) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check the right of the current user.\r
   //\r
@@ -3561,7 +3564,7 @@ UserProfileSetInfo (
         //\r
         return EFI_SECURITY_VIOLATION;\r
       }\r
-      \r
+\r
       if (!CheckCurrentUserAccessRight (EFI_USER_INFO_ACCESS_ENROLL_OTHERS)) {\r
         //\r
         // Can't add info into other profiles.\r
@@ -3581,14 +3584,14 @@ UserProfileSetInfo (
       }\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Modify user information.\r
   //\r
   Status = ModifyUserInfo (User, (EFI_USER_INFO **) UserInfo, Info, InfoSize);\r
   if (EFI_ERROR (Status)) {\r
     if (Status == EFI_ACCESS_DENIED) {\r
-      return EFI_ACCESS_DENIED;      \r
+      return EFI_ACCESS_DENIED;\r
     }\r
     return EFI_SECURITY_VIOLATION;\r
   }\r
@@ -3599,25 +3602,25 @@ UserProfileSetInfo (
 /**\r
   Called by credential provider to notify of information change.\r
 \r
-  This function allows the credential provider to notify the User Identity Manager when user status  \r
+  This function allows the credential provider to notify the User Identity Manager when user status\r
   has changed.\r
-  If the User Identity Manager doesn't support asynchronous changes in credentials, then this function \r
-  should return EFI_UNSUPPORTED. \r
-  If current user does not exist, and the credential provider can identify a user, then make the user \r
+  If the User Identity Manager doesn't support asynchronous changes in credentials, then this function\r
+  should return EFI_UNSUPPORTED.\r
+  If current user does not exist, and the credential provider can identify a user, then make the user\r
   to be current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.\r
-  If current user already exists, and the credential provider can identify another user, then switch \r
+  If current user already exists, and the credential provider can identify another user, then switch\r
   current user to the newly identified user, and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.\r
-  If current user was identified by this credential provider and now the credential provider cannot identify \r
+  If current user was identified by this credential provider and now the credential provider cannot identify\r
   current user, then logout current user and signal the EFI_EVENT_GROUP_USER_PROFILE_CHANGED event.\r
 \r
   @param[in] This          Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
-  @param[in] Changed       Handle on which is installed an instance of the EFI_USER_CREDENTIAL2_PROTOCOL \r
+  @param[in] Changed       Handle on which is installed an instance of the EFI_USER_CREDENTIAL2_PROTOCOL\r
                            where the user has changed.\r
 \r
   @retval EFI_SUCCESS      The User Identity Manager has handled the notification.\r
   @retval EFI_NOT_READY    The function was called while the specified credential provider was not selected.\r
   @retval EFI_UNSUPPORTED  The User Identity Manager doesn't support asynchronous notifications.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3625,7 +3628,7 @@ UserProfileNotify (
   IN CONST  EFI_USER_MANAGER_PROTOCOL           *This,\r
   IN        EFI_HANDLE                          Changed\r
   )\r
-{    \r
+{\r
   return EFI_UNSUPPORTED;\r
 }\r
 \r
@@ -3641,8 +3644,8 @@ UserProfileNotify (
 \r
   @retval EFI_SUCCESS        User information deleted successfully.\r
   @retval EFI_NOT_FOUND      User information record UserInfo does not exist in the user profile.\r
-  @retval EFI_ACCESS_DENIED  The current user does not have permission to delete this user information. \r
-  \r
+  @retval EFI_ACCESS_DENIED  The current user does not have permission to delete this user information.\r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3657,7 +3660,7 @@ UserProfileDeleteInfo (
   if (This == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  \r
+\r
   //\r
   // Check the right of the current user.\r
   //\r
@@ -3666,7 +3669,7 @@ UserProfileDeleteInfo (
       return EFI_ACCESS_DENIED;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Delete user information.\r
   //\r
@@ -3676,7 +3679,7 @@ UserProfileDeleteInfo (
       return EFI_NOT_FOUND;\r
     }\r
     return EFI_ACCESS_DENIED;\r
-  } \r
+  }\r
   return EFI_SUCCESS;\r
 }\r
 \r
@@ -3684,10 +3687,10 @@ UserProfileDeleteInfo (
 /**\r
   Enumerate user information of all the enrolled users on the platform.\r
 \r
-  This function returns the next user information record. To retrieve the first user   \r
-  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve \r
-  another user information record handle until there are no more, at which point UserInfo \r
-  will point to NULL. \r
+  This function returns the next user information record. To retrieve the first user\r
+  information record handle, point UserInfo at a NULL. Each subsequent call will retrieve\r
+  another user information record handle until there are no more, at which point UserInfo\r
+  will point to NULL.\r
 \r
   @param[in]      This           Points to this instance of the EFI_USER_MANAGER_PROTOCOL.\r
   @param[in]      User           Handle of the user whose information will be deleted.\r
@@ -3696,7 +3699,7 @@ UserProfileDeleteInfo (
   @retval EFI_SUCCESS            User information returned.\r
   @retval EFI_NOT_FOUND          No more user information found.\r
   @retval EFI_INVALID_PARAMETER  UserInfo is NULL.\r
-  \r
+\r
 **/\r
 EFI_STATUS\r
 EFIAPI\r
@@ -3754,7 +3757,7 @@ UserIdentifyManagerInit (
                   EFI_NATIVE_INTERFACE,\r
                   &gUserIdentifyManager\r
                   );\r
-  ASSERT_EFI_ERROR (Status);  \r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   LoadDeferredImageInit (ImageHandle);\r
   return EFI_SUCCESS;\r