VirtualBox

Changeset 55530 in vbox


Ignore:
Timestamp:
Apr 29, 2015 5:40:40 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99889
Message:

RTProcCreate,RTProcCreateEx: Added RTPROC_FLAGS_UNQUOTED_ARGS for allowing working around for windows programs with their own brilliant ideas about command line parsing.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/process.h

    r51770 r55530  
    206206/** Search the PATH for the executable.  */
    207207#define RTPROC_FLAGS_SEARCH_PATH            RT_BIT(6)
    208 
     208/** Don't quote and escape arguments on Windows and similar platforms where a
     209 * command line is passed to the child process instead of an argument vector,
     210 * just join up argv with a space between each.  Ignored on platforms
     211 * passing argument the vector. */
     212#define RTPROC_FLAGS_UNQUOTED_ARGS          RT_BIT(7)
     213/** Valid flag mask. */
     214#define RTPROC_FLAGS_VALID_MASK             UINT32_C(0xff)
    209215/** @}  */
    210216
  • trunk/src/VBox/Runtime/r3/posix/process-creation-posix.cpp

    r51192 r55530  
    304304    AssertPtrReturn(pszExec, VERR_INVALID_POINTER);
    305305    AssertReturn(*pszExec, VERR_INVALID_PARAMETER);
    306     AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_HIDDEN | RTPROC_FLAGS_SERVICE | RTPROC_FLAGS_SAME_CONTRACT | RTPROC_FLAGS_NO_PROFILE | RTPROC_FLAGS_SEARCH_PATH)), VERR_INVALID_PARAMETER);
     306    AssertReturn(!(fFlags & ~RTPROC_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    307307    AssertReturn(!(fFlags & RTPROC_FLAGS_DETACHED) || !phProcess, VERR_INVALID_PARAMETER);
    308308    AssertReturn(hEnv != NIL_RTENV, VERR_INVALID_PARAMETER);
  • trunk/src/VBox/Runtime/r3/win/process-win.cpp

    r55126 r55530  
    10841084    AssertPtrReturn(pszExec, VERR_INVALID_POINTER);
    10851085    AssertReturn(*pszExec, VERR_INVALID_PARAMETER);
    1086     AssertReturn(!(fFlags & ~(RTPROC_FLAGS_DETACHED | RTPROC_FLAGS_HIDDEN | RTPROC_FLAGS_SERVICE | RTPROC_FLAGS_SAME_CONTRACT
    1087                               | RTPROC_FLAGS_NO_PROFILE | RTPROC_FLAGS_NO_WINDOW | RTPROC_FLAGS_SEARCH_PATH)),
    1088                  VERR_INVALID_PARAMETER);
     1086    AssertReturn(!(fFlags & ~RTPROC_FLAGS_VALID_MASK), VERR_INVALID_PARAMETER);
    10891087    AssertReturn(!(fFlags & RTPROC_FLAGS_DETACHED) || !phProcess, VERR_INVALID_PARAMETER);
    10901088    AssertReturn(hEnv != NIL_RTENV, VERR_INVALID_PARAMETER);
     
    12181216    {
    12191217        PRTUTF16 pwszCmdLine;
    1220         rc = RTGetOptArgvToUtf16String(&pwszCmdLine, papszArgs, RTGETOPTARGV_CNV_QUOTE_MS_CRT);
     1218        rc = RTGetOptArgvToUtf16String(&pwszCmdLine, papszArgs,
     1219                                       !(fFlags & RTPROC_FLAGS_UNQUOTED_ARGS)
     1220                                       ? RTGETOPTARGV_CNV_QUOTE_MS_CRT : RTGETOPTARGV_CNV_UNQUOTED);
    12211221        if (RT_SUCCESS(rc))
    12221222        {
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette