mirror of https://github.com/acidanthera/audk.git
Enhance FV2.ReadSection() to read GUIDED section raw data when its extraction guided protocol doesn’t exist.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10703 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
1d6ee65f82
commit
ab58ce18aa
|
@ -528,8 +528,9 @@ CreateProtocolNotifyEvent (
|
|||
}
|
||||
|
||||
/**
|
||||
RPN callback function. Removes a stale section stream and re-initializes it
|
||||
with an updated AuthenticationStatus.
|
||||
RPN callback function.
|
||||
1. Initialize the section stream when the GUIDED_SECTION_EXTRACTION_PROTOCOL is installed.
|
||||
2. Removes a stale section stream and re-initializes it with an updated AuthenticationStatus.
|
||||
|
||||
@param Event The event that fired
|
||||
@param RpnContext A pointer to the context that allows us to identify
|
||||
|
@ -552,11 +553,14 @@ NotifyGuidedExtraction (
|
|||
RPN_EVENT_CONTEXT *Context;
|
||||
|
||||
Context = RpnContext;
|
||||
|
||||
Status = EFI_SUCCESS;
|
||||
if (Context->ChildNode->EncapsulatedStreamHandle != NULL_STREAM_HANDLE) {
|
||||
Status = CloseSectionStream (&mSectionExtraction, Context->ChildNode->EncapsulatedStreamHandle);
|
||||
}
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// The stream closed successfully, so re-open the stream with correct AuthenticationStatus
|
||||
// The stream is not initialized, open it.
|
||||
// Or the stream closed successfully, so re-open the stream with correct AuthenticationStatus.
|
||||
//
|
||||
|
||||
GuidedHeader = (EFI_GUID_DEFINED_SECTION *)
|
||||
|
@ -839,12 +843,12 @@ CreateChildNode (
|
|||
//
|
||||
if ((GuidedHeader->Attributes & EFI_GUIDED_SECTION_PROCESSING_REQUIRED) == EFI_GUIDED_SECTION_PROCESSING_REQUIRED) {
|
||||
//
|
||||
// If the section REQUIRES an extraction protocol, then we're toast
|
||||
// If the section REQUIRES an extraction protocol, register for RPN
|
||||
// when the required GUIDed extraction protocol becomes available.
|
||||
//
|
||||
FreePool (*ChildNode);
|
||||
return EFI_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
AuthenticationStatus = 0;
|
||||
CreateGuidedExtractionRpnEvent (Stream, Node);
|
||||
} else {
|
||||
//
|
||||
// Figure out the proper authentication status
|
||||
//
|
||||
|
@ -880,6 +884,7 @@ CreateChildNode (
|
|||
return Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ((AuthenticationStatus & EFI_LOCAL_AUTH_STATUS_ALL) ==
|
||||
(EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED | EFI_LOCAL_AUTH_STATUS_NOT_TESTED)) {
|
||||
|
@ -1026,6 +1031,13 @@ FindChildNode (
|
|||
} else {
|
||||
ErrorStatus = Status;
|
||||
}
|
||||
} else if ((CurrentChildNode->Type == EFI_SECTION_GUID_DEFINED) && (SearchType != EFI_SECTION_GUID_DEFINED)) {
|
||||
//
|
||||
// When Node Type is GUIDED section, but Node has no encapsulated data, Node data should not be parsed
|
||||
// because a required GUIDED section extraction protocol does not exist.
|
||||
// If SearchType is not GUIDED section, EFI_PROTOCOL_ERROR should return.
|
||||
//
|
||||
ErrorStatus = EFI_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
if (!IsNodeAtEnd (&SourceStream->Children, &CurrentChildNode->Link)) {
|
||||
|
|
Loading…
Reference in New Issue