VirtualBox

Changeset 83419 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Mar 25, 2020 4:49:34 PM (5 years ago)
Author:
vboxsync
Message:

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

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r83405 r83419  
    4848
    4949#include <memory> /* For auto_ptr. */
     50#include <algorithm> /* For std::rotate. */
    5051
    5152#include <iprt/asm.h>
     
    10811082        AssertPtr(pGuest);
    10821083
     1084        const uint64_t fGuestControlFeatures0 = pGuest->i_getGuestControlFeatures0();
     1085
    10831086        /* If the Guest Additions don't support using argv[0] correctly (< 6.1.x), don't supply it. */
    1084         if (!RT_BOOL(pGuest->i_getGuestControlFeatures0() & VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0))
     1087        if (!(fGuestControlFeatures0 & VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0))
    10851088            vrc = RTGetOptArgvToString(&pszArgs, papszArgv + 1, RTGETOPTARGV_CNV_QUOTE_BOURNE_SH);
    10861089        else /* ... else send the whole argv, including argv[0]. */
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r83336 r83419  
    41274127    procInfo.mExecutable = pszExecutable;
    41284128    if (aArguments.size())
     4129    {
    41294130        for (size_t i = 0; i < aArguments.size(); i++)
    41304131            procInfo.mArguments.push_back(aArguments[i]);
     4132    }
     4133    else /* If no arguments were given, add the executable as argv[0] by default. */
     4134        procInfo.mArguments.push_back(procInfo.mExecutable);
    41314135
    41324136    /* Combine the environment changes associated with the ones passed in by
Note: See TracChangeset for help on using the changeset viewer.

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