VirtualBox

Changeset 66279 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Mar 28, 2017 7:23:33 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
114203
Message:

Main/Frontends/Installer: bugref:3300: tabs, spaces, doxygen

File:
1 edited

Legend:

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

    r66274 r66279  
    10161016 * @returns Windows error code (errors are rememberd in the state).
    10171017 * @param   pState              The registry modifier state.
     1018 * @param   pszModuleName       The module name.
    10181019 * @param   pszAppId            The application UUID string.
    10191020 * @param   pszDescription      The description string.
    1020  * @param   bIsService          The application is windows service
    1021  */
    1022 LSTATUS VbpsRegisterAppId(
    1023     VBPSREGSTATE *pState,
    1024     const char *pszModuleName,
    1025     const char *pszAppId,
    1026     const char *pszDescription,
    1027     bool bIsService)
     1021 * @param   fIsService          The application is windows service
     1022 */
     1023LSTATUS VbpsRegisterAppId(VBPSREGSTATE *pState, const char *pszModuleName, const char *pszAppId,
     1024                          const char *pszDescription, bool fIsService)
    10281025{
    10291026    LSTATUS rc;
     
    10521049        rc = RegCreateKeyExW(pState->hkeyClassesRootDst, L"AppID", 0 /*Reserved*/, NULL /*pszClass*/, 0 /*fOptions*/,
    10531050                             pState->fSamBoth, NULL /*pSecAttr*/, &hkeyAppIds, NULL /*pdwDisposition*/);
    1054 
    10551051    else
    10561052    {
     
    10671063    }
    10681064
    1069         if (pState->fUpdate)
     1065    if (pState->fUpdate)
     1066    {
     1067        vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__);
     1068
     1069        if (fIsService)
    10701070        {
    1071             //HKEY hkeyApp;
    1072             HKEY hkeyServiceExe;
    1073    
    1074             vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__);
    1075    
    1076             if (bIsService)
    1077             {
    1078                 HKEY hkeyApp;
    1079 
    1080                 char szModule[MAX_PATH + 2];
    1081                 size_t len = RTStrNLen(pszModuleName, MAX_PATH);
    1082                 Assert(len);
    1083                 Assert(len < MAX_PATH);
    1084                 rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName);
    1085                 AssertRC(rc);
    1086                 szModule[len - 4] = '\0';
    1087 
    1088                 rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp);
    1089                 if (rc == ERROR_FILE_NOT_FOUND)
    1090                     return ERROR_SUCCESS;
    1091                 // create the value "Service" with the service name
    1092                 vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__);
    1093                 vbpsCloseKey(pState, hkeyApp, __LINE__);
    1094             }
    1095    
    1096             vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__);
    1097             rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe);
     1071            char szModule[MAX_PATH + 2];
     1072            size_t len = RTStrNLen(pszModuleName, MAX_PATH);
     1073            Assert(len);
     1074            Assert(len < MAX_PATH);
     1075            rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName);
     1076            AssertRC(rc);
     1077            szModule[len - 4] = '\0';
     1078
     1079            HKEY hkeyApp;
     1080            rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp);
    10981081            if (rc == ERROR_FILE_NOT_FOUND)
    10991082                return ERROR_SUCCESS;
    1100             vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__);
    1101             vbpsCloseKey(pState, hkeyServiceExe, __LINE__);
     1083            // create the value "Service" with the service name
     1084            vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__);
     1085            vbpsCloseKey(pState, hkeyApp, __LINE__);
    11021086        }
     1087
     1088        vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__);
     1089
     1090        HKEY hkeyServiceExe;
     1091        rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe);
     1092        if (rc == ERROR_FILE_NOT_FOUND)
     1093            return ERROR_SUCCESS;
     1094        vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__);
     1095        vbpsCloseKey(pState, hkeyServiceExe, __LINE__);
     1096    }
    11031097
    11041098    vbpsCloseKey(pState, hkeyAppIds, __LINE__);
     
    12881282
    12891283            /* AppID = pszAppId */
    1290             if(pszAppId && fQuoteIt)
     1284            if (pszAppId && fQuoteIt)
    12911285                vbpsSetRegValueAA(pState, hkeyClass, "AppID", pszAppId, __LINE__);
    12921286
     
    13391333    const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll";
    13401334    const char *pszLocalServer      = "VBoxSVC.exe";
    1341        
     1335
    13421336    VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", false);
    13431337
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