Index: /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp
===================================================================
--- /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp	(revision 58305)
+++ /trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxIPC.cpp	(revision 58306)
@@ -31,4 +31,6 @@
 #include <iprt/localipc.h>
 #include <iprt/mem.h>
+#include <iprt/process.h>
+
 #include <VBoxGuestInternal.h>
 
@@ -179,44 +181,28 @@
     if (RT_SUCCESS(rc))
     {
-        RTUTF16 wszUserName[255];
-        DWORD cchUserName = sizeof(wszUserName) / sizeof(RTUTF16);
-        BOOL fRc = GetUserNameW(wszUserName, &cchUserName);
-        if (!fRc)
-            rc = RTErrConvertFromWin32(GetLastError());
-
+        char szPipeName[512 + sizeof(VBOXTRAY_IPC_PIPE_PREFIX)];
+        strcpy(szPipeName, VBOXTRAY_IPC_PIPE_PREFIX);
+        rc = RTProcQueryUsername(NIL_RTPROCESS,
+                                 &szPipeName[sizeof(VBOXTRAY_IPC_PIPE_PREFIX) - 1],
+                                 sizeof(szPipeName) - sizeof(VBOXTRAY_IPC_PIPE_PREFIX) + 1,
+                                 NULL /*pcbUser*/);
         if (RT_SUCCESS(rc))
         {
-            char *pszUserName;
-            rc = RTUtf16ToUtf8(wszUserName, &pszUserName);
+            rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
             if (RT_SUCCESS(rc))
             {
-                char szPipeName[255];
-                if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s",
-                                VBOXTRAY_IPC_PIPE_PREFIX, pszUserName))
-                {
-                    rc = RTLocalIpcServerCreate(&pCtx->hServer, szPipeName, 0 /*fFlags*/);
-                    if (RT_SUCCESS(rc))
-                    {
-                        RTStrFree(pszUserName);
-
-                        pCtx->pEnv = pEnv;
-                        RTListInit(&pCtx->SessionList);
-
-                        *ppInstance = pCtx;
-
-                        /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
-                        s_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
-                            RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
-
-                        LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
-                        return VINF_SUCCESS;
-                    }
-
-                }
-                else
-                    rc = VERR_NO_MEMORY;
-
-                RTStrFree(pszUserName);
-            }
+                pCtx->pEnv = pEnv;
+                RTListInit(&pCtx->SessionList);
+
+                *ppInstance = pCtx;
+
+                /* GetLastInputInfo only is available starting at Windows 2000 -- might fail. */
+                s_pfnGetLastInputInfo = (PFNGETLASTINPUTINFO)
+                    RTLdrGetSystemSymbol("User32.dll", "GetLastInputInfo");
+
+                LogRelFunc(("Local IPC server now running at \"%s\"\n", szPipeName));
+                return VINF_SUCCESS;
+            }
+
         }
 
