VirtualBox

Changeset 33272 in vbox


Ignore:
Timestamp:
Oct 20, 2010 5:33:26 PM (14 years ago)
Author:
vboxsync
Message:

VBoxService/Toolbox: Added special execution command ("VBoxService" or argv[0]) for independent VBoxService location / toolbox usage.

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

Legend:

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

    r33247 r33272  
    527527#endif
    528528
     529    g_pszProgName = RTPathFilename(argv[0]);
     530
    529531#ifdef VBOXSERVICE_TOOLBOX
    530532    /*
     
    540542     * Do pre-init of services.
    541543     */
    542     g_pszProgName = RTPathFilename(argv[0]);
    543544    for (unsigned j = 0; j < RT_ELEMENTS(g_aServices); j++)
    544545    {
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r33247 r33272  
    10731073    }
    10741074    else
     1075#endif /* RT_OS_WINDOWS */
     1076#ifdef VBOXSERVICE_TOOLBOX
     1077    /*
     1078     * Use the built-in toolbox of VBoxService?
     1079     */
     1080    if (   (g_pszProgName && stricmp(pszExec, g_pszProgName) == 0)
     1081        || stricmp(pszExec, "VBoxService"))
     1082    {
     1083        /* Search the path of our executable. */
     1084        char szVBoxService[RTPATH_MAX];
     1085        if (RTProcGetExecutableName(szVBoxService, sizeof(szVBoxService)))
     1086        {
     1087            rc = RTProcCreateEx(szVBoxService, papszArgs, hEnv, fFlags,
     1088                                phStdIn, phStdOut, phStdErr, pszAsUser,
     1089                                pszPassword, phProcess);
     1090        }
     1091        else
     1092            rc = VERR_NOT_FOUND;
     1093    }
     1094    else
    10751095    {
    10761096#endif
     
    10791099                            phStdIn, phStdOut, phStdErr, pszAsUser,
    10801100                            pszPassword, phProcess);
    1081 #ifdef RT_OS_WINDOWS
    1082     }
    1083 #endif
     1101#ifdef VBOXSERVICE_TOOLBOX
     1102    }
     1103#endif /* VBOXSERVICE_TOOLBOX */
    10841104    return rc;
    10851105}
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