/* It is the caller's responsibility to save the old node, if desired, otherwise the reference to the old node will be lost. If NewNode is not NULL, set its parent to ObjectNode. */
EFI_STATUS EFIAPI AmlSetFixedArgument(IN AML_OBJECT_NODE *ObjectNode, IN EAML_PARSE_INDEX Index, IN AML_NODE_HEADER *NewNode)
/* It is the caller's responsibility to save the old node, if desired, otherwise the reference to the old node will be lost. If NewNode is not NULL, set its parent to ObjectNode. */
EFI_STATUS EFIAPI AmlSetFixedArgument(IN AML_OBJECT_NODE *ObjectNode, IN EAML_PARSE_INDEX Index, IN AML_NODE_HEADER *NewNode)
{
  if (IS_AML_OBJECT_NODE (ObjectNode)                                     &&
      (Index <= (EAML_PARSE_INDEX)AmlGetFixedArgumentCount (ObjectNode))  &&
      ((NewNode == NULL)                                                  ||
       IS_AML_OBJECT_NODE (NewNode)                                       ||
       IS_AML_DATA_NODE (NewNode)))
  {
    ObjectNode->FixedArgs[Index] = NewNode;
    if (NewNode != NULL) {
      NewNode->Parent = (AML_NODE_HEADER *)ObjectNode;
    }
    return EFI_SUCCESS;
  }
  ASSERT (0);
  return EFI_INVALID_PARAMETER;
}