/** @file\r
The functions to delete a user profile.\r
\r
-Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2011, 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
EFI_STATUS Status;\r
EFI_USER_PROFILE_HANDLE User;\r
EFI_INPUT_KEY Key;\r
+ EFI_USER_INFO_HANDLE UserInfo;\r
+ EFI_USER_INFO *Info;\r
+ UINTN InfoSize;\r
\r
//\r
// Find specified user profile and delete it.\r
}\r
\r
if (UserIndex == 1) {\r
+ //\r
+ // Get the identification policy.\r
+ //\r
+ Status = FindInfoByType (User, EFI_USER_INFO_IDENTITY_POLICY_RECORD, &UserInfo);\r
+ if (EFI_ERROR (Status)) {\r
+ goto Done;\r
+ }\r
+\r
+ InfoSize = 0;\r
+ Info = NULL;\r
+ Status = mUserManager->GetInfo (mUserManager, User, UserInfo, Info, &InfoSize);\r
+ if (Status == EFI_BUFFER_TOO_SMALL) {\r
+ Info = AllocateZeroPool (InfoSize);\r
+ if (Info == NULL) {\r
+ goto Done;\r
+ }\r
+ Status = mUserManager->GetInfo (mUserManager, User, UserInfo, Info, &InfoSize);\r
+ }\r
+\r
+ //\r
+ // Delete the user on the credential providers by its identification policy.\r
+ //\r
+ ASSERT (Info != NULL);\r
+ DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);\r
+ FreePool (Info);\r
+ \r
Status = mUserManager->Delete (mUserManager, User);\r
if (EFI_ERROR (Status)) {\r
goto Done;\r
\r
HiiUpdateForm (\r
mCallbackInfo->HiiHandle, // HII handle\r
- &mUserProfileManagerGuid, // Formset GUID\r
+ &gUserProfileManagerGuid, // Formset GUID\r
FORMID_DEL_USER, // Form ID\r
StartOpCodeHandle, // Label for where to insert opcodes\r
EndOpCodeHandle // Replace data\r