Set *ImageHandle to NULL when LoadImage() returns EFI_ACCESS_DENIED.

Signed-off-by: niruiyu
Reviewed-by: jljusten

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11783 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
niruiyu 2011-06-10 03:05:40 +00:00
parent e9668a606e
commit 31222776db
1 changed files with 7 additions and 1 deletions

View File

@ -1086,6 +1086,13 @@ CoreLoadImageCommon (
OriginalFilePath
);
if (EFI_ERROR (SecurityStatus) && SecurityStatus != EFI_SECURITY_VIOLATION) {
if (SecurityStatus == EFI_ACCESS_DENIED) {
//
// Image was not loaded because the platform policy prohibits the image from being loaded.
// It's the only place we could meet EFI_ACCESS_DENIED.
//
*ImageHandle = NULL;
}
Status = SecurityStatus;
Image = NULL;
goto Done;
@ -1237,7 +1244,6 @@ Done:
if (EFI_ERROR (Status)) {
if (Image != NULL) {
CoreUnloadAndCloseImage (Image, (BOOLEAN)(DstBuffer == 0));
*ImageHandle = NULL;
}
} else if (EFI_ERROR (SecurityStatus)) {
Status = SecurityStatus;