Index: /trunk/include/iprt/localipc.h
===================================================================
--- /trunk/include/iprt/localipc.h	(revision 64284)
+++ /trunk/include/iprt/localipc.h	(revision 64285)
@@ -317,4 +317,21 @@
 RTDECL(int) RTLocalIpcSessionQueryGroupId(RTLOCALIPCSESSION hSession, PRTGID pGid);
 
+/**
+* Make the IPC pipe name unique for user
+* in a form like 'VBoxTrayIPC-6a4500cb7c726949'
+*
+* @returns IPRT status code.
+* @retval  VINF_SUCCESS and *pcbDest if pipe name created successfully.
+* @retval  VERR_INVALID_PARAMETER in case of invalid parameter value.
+* @retval  VERR_BUFFER_OVERFLOW if the pszDest is too small.
+*
+* @param   pszPrefix        Pipe name prefix, for example 'VBoxTrayIPC-'
+* @param   pszUserName      User name
+* @param   pszDest          Destination buffer to store created pipe name
+* @param   pcbDest          IN  - size of destination buffer in bytes,
+*                           OUT - length of created pipe name in bytes without trailing zero
+*/
+RTDECL(int) RTLocalIpcMakeNameUniqueUser(const char* pszPrefix, const char* pszUserName, char* pszDest, size_t* pcbDest);
+
 /** @} */
 RT_C_DECLS_END
Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 64284)
+++ /trunk/include/iprt/mangling.h	(revision 64285)
@@ -1045,4 +1045,5 @@
 # define RTLinuxSysFsWriteU64File                       RT_MANGLER(RTLinuxSysFsWriteU64File)
 # define RTLinuxSysFsWriteU64FileV                      RT_MANGLER(RTLinuxSysFsWriteU64FileV)
+# define RTLocalIpcMakeNameUniqueUser                   RT_MANGLER(RTLocalIpcMakeNameUniqueUser)
 # define RTLocalIpcServerCreate                         RT_MANGLER(RTLocalIpcServerCreate)
 # define RTLocalIpcServerDestroy                        RT_MANGLER(RTLocalIpcServerDestroy)
Index: /trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp	(revision 64284)
+++ /trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp	(revision 64285)
@@ -34,4 +34,5 @@
 #include <iprt/mem.h>
 #include <iprt/string.h>
+#include <iprt/localipc.h>
 
 /* Required structures/defines of VBoxTray. */
@@ -152,12 +153,11 @@
         if (RT_SUCCESS(rc))
         {
-            char szPipeName[255];
-            if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s",
-                            VBOXTRAY_IPC_PIPE_PREFIX, pszUserName))
+            char szPipeName[80];
+            size_t cbPipeName = sizeof(szPipeName);
+            rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, pszUserName, szPipeName, &cbPipeName);
+            if (RT_SUCCESS(rc))
             {
                 rc = RTLocalIpcSessionConnect(phSession, szPipeName, 0 /* Flags */);
             }
-            else
-                rc = VERR_NO_MEMORY;
 
             RTStrFree(pszUserName);
Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp	(revision 64284)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp	(revision 64285)
@@ -175,4 +175,5 @@
 }
 
+
 /**
  * Initializes the IPC communication.
@@ -195,28 +196,34 @@
     if (RT_SUCCESS(rc))
     {
-        char szPipeName[512 + sizeof(VBOXTRAY_IPC_PIPE_PREFIX)];
-        strcpy(szPipeName, VBOXTRAY_IPC_PIPE_PREFIX);
+        char szUserName[512];
         rc = RTProcQueryUsername(NIL_RTPROCESS,
-                                 &szPipeName[sizeof(VBOXTRAY_IPC_PIPE_PREFIX) - 1],
-                                 sizeof(szPipeName) - sizeof(VBOXTRAY_IPC_PIPE_PREFIX) + 1,
+                                 szUserName,
+                                 sizeof(szUserName),
                                  NULL /*pcbUser*/);
         if (RT_SUCCESS(rc))
         {
-            rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
+            char szPipeName[80];
+            size_t cbPipeName = sizeof(szPipeName);
+            rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, szUserName, szPipeName, &cbPipeName);
             if (RT_SUCCESS(rc))
             {
-                pCtx->pEnv = pEnv;
-                RTListInit(&pCtx->SessionList);
-
-                *ppInstance = pCtx;
-
-                /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
-                g_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
-                    RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
-
-                LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
-                return VINF_SUCCESS;
-            }
-
+
+                rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
+                if (RT_SUCCESS(rc))
+                {
+                    pCtx->pEnv = pEnv;
+                    RTListInit(&pCtx->SessionList);
+
+                    *ppInstance = pCtx;
+
+                    /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
+                    g_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
+                        RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
+
+                    LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
+                    return VINF_SUCCESS;
+                }
+
+            }
         }
 
Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 64284)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxTray.cpp	(revision 64285)
@@ -308,8 +308,6 @@
             LogRel(("Failed to initialize service '%s', rc=%Rrc\n", pSvc->pDesc->pszName, rc2));
             if (rc2 == VERR_NOT_SUPPORTED)
-            {
                 LogRel(("Service '%s' is not supported on this system\n", pSvc->pDesc->pszName));
-                rc2 = VINF_SUCCESS;
-            }
+            rc2 = VINF_SUCCESS;
             /* Keep going. */
         }
Index: /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp	(revision 64284)
+++ /trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp	(revision 64285)
@@ -39,4 +39,5 @@
 #include <iprt/time.h>
 #include <iprt/thread.h>
+
 
 #include <VBox/VBoxGuestLib.h>
@@ -955,8 +956,9 @@
 
     int rc = VINF_SUCCESS;
-
-    char szPipeName[255];
+    char szPipeName[80];
+    size_t cbPipeName = sizeof(szPipeName);
+    rc = RTLocalIpcMakeNameUniqueUser(VBOXTRAY_IPC_PIPE_PREFIX, pszUser, szPipeName, &cbPipeName);
 /** @todo r=bird:  Pointless if.  */
-    if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", VBOXTRAY_IPC_PIPE_PREFIX, pszUser))
+    if (RT_SUCCESS(rc))
     {
         bool fReportToHost = false;
Index: /trunk/src/VBox/Runtime/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Runtime/Makefile.kmk	(revision 64284)
+++ /trunk/src/VBox/Runtime/Makefile.kmk	(revision 64285)
@@ -658,5 +658,6 @@
 	r3/generic/semspinmutex-r3-generic.cpp \
 	r3/xml.cpp \
-	common/zip/xarvfs.cpp
+	common/zip/xarvfs.cpp \
+	r3/localipc.cpp
 
 
