VirtualBox

Ignore:
Timestamp:
Apr 6, 2018 6:16:30 PM (7 years ago)
Author:
vboxsync
Message:

VBoxSDS,VBoxSVC: Replaced the enviornment variable hack (VBOX_SERVICE_PROCESS) for preventing VBoxSDS and VBoxSVC from getting watched as clients, with a special export in the executable (Is_VirtualBox_service_process_like_VBoxSDS_And_VBoxSDS). Some cleanups here and there.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/svcmain.cpp

    r71317 r71716  
    516516void    VirtualBoxClassFactory::i_finishVBoxSvc()
    517517{
    518     LogRelFunc(("Finish work of VBoxSVc and VBoxSDS\n"));
     518    LogRelFunc(("Finish work of VBoxSVC and VBoxSDS\n"));
    519519    if (m_ptrVirtualBoxSDS.isNotNull())
    520520    {
     
    787787
    788788
    789 int SetServiceEnvFlag()
    790 {
    791     int rc = VINF_SUCCESS;
    792     if (!SetEnvironmentVariable(L"VBOX_SERVICE_PROCESS", L""))
    793     {
    794         rc = RTErrConvertFromWin32(GetLastError());
    795         LogRel(("Error: cannot set service environment flag:  %Rrs\n", rc));
    796     }
    797     return rc;
     789/** Special export that make VBoxProxyStub not register this process as one that
     790 * VBoxSDS should be watching.
     791 */
     792extern "C" DECLEXPORT(void) VBOXCALL Is_VirtualBox_service_process_like_VBoxSDS_And_VBoxSDS(void)
     793{
     794    /* never called, just need to be here */
    798795}
    799796
     
    834831     */
    835832    RTR3InitExe(argc, &argv, 0);
    836 
    837     SetServiceEnvFlag();
    838833
    839834    static const RTGETOPTDEF s_aOptions[] =
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