VirtualBox

Changeset 83405 in vbox for trunk/src/VBox/Additions


Ignore:
Timestamp:
Mar 25, 2020 12:45:01 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. bugref:9320

Location:
trunk/src/VBox/Additions/common/VBoxService
Files:
2 edited

Legend:

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

    r82968 r83405  
    216216             * Report features to the host.
    217217             */
    218             rc = VbglR3GuestCtrlReportFeatures(g_idControlSvcClient, VBOX_GUESTCTRL_GF_0_SET_SIZE, &g_fControlHostFeatures0);
     218            const uint64_t fGuestFeatures = VBOX_GUESTCTRL_GF_0_SET_SIZE
     219                                          | VBOX_GUESTCTRL_GF_0_PROCESS_ARGV0;
     220
     221            rc = VbglR3GuestCtrlReportFeatures(g_idControlSvcClient, fGuestFeatures, &g_fControlHostFeatures0);
    219222            if (RT_SUCCESS(rc))
    220223                VGSvcVerbose(3, "Host features: %#RX64\n", g_fControlHostFeatures0);
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlProcess.cpp

    r83400 r83405  
    10711071#endif
    10721072
    1073     /* HACK ALERT! Since we still don't allow the user to really specify the first
    1074                    argument separately from the executable image, we have to fudge
     1073    /* HACK ALERT! Older hosts (< VBox 6.1.x) did not allow the user to really specify the first
     1074                   argument separately from the executable image, so we have to fudge
    10751075                   a little in the unquoted argument case to deal with executables
    10761076                   containing spaces. */
    1077     /** @todo Fix the stupid host/guest protocol so the user can do this for us! */
    10781077    if (   !(fFlags & EXECUTEPROCESSFLAG_UNQUOTED_ARGS)
    10791078        || !strpbrk(pszArgv0, " \t\n\r")
     
    10941093        }
    10951094    }
     1095
    10961096    if (RT_SUCCESS(rc))
    10971097    {
     
    13421342    if (RT_SUCCESS(rc))
    13431343    {
     1344        const char *pszArgv0 = RT_BOOL(g_fControlHostFeatures0 & VBOX_GUESTCTRL_HF_0_PROCESS_ARGV0)
     1345                             ? papszArgs[0] : pszExec;
    13441346        char **papszArgsExp;
    1345         /** @todo r-bird: pszExec != argv[0]! When are you going to get that?!? How many
    1346          * times does this need to be pointed out?  HOST/GUEST INTERFACE IS MISDESIGNED! */
    1347         rc = vgsvcGstCtrlProcessAllocateArgv(pszExec /* Always use the unmodified executable name as argv0. */,
    1348                                              papszArgs /* Append the rest of the argument vector (if any). */,
     1347        rc = vgsvcGstCtrlProcessAllocateArgv(pszArgv0, papszArgs,
    13491348                                             fFlags, &papszArgsExp);
    13501349        if (RT_FAILURE(rc))
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