Add BdsLibUserIdentify API in GenericBdsLib

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9897 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gdong1 2010-02-01 06:13:04 +00:00
parent 7d6cdbc8dd
commit 337661bb8c
3 changed files with 48 additions and 0 deletions

View File

@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _GENERIC_BDS_LIB_H_ #ifndef _GENERIC_BDS_LIB_H_
#define _GENERIC_BDS_LIB_H_ #define _GENERIC_BDS_LIB_H_
#include <Protocol/UserManager.h>
extern EFI_HANDLE mBdsImageHandle; extern EFI_HANDLE mBdsImageHandle;
/// ///
@ -952,6 +953,21 @@ BdsLibSaveMemoryTypeInformation (
VOID VOID
); );
/**
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
);
/** /**
This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid, This function checks if a Fv file device path is valid, according to a file GUID. If it is invalid,

View File

@ -1235,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);
}

View File

@ -113,6 +113,7 @@
gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES gEfiUgaDrawProtocolGuid |PcdUgaConsumeSupport # PROTOCOL SOMETIMES_CONSUMES
gEfiOEMBadgingProtocolGuid # PROTOCOL CONSUMES gEfiOEMBadgingProtocolGuid # PROTOCOL CONSUMES
gEfiHiiFontProtocolGuid # PROTOCOL CONSUMES gEfiHiiFontProtocolGuid # PROTOCOL CONSUMES
gEfiUserManagerProtocolGuid # PROTOCOL CONSUMES
[FeaturePcd] [FeaturePcd]
gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport