/* If OldArgv or OldArgc is NULL then that value is not returned. */
EFI_STATUS UpdateArgcArgv(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN CONST CHAR16 *NewCommandLine, IN SHELL_OPERATION_TYPES Type, OUT CHAR16 ***OldArgv OPTIONAL, OUT UINTN *OldArgc OPTIONAL)
/* If OldArgv or OldArgc is NULL then that value is not returned. */
EFI_STATUS UpdateArgcArgv(IN OUT EFI_SHELL_PARAMETERS_PROTOCOL *ShellParameters, IN CONST CHAR16 *NewCommandLine, IN SHELL_OPERATION_TYPES Type, OUT CHAR16 ***OldArgv OPTIONAL, OUT UINTN *OldArgc OPTIONAL)
{
  BOOLEAN  StripParamQuotation;
  ASSERT (ShellParameters != NULL);
  StripParamQuotation = TRUE;
  if (OldArgc != NULL) {
    *OldArgc = ShellParameters->Argc;
  }
  if (OldArgc != NULL) {
    *OldArgv = ShellParameters->Argv;
  }
  if (Type == Script_File_Name) {
    StripParamQuotation = FALSE;
  }
  return ParseCommandLineToArgs (
           NewCommandLine,
           StripParamQuotation,
           &(ShellParameters->Argv),
           &(ShellParameters->Argc)
           );
}