VirtualBox

Changeset 71139 in vbox for trunk/src/VBox/Main/src-all/win


Ignore:
Timestamp:
Feb 27, 2018 5:48:13 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
121027
Message:

Main/VBoxSVC,VBoxSDS: fix for ​bugref:8161: added API client list interface to VBoxSDS, forcibly closes all VirtualBox clients process on Windows 7 at system shutdown. Added functionality to close VBoxSDS and VBoxSVC services automatically if the API client finished unexpectedly (crashed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r70240 r71139  
    4141#include <iprt/uuid.h>
    4242#include <iprt/utf16.h>
     43#include "RpcChannelHook.h"
    4344
    4445
     
    147148};
    148149
     150BOOL IsVBoxServiceProcess(void)
     151{
     152    if (GetEnvironmentVariable(L"VBOX_SERVICE_PROCESS", NULL, 0) == 0)
     153    {
     154        int res = GetLastError();
     155        if (res != ERROR_ENVVAR_NOT_FOUND)
     156            LogRel(("Error: cannot get service environment variable: %Rrwa\n", res));
     157        return false;
     158    }
     159    return true;
     160}
     161
    149162
    150163/**
     
    171184            RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    172185            Log12(("VBoxProxyStub[%u]/DllMain: DLL_PROCESS_ATTACH\n", GetCurrentProcessId()));
     186
     187            /* Install RPC channel hook to intercept a moment just after VirtualBox object activation.
     188               It's reports to VBoxSDS that a new VirtualBox API client started. */
     189            if(!IsVBoxServiceProcess())
     190                SetupClientRpcChannelHook();
    173191
    174192#ifdef VBOX_STRICT
     
    13461364    VbpsRegisterClassId(pState, &CLSID_VirtualBoxSDS, "VirtualBoxSDS Class", pszSdsAppId, "VirtualBox.VirtualBoxSDS", ".1",
    13471365                        &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszSdsExe, NULL /*N/A*/);
     1366
     1367    VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxClientList.1", "VirtualBoxClientList Class", &CLSID_VirtualBoxClientList, NULL);
     1368    VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxClientList", "VirtualBoxClientList Class", &CLSID_VirtualBoxClientList, ".1");
     1369    VbpsRegisterClassId(pState, &CLSID_VirtualBoxClientList, "VirtualBoxClientList Class", pszSdsAppId, "VirtualBox.VirtualBoxClientList", ".1",
     1370        &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszSdsExe, NULL /*N/A*/);
    13481371#endif
    13491372}
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