VirtualBox

Changeset 83609 in vbox for trunk/src


Ignore:
Timestamp:
Apr 7, 2020 12:18:48 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
137014
Message:

Guest Control/VBoxService: Resolved another @todo: Added ability for guest processes to use argv[0] independently of the actual execution command (follow-up to r137005)). ​​​​bugref:9320

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp

    r83602 r83609  
    13661366        AssertPtrReturn(pcszArgv0, VERR_INVALID_POINTER); /* Paranoia. */
    13671367
    1368         const uint32_t uArgvIdx = (papszArgs[0] && papszArgs[1]) ? 1 : 0;
     1368        const uint32_t uArgvIdx = pcszArgv0 == papszArgs[0] ? 1 : 0;
    13691369
    13701370        VGSvcVerbose(3, "vgsvcGstCtrlProcessCreateProcess: fHasArgv0=%RTbool, pcszArgv0=%p, uArgvIdx=%RU32, "
     
    15381538                                RTGETOPTARGV_CNV_QUOTE_BOURNE_SH, NULL);
    15391539
     1540    VGSvcVerbose(3, "vgsvcGstCtrlProcessProcessWorker: cArgs = %d\n", cArgs);
    15401541#ifdef VBOX_STRICT
     1542    for (int i = 0; i < cArgs; i++)
     1543        VGSvcVerbose(3, "vgsvcGstCtrlProcessProcessWorker: papszArgs[%d] = '%s'\n", i, papszArgs[i] ? papszArgs[i] : "<NULL>");
     1544
    15411545    const bool fHasArgv0    = RT_BOOL(g_fControlHostFeatures0 & VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0); RT_NOREF(fHasArgv0);
    1542     const int  cArgsToCheck = cArgs; /** @ŧodo Do we still need to do this?    + (fHasArgv0 ? 0 : 1); */
     1546    const int  cArgsToCheck = cArgs + (fHasArgv0 ? 0 : 1);
    15431547
    15441548    /* Did we get the same result?
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