VirtualBox

Ignore:
Timestamp:
Oct 17, 2016 10:17:49 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111313
Message:

Reverted r111300 and subsequent changes since the fix is to use RTLOCALIPC_FLAGS_NATIVE_NAME.

Location:
trunk/src/VBox/Additions/WINNT/VBoxTray
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp

    r64285 r64291  
    175175}
    176176
    177 
    178177/**
    179178 * Initializes the IPC communication.
     
    196195    if (RT_SUCCESS(rc))
    197196    {
    198         char szUserName[512];
     197        char szPipeName[512 + sizeof(VBOXTRAY_IPC_PIPE_PREFIX)];
     198        strcpy(szPipeName, VBOXTRAY_IPC_PIPE_PREFIX);
    199199        rc = RTProcQueryUsername(NIL_RTPROCESS,
    200                                  szUserName,
    201                                  sizeof(szUserName),
     200                                 &szPipeName[sizeof(VBOXTRAY_IPC_PIPE_PREFIX) - 1],
     201                                 sizeof(szPipeName) - sizeof(VBOXTRAY_IPC_PIPE_PREFIX) + 1,
    202202                                 NULL /*pcbUser*/);
    203203        if (RT_SUCCESS(rc))
    204204        {
    205             char szPipeName[80];
    206             size_t cbPipeName = sizeof(szPipeName);
    207             rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, szUserName, szPipeName, &cbPipeName);
     205            rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
    208206            if (RT_SUCCESS(rc))
    209207            {
    210 
    211                 rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
    212                 if (RT_SUCCESS(rc))
    213                 {
    214                     pCtx->pEnv = pEnv;
    215                     RTListInit(&pCtx->SessionList);
    216 
    217                     *ppInstance = pCtx;
    218 
    219                     /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
    220                     g_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
    221                         RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
    222 
    223                     LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
    224                     return VINF_SUCCESS;
    225                 }
    226 
    227             }
     208                pCtx->pEnv = pEnv;
     209                RTListInit(&pCtx->SessionList);
     210
     211                *ppInstance = pCtx;
     212
     213                /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
     214                g_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
     215                    RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
     216
     217                LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
     218                return VINF_SUCCESS;
     219            }
     220
    228221        }
    229222
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp

    r64285 r64291  
    308308            LogRel(("Failed to initialize service '%s', rc=%Rrc\n", pSvc->pDesc->pszName, rc2));
    309309            if (rc2 == VERR_NOT_SUPPORTED)
     310            {
    310311                LogRel(("Service '%s' is not supported on this system\n", pSvc->pDesc->pszName));
    311             rc2 = VINF_SUCCESS;
     312                rc2 = VINF_SUCCESS;
     313            }
    312314            /* Keep going. */
    313315        }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette