Changeset 64291 in vbox
- Timestamp:
- Oct 17, 2016 10:17:49 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 7 edited
-
include/iprt/localipc.h (modified) (1 diff)
-
include/iprt/mangling.h (modified) (1 diff)
-
src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp (modified) (2 diffs)
-
src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp (modified) (2 diffs)
-
src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp (modified) (1 diff)
-
src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp (modified) (2 diffs)
-
src/VBox/Runtime/Makefile.kmk (modified) (1 diff)
-
src/VBox/Runtime/r3/localipc.cpp (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/localipc.h
r64288 r64291 317 317 RTDECL(int) RTLocalIpcSessionQueryGroupId(RTLOCALIPCSESSION hSession, PRTGID pGid); 318 318 319 /**320 * Make the IPC pipe name unique for user321 * in a form like 'VBoxTrayIPC-6a4500cb7c726949'322 *323 * @returns IPRT status code.324 * @retval VINF_SUCCESS and *pcbDst if pipe name created successfully.325 * @retval VERR_INVALID_PARAMETER in case of invalid parameter value.326 * @retval VERR_BUFFER_OVERFLOW if the pszDst is too small.327 *328 * @param pszPrefix Pipe name prefix, for example 'VBoxTrayIPC-'329 * @param pszUsername Username.330 * @param pszDst Destination buffer to store created pipe name331 * @param pcbDst IN - size of destination buffer in bytes,332 * OUT - length of created pipe name in bytes without trailing zero333 */334 RTDECL(int) RTLocalIpcMakeNameUniqueUser(const char *pszPrefix, const char *pszUserName, char *pszDst, size_t *pcbDst);335 336 319 /** @} */ 337 320 RT_C_DECLS_END -
trunk/include/iprt/mangling.h
r64285 r64291 1045 1045 # define RTLinuxSysFsWriteU64File RT_MANGLER(RTLinuxSysFsWriteU64File) 1046 1046 # define RTLinuxSysFsWriteU64FileV RT_MANGLER(RTLinuxSysFsWriteU64FileV) 1047 # define RTLocalIpcMakeNameUniqueUser RT_MANGLER(RTLocalIpcMakeNameUniqueUser)1048 1047 # define RTLocalIpcServerCreate RT_MANGLER(RTLocalIpcServerCreate) 1049 1048 # define RTLocalIpcServerDestroy RT_MANGLER(RTLocalIpcServerDestroy) -
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; -
trunk/src/VBox/Runtime/Makefile.kmk
r64285 r64291 658 658 r3/generic/semspinmutex-r3-generic.cpp \ 659 659 r3/xml.cpp \ 660 common/zip/xarvfs.cpp \ 661 r3/localipc.cpp 660 common/zip/xarvfs.cpp 662 661 663 662
Note:
See TracChangeset
for help on using the changeset viewer.

