/* Worker function. Determine if the input stream:child matches the input type. */
BOOLEAN ChildIsType(IN CORE_SECTION_STREAM_NODE *Stream, IN CORE_SECTION_CHILD_NODE *Child, IN EFI_SECTION_TYPE SearchType, IN EFI_GUID *SectionDefinitionGuid)
/* Worker function. Determine if the input stream:child matches the input type. */
BOOLEAN ChildIsType(IN CORE_SECTION_STREAM_NODE *Stream, IN CORE_SECTION_CHILD_NODE *Child, IN EFI_SECTION_TYPE SearchType, IN EFI_GUID *SectionDefinitionGuid)
{
  EFI_GUID_DEFINED_SECTION  *GuidedSection;
  if (SearchType == EFI_SECTION_ALL) {
    return TRUE;
  }
  if (Child->Type != SearchType) {
    return FALSE;
  }
  if ((SearchType != EFI_SECTION_GUID_DEFINED) || (SectionDefinitionGuid == NULL)) {
    return TRUE;
  }
  GuidedSection = (EFI_GUID_DEFINED_SECTION *)(Stream->StreamBuffer + Child->OffsetInStream);
  if (IS_SECTION2 (GuidedSection)) {
    return CompareGuid (&(((EFI_GUID_DEFINED_SECTION2 *)GuidedSection)->SectionDefinitionGuid), SectionDefinitionGuid);
  } else {
    return CompareGuid (&GuidedSection->SectionDefinitionGuid, SectionDefinitionGuid);
  }
}