/* the resultant list is a double NULL terminated list of NULL terminated strings. */
EFI_STATUS CopyListOfCommandNames(IN OUT CHAR16 **DestList, IN OUT UINTN *DestSize, IN CONST COMMAND_LIST *SourceList)
/* the resultant list is a double NULL terminated list of NULL terminated strings. */
EFI_STATUS CopyListOfCommandNames(IN OUT CHAR16 **DestList, IN OUT UINTN *DestSize, IN CONST COMMAND_LIST *SourceList)
{
  CONST COMMAND_LIST  *Node;
  for ( Node = (COMMAND_LIST *)GetFirstNode (&SourceList->Link)
        ; SourceList != NULL && !IsListEmpty (&SourceList->Link) && !IsNull (&SourceList->Link, &Node->Link)
        ; Node = (COMMAND_LIST *)GetNextNode (&SourceList->Link, &Node->Link)
        )
  {
    LexicalInsertIntoList (DestList, DestSize, Node->CommandString);
  }
  return (EFI_SUCCESS);
}