/* Return the child objects buffer from AML Handle's object child list. */
EFI_STATUS AmlGetChildFromObjectChildList(IN EFI_AML_HANDLE *AmlParentHandle, IN EFI_AML_HANDLE *AmlHandle, OUT VOID **Buffer)
/* Return the child objects buffer from AML Handle's object child list. */
EFI_STATUS AmlGetChildFromObjectChildList(IN EFI_AML_HANDLE *AmlParentHandle, IN EFI_AML_HANDLE *AmlHandle, OUT VOID **Buffer)
{
  EFI_STATUS  Status;
  UINT8       *CurrentBuffer;
  CurrentBuffer = NULL;
  if ((AmlParentHandle->AmlByteEncoding->Attribute & AML_HAS_CHILD_OBJ) == 0) {
    *Buffer = NULL;
    return EFI_SUCCESS;
  }
  Status = AmlGetOffsetAfterLastOption (AmlParentHandle, &CurrentBuffer);
  if (EFI_ERROR (Status)) {
    return EFI_INVALID_PARAMETER;
  }
  if ((UINTN)AmlHandle->Buffer < (UINTN)CurrentBuffer) {
  } else if ((UINTN)AmlHandle->Buffer + AmlHandle->Size < (UINTN)AmlParentHandle->Buffer + AmlParentHandle->Size) {
    CurrentBuffer = AmlHandle->Buffer + AmlHandle->Size;
  } else {
    *Buffer = NULL;
    return EFI_SUCCESS;
  }
  return AmlGetChildFromObjectBuffer (AmlParentHandle, CurrentBuffer, Buffer);
}