Changeset 64291 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Oct 17, 2016 10:17:49 AM (8 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp
r64285 r64291 34 34 #include <iprt/mem.h> 35 35 #include <iprt/string.h> 36 #include <iprt/localipc.h>37 36 38 37 /* Required structures/defines of VBoxTray. */ … … 153 152 if (RT_SUCCESS(rc)) 154 153 { 155 char szPipeName[80]; 156 size_t cbPipeName = sizeof(szPipeName); 157 rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, pszUserName, szPipeName, &cbPipeName); 158 if (RT_SUCCESS(rc)) 154 char szPipeName[255]; 155 if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", 156 VBOXTRAY_IPC_PIPE_PREFIX, pszUserName)) 159 157 { 160 158 rc = RTLocalIpcSessionConnect(phSession, szPipeName, 0 /* Flags */); 161 159 } 160 else 161 rc = VERR_NO_MEMORY; 162 162 163 163 RTStrFree(pszUserName); -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp
r64285 r64291 175 175 } 176 176 177 178 177 /** 179 178 * Initializes the IPC communication. … … 196 195 if (RT_SUCCESS(rc)) 197 196 { 198 char szUserName[512]; 197 char szPipeName[512 + sizeof(VBOXTRAY_IPC_PIPE_PREFIX)]; 198 strcpy(szPipeName, VBOXTRAY_IPC_PIPE_PREFIX); 199 199 rc = RTProcQueryUsername(NIL_RTPROCESS, 200 szUserName,201 sizeof(sz UserName),200 &szPipeName[sizeof(VBOXTRAY_IPC_PIPE_PREFIX) - 1], 201 sizeof(szPipeName) - sizeof(VBOXTRAY_IPC_PIPE_PREFIX) + 1, 202 202 NULL /*pcbUser*/); 203 203 if (RT_SUCCESS(rc)) 204 204 { 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*/); 208 206 if (RT_SUCCESS(rc)) 209 207 { 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 228 221 } 229 222 -
trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
r64285 r64291 308 308 LogRel(("Failed to initialize service '%s', rc=%Rrc\n", pSvc->pDesc->pszName, rc2)); 309 309 if (rc2 == VERR_NOT_SUPPORTED) 310 { 310 311 LogRel(("Service '%s' is not supported on this system\n", pSvc->pDesc->pszName)); 311 rc2 = VINF_SUCCESS; 312 rc2 = VINF_SUCCESS; 313 } 312 314 /* Keep going. */ 313 315 } -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
r64285 r64291 39 39 #include <iprt/time.h> 40 40 #include <iprt/thread.h> 41 42 41 43 42 #include <VBox/VBoxGuestLib.h> … … 956 955 957 956 int rc = VINF_SUCCESS; 958 char szPipeName[80]; 959 size_t cbPipeName = sizeof(szPipeName); 960 rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, pszUser, szPipeName, &cbPipeName); 957 958 char szPipeName[255]; 961 959 /** @todo r=bird: Pointless if. */ 962 if (RT _SUCCESS(rc))960 if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", VBOXTRAY_IPC_PIPE_PREFIX, pszUser)) 963 961 { 964 962 bool fReportToHost = false;
Note:
See TracChangeset
for help on using the changeset viewer.