/* If InputSection is NULL, then ASSERT(). If OutputBuffer is NULL, then ASSERT(). If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). If AuthenticationStatus is NULL, then ASSERT(). */
RETURN_STATUS EFIAPI ExtractGuidedSectionDecode(IN CONST VOID *InputSection, OUT VOID **OutputBuffer, IN VOID *ScratchBuffer OPTIONAL, OUT UINT32 *AuthenticationStatus)
/* If InputSection is NULL, then ASSERT(). If OutputBuffer is NULL, then ASSERT(). If ScratchBuffer is NULL and this decode operation requires a scratch buffer, then ASSERT(). If AuthenticationStatus is NULL, then ASSERT(). */
RETURN_STATUS EFIAPI ExtractGuidedSectionDecode(IN CONST VOID *InputSection, OUT VOID **OutputBuffer, IN VOID *ScratchBuffer OPTIONAL, OUT UINT32 *AuthenticationStatus)
{
  UINT32    Index;
  EFI_GUID  *SectionDefinitionGuid;
  ASSERT (InputSection != NULL);
  ASSERT (OutputBuffer != NULL);
  ASSERT (AuthenticationStatus != NULL);
  if (IS_SECTION2 (InputSection)) {
    SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION2 *)InputSection)->SectionDefinitionGuid);
  } else {
    SectionDefinitionGuid = &(((EFI_GUID_DEFINED_SECTION *)InputSection)->SectionDefinitionGuid);
  }
  for (Index = 0; Index < mNumberOfExtractHandler; Index++) {
    if (CompareGuid (&mExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
      return mExtractDecodeHandlerTable[Index](
                                               InputSection,
                                               OutputBuffer,
                                               ScratchBuffer,
                                               AuthenticationStatus
                                               );
    }
  }
  return RETURN_UNSUPPORTED;
}