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