Changeset 62779 in vbox
- Timestamp:
- Jul 31, 2016 10:20:35 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109366
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r62778 r62779 979 979 logStringW(hModule, L"CreateHostOnlyInterface: Creating host-only interface"); 980 980 981 HRESULT hr; 982 981 HRESULT hr = E_FAIL; 983 982 GUID guid; 984 983 WCHAR wszMpInf[MAX_PATH]; 985 984 DWORD cchMpInf = RT_ELEMENTS(wszMpInf) - (DWORD)wcslen(pwszInfName) - 1 - 1; 986 985 LPCWSTR pwszInfPath = NULL; 987 bool bIsFile = false;986 bool fIsFile = false; 988 987 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszMpInf, &cchMpInf); 989 988 if (uErr == ERROR_SUCCESS) … … 1000 999 wcscat(wszMpInf, pwszInfName); 1001 1000 pwszInfPath = wszMpInf; 1002 bIsFile = true;1001 fIsFile = true; 1003 1002 1004 1003 logStringW(hModule, L"CreateHostOnlyInterface: Resulting INF path = %s", pwszInfPath); … … 1011 1010 1012 1011 /* Make sure the inf file is installed. */ 1013 if (pwszInfPath != NULL && bIsFile)1012 if (pwszInfPath != NULL && fIsFile) 1014 1013 { 1015 1014 logStringW(hModule, L"CreateHostOnlyInterface: Calling VBoxDrvCfgInfInstall(%s)", pwszInfPath); … … 1043 1042 #ifdef VBOXNETCFG_DELAYEDRENAME 1044 1043 BSTR devId; 1045 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, bIsFile, &guid, &devId, NULL);1044 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, fIsFile, &guid, &devId, NULL); 1046 1045 #else /* !VBOXNETCFG_DELAYEDRENAME */ 1047 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, bIsFile, &guid, NULL, NULL);1046 hr = VBoxNetCfgWinCreateHostOnlyNetworkInterface(pwszInfPath, fIsFile, &guid, NULL, NULL); 1048 1047 #endif /* !VBOXNETCFG_DELAYEDRENAME */ 1049 1048 logStringW(hModule, L"CreateHostOnlyInterface: VBoxNetCfgWinCreateHostOnlyNetworkInterface returns 0x%x", hr); … … 1181 1180 DWORD cchMpInf = RT_ELEMENTS(wszMpInf) - (DWORD)wcslen(pwszInfName) - 1 - 1; 1182 1181 LPCWSTR pwszInfPath = NULL; 1183 bool bIsFile = false;1182 bool fIsFile = false; 1184 1183 UINT uErr = MsiGetPropertyW(hModule, L"CustomActionData", wszMpInf, &cchMpInf); 1185 1184 if (uErr == ERROR_SUCCESS) … … 1196 1195 wcscat(wszMpInf, pwszInfName); 1197 1196 pwszInfPath = wszMpInf; 1198 bIsFile = true;1197 fIsFile = true; 1199 1198 1200 1199 logStringW(hModule, L"UpdateHostOnlyInterfaces: Resulting INF path = %s", pwszInfPath); … … 1369 1368 } 1370 1369 1371 #define SetErrBreak( strAndArgs) \1370 #define SetErrBreak(args) \ 1372 1371 if (1) { \ 1373 1372 rc = 0; \ 1374 logStringW (hModule, strAndArgs); \1373 logStringW args; \ 1375 1374 break; \ 1376 1375 } else do {} while (0) … … 1396 1395 LONG lStatus = RegOpenKeyExW(HKEY_LOCAL_MACHINE, wszRegLocation, 0, KEY_READ, &hkeyNetwork); 1397 1396 if ((lStatus != ERROR_SUCCESS) || !hkeyNetwork) 1398 SetErrBreak((L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [1]", wszRegLocation)); 1397 SetErrBreak((hModule, L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [1]", 1398 wszRegLocation)); 1399 1399 1400 1400 lStatus = RegOpenKeyExW(hkeyNetwork, L"Connection", 0, KEY_READ, &hkeyConnection); 1401 1401 if ((lStatus != ERROR_SUCCESS) || !hkeyConnection) 1402 SetErrBreak((L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [2]", wszRegLocation)); 1402 SetErrBreak((hModule, L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [2]", 1403 wszRegLocation)); 1403 1404 1404 1405 DWORD len = sizeof(wszPnPInstanceId); … … 1407 1408 &dwKeyType, (LPBYTE)&wszPnPInstanceId[0], &len); 1408 1409 if ((lStatus != ERROR_SUCCESS) || (dwKeyType != REG_SZ)) 1409 SetErrBreak((L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [3]", wszRegLocation)); 1410 SetErrBreak((hModule, L"VBox HostInterfaces: Host interface network was not found in registry (%s)! [3]", 1411 wszRegLocation)); 1410 1412 } 1411 1413 while (0); … … 1442 1444 { 1443 1445 logStringW(hModule, L"VBox HostInterfaces: SetupDiGetClassDevs failed (0x%08X)!", GetLastError()); 1444 SetErrBreak( L"VBox HostInterfaces: Uninstallation failed!");1446 SetErrBreak((hModule, L"VBox HostInterfaces: Uninstallation failed!")); 1445 1447 } 1446 1448 … … 1545 1547 { 1546 1548 logStringW(hModule, L"VBox HostInterfaces: SetupDiSetSelectedDevice failed (0x%08X)!", GetLastError()); 1547 SetErrBreak( L"VBox HostInterfaces: Uninstallation failed!");1549 SetErrBreak((hModule, L"VBox HostInterfaces: Uninstallation failed!")); 1548 1550 } 1549 1551 … … 1552 1554 { 1553 1555 logStringW(hModule, L"VBox HostInterfaces: SetupDiCallClassInstaller (DIF_REMOVE) failed (0x%08X)!", GetLastError()); 1554 SetErrBreak( L"VBox HostInterfaces: Uninstallation failed!");1556 SetErrBreak((hModule, L"VBox HostInterfaces: Uninstallation failed!")); 1555 1557 } 1556 1558 } 1557 1559 else 1558 SetErrBreak(L"VBox HostInterfaces: Host interface network device not found!"); 1559 } 1560 while (0); 1560 SetErrBreak((hModule, L"VBox HostInterfaces: Host interface network device not found!")); 1561 } while (0); 1561 1562 1562 1563 /* clean up the device info set */ 1563 1564 if (hDeviceInfo != INVALID_HANDLE_VALUE) 1564 1565 SetupDiDestroyDeviceInfoList(hDeviceInfo); 1565 } 1566 while (0); 1566 } while (0); 1567 1567 return rc; 1568 1568 }
Note:
See TracChangeset
for help on using the changeset viewer.