Enhance drivers for sanity check and coding style alignment.
Signed-off-by: gdong1 Reviewed-by: ydong10 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12622 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -167,7 +167,7 @@ SaveAccessPolicy (
|
|||||||
//
|
//
|
||||||
// Save access policy.
|
// Save access policy.
|
||||||
//
|
//
|
||||||
if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0)) {
|
if (mUserInfo.AccessPolicyModified && (mUserInfo.AccessPolicyLen > 0) && (mUserInfo.AccessPolicy != NULL)) {
|
||||||
Info = AllocateZeroPool (sizeof (EFI_USER_INFO) + mUserInfo.AccessPolicyLen);
|
Info = AllocateZeroPool (sizeof (EFI_USER_INFO) + mUserInfo.AccessPolicyLen);
|
||||||
if (Info == NULL) {
|
if (Info == NULL) {
|
||||||
return ;
|
return ;
|
||||||
|
@ -58,7 +58,7 @@ ProviderAlreadyInPolicy (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Add or delete the user's credential record in the provider.
|
Add the user's credential record in the provider.
|
||||||
|
|
||||||
@param[in] ProviderGuid Point to credential provider guid.
|
@param[in] ProviderGuid Point to credential provider guid.
|
||||||
@param[in] User Points to user profile.
|
@param[in] User Points to user profile.
|
||||||
@ -157,17 +157,13 @@ DeleteCredentialFromProviders (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Remove the provider in FindIdentity from the user identification information record.
|
Remove the provider specified by Offset from the new user identification record.
|
||||||
|
|
||||||
@param[in, out] NewInfo On entry, points to the user information to remove provider.
|
@param[in] IdentityPolicy Point to user identity item in new identification policy.
|
||||||
On return, points to the user information the provider is removed.
|
@param[in] Offset The item offset in the new identification policy.
|
||||||
@param[in] FindIdentity Point to the user identity policy.
|
|
||||||
|
|
||||||
@retval TRUE The provider is removed successfully.
|
|
||||||
@retval FALSE Fail to remove the provider.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
BOOLEAN
|
VOID
|
||||||
DeleteProviderFromPolicy (
|
DeleteProviderFromPolicy (
|
||||||
IN EFI_USER_INFO_IDENTITY_POLICY *IdentityPolicy,
|
IN EFI_USER_INFO_IDENTITY_POLICY *IdentityPolicy,
|
||||||
IN UINTN Offset
|
IN UINTN Offset
|
||||||
@ -184,7 +180,7 @@ DeleteProviderFromPolicy (
|
|||||||
IdentityPolicy->Type = EFI_USER_INFO_IDENTITY_TRUE;
|
IdentityPolicy->Type = EFI_USER_INFO_IDENTITY_TRUE;
|
||||||
IdentityPolicy->Length = sizeof (EFI_USER_INFO_IDENTITY_POLICY);
|
IdentityPolicy->Length = sizeof (EFI_USER_INFO_IDENTITY_POLICY);
|
||||||
mUserInfo.NewIdentityPolicyLen = IdentityPolicy->Length;
|
mUserInfo.NewIdentityPolicyLen = IdentityPolicy->Length;
|
||||||
return TRUE;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteLen = IdentityPolicy->Length + sizeof(EFI_USER_INFO_IDENTITY_POLICY);
|
DeleteLen = IdentityPolicy->Length + sizeof(EFI_USER_INFO_IDENTITY_POLICY);
|
||||||
@ -196,17 +192,19 @@ DeleteProviderFromPolicy (
|
|||||||
CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);
|
CopyMem ((UINT8 *) IdentityPolicy, (UINT8 *) IdentityPolicy + DeleteLen, RemainingLen);
|
||||||
}
|
}
|
||||||
mUserInfo.NewIdentityPolicyLen -= DeleteLen;
|
mUserInfo.NewIdentityPolicyLen -= DeleteLen;
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Update the mUserInfo.NewIdentityPolicy, and UI when 'add option' is pressed.
|
Add a new provider to the mUserInfo.NewIdentityPolicy.
|
||||||
|
|
||||||
|
It is invoked when 'add option' in UI is pressed.
|
||||||
|
|
||||||
|
@param[in] NewGuid Points to the credential provider guid.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
AddProviderToPolicy (
|
AddProviderToPolicy (
|
||||||
IN EFI_GUID *NewGuid
|
IN EFI_GUID *NewGuid
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -489,7 +487,7 @@ SaveIdentityPolicy (
|
|||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
AddIdentityPolicyItem (
|
AddIdentityPolicyItem (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -229,6 +229,7 @@ DeleteUser (
|
|||||||
//
|
//
|
||||||
// Delete the user on the credential providers by its identification policy.
|
// Delete the user on the credential providers by its identification policy.
|
||||||
//
|
//
|
||||||
|
ASSERT (Info != NULL);
|
||||||
DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);
|
DeleteCredentialFromProviders ((UINT8 *)(Info + 1), Info->InfoSize - sizeof (EFI_USER_INFO), User);
|
||||||
FreePool (Info);
|
FreePool (Info);
|
||||||
|
|
||||||
|
@ -85,7 +85,6 @@ InstallSecureBootConfigForm (
|
|||||||
@param[in, out] PrivateData Points to SecureBoot configuration private data.
|
@param[in, out] PrivateData Points to SecureBoot configuration private data.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
UninstallSecureBootConfigForm (
|
UninstallSecureBootConfigForm (
|
||||||
IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData
|
IN OUT SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData
|
||||||
|
Reference in New Issue
Block a user