Changeset 17773 in vbox for trunk/src/VBox/Main
- Timestamp:
- Mar 12, 2009 6:19:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/win/NetIfList-win.cpp
r17713 r17773 1265 1265 } 1266 1266 1267 extern "C" HRESULTRenameConnection (PCWSTR GuidString, PCWSTR NewName)1267 static HRESULT netIfRenameConnection (PCWSTR GuidString, PCWSTR NewName) 1268 1268 { 1269 1269 typedef HRESULT (WINAPI *lpHrRenameConnection) (const GUID *, PCWSTR); … … 1304 1304 return S_OK; 1305 1305 } 1306 #define VBOX_CONNECTION_NAME L"Virtualbox Host-Only Network" 1307 static HRESULT netIfGenConnectionName (PCWSTR DevName, WCHAR *pBuf, PULONG pcbBuf) 1308 { 1309 WCHAR * pSuffix = wcsrchr( DevName, L'#' ); 1310 ULONG cbSize = sizeof(VBOX_CONNECTION_NAME); 1311 ULONG cbSufSize = 0; 1312 1313 if(pSuffix) 1314 { 1315 cbSize += wcslen(pSuffix) * 2; 1316 } 1317 1318 if(*pcbBuf < cbSize) 1319 { 1320 *pcbBuf = cbSize; 1321 return E_FAIL; 1322 } 1323 1324 wcscpy(pBuf, VBOX_CONNECTION_NAME); 1325 if(pSuffix) 1326 { 1327 wcscat(pBuf, pSuffix); 1328 } 1329 1330 return S_OK; 1331 } 1306 1332 1307 1333 #define DRIVERHWID _T("sun_VBoxNetAdp") … … 1606 1632 Bstr str(name); 1607 1633 str.detachTo(pName); 1634 WCHAR ConnectoinName[128]; 1635 ULONG cbBuf = sizeof(ConnectoinName); 1636 1637 /* return back the bracket */ 1638 pCfgGuidString [_tcslen (pCfgGuidString)] = '}'; 1639 1640 hr = netIfGenConnectionName (name, ConnectoinName, &cbBuf); 1641 if(hr == S_OK) 1642 { 1643 hr = netIfRenameConnection (pCfgGuidString, ConnectoinName); 1644 } 1608 1645 1609 1646 CoTaskMemFree (name);
Note:
See TracChangeset
for help on using the changeset viewer.