Changeset 47232 in vbox for trunk/src/VBox/Additions/WINNT/Installer/InstallHelper
- Timestamp:
- Jul 18, 2013 12:00:49 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87348
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Installer/InstallHelper/VBoxGuestInstallHelper.cpp
r47212 r47232 124 124 StringCchPrintf(szErr, sizeof(szErr), "0"); 125 125 pushstring(szErr); 126 } 127 128 /** 129 * Connects to VBoxTray IPC under the behalf of the user running 130 * in the current thread context. 131 * 132 * @return IPRT status code. 133 * @param phSession Where to store the IPC session. 134 */ 135 static int vboxConnectToVBoxTray(RTLOCALIPCSESSION hSession) 136 { 137 int rc = VINF_SUCCESS; 138 139 RTUTF16 wszUserName[255]; 140 DWORD cchUserName = sizeof(wszUserName) / sizeof(RTUTF16); 141 BOOL fRc = GetUserNameW(wszUserName, &cchUserName); 142 if (!fRc) 143 rc = RTErrConvertFromWin32(GetLastError()); 144 145 if (RT_SUCCESS(rc)) 146 { 147 char *pszUserName; 148 rc = RTUtf16ToUtf8(wszUserName, &pszUserName); 149 if (RT_SUCCESS(rc)) 150 { 151 char szPipeName[255]; 152 if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", 153 VBOXTRAY_IPC_PIPE_PREFIX, pszUserName)) 154 { 155 rc = RTLocalIpcSessionConnect(&hSession, szPipeName, 0 /* Flags */); 156 } 157 else 158 rc = VERR_NO_MEMORY; 159 160 RTStrFree(pszUserName); 161 } 162 } 163 164 return rc; 126 165 } 127 166 … … 437 476 { 438 477 RTLOCALIPCSESSION hSession; 439 int rc = RTLocalIpcSessionConnect(&hSession, VBOXTRAY_IPC_PIPENAME, 0 /* Flags */);478 int rc = vboxConnectToVBoxTray(hSession); 440 479 if (RT_SUCCESS(rc)) 441 480 {
Note:
See TracChangeset
for help on using the changeset viewer.