Changeset 57461 in vbox
- Timestamp:
- Aug 19, 2015 5:34:19 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r57358 r57461 961 961 if (RT_FAILURE(rc)) 962 962 { 963 Log(("vboxNetWinAddComponent: collectNetIfInfo() -> %Rrc\n", rc)); 964 } 963 LogRel(("vboxNetWinAddComponent: collectNetIfInfo() -> %Rrc\n", rc)); 964 } 965 LogRel(("vboxNetWinAddComponent: adding %ls\n", lpszName)); 965 966 /* create a new object and add it to the list */ 966 967 ComObjPtr<HostNetworkInterface> iface; 967 968 iface.createObject(); 968 969 /* remove the curly bracket at the end */ 969 if (SUCCEEDED(iface->init(name, enmType, &Info))) 970 rc = iface->init(name, enmType, &Info); 971 if (SUCCEEDED(rc)) 970 972 { 971 973 if (Info.bIsDefault) … … 973 975 else 974 976 pPist->push_back(iface); 975 rc = VINF_SUCCESS;976 977 } 977 978 else 978 979 { 980 LogRel(("vboxNetWinAddComponent: HostNetworkInterface::init() -> %Rrc\n", rc)); 979 981 Assert(0); 980 982 } 981 983 } 984 else 985 LogRel(("vboxNetWinAddComponent: failed to get device instance GUID (0x%x)\n", hr)); 982 986 CoTaskMemFree(lpszName); 983 987 } 988 else 989 LogRel(("vboxNetWinAddComponent: failed to get device display name (0x%x)\n", hr)); 984 990 985 991 return rc; … … 1014 1020 while ((hr = pEnumComponent->Next(1, &pMpNcc, NULL)) == S_OK) 1015 1021 { 1022 LPWSTR pwszName; 1016 1023 ULONG uComponentStatus; 1024 hr = pMpNcc->GetDisplayName(&pwszName); 1025 if (hr == S_OK) 1026 LogRel(("netIfListHostAdapters: %ls\n", pwszName)); 1027 else 1028 LogRel(("netIfListHostAdapters: failed to get device display name (0x%x)\n", hr)); 1017 1029 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 1018 1030 if (hr == S_OK) … … 1025 1037 if (hr == S_OK) 1026 1038 { 1039 LogRel(("netIfListHostAdapters: id = %ls\n", pId)); 1027 1040 if (!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2)) 1028 1041 { … … 1031 1044 CoTaskMemFree(pId); 1032 1045 } 1046 else 1047 LogRel(("netIfListHostAdapters: failed to get device id (0x%x)\n", hr)); 1033 1048 } 1034 1049 } 1050 else 1051 LogRel(("netIfListHostAdapters: failed to get device status (0x%x)\n", hr)); 1035 1052 pMpNcc->Release(); 1036 1053 } … … 1041 1058 else 1042 1059 { 1043 LogRel(( __FUNCTION__": EnumComponents error (0x%x)", hr));1060 LogRel(("netIfListHostAdapters: EnumComponents error (0x%x)\n", hr)); 1044 1061 } 1045 1062 1046 1063 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE); 1047 1064 } 1048 else if (lpszApp) 1049 { 1050 CoTaskMemFree(lpszApp); 1065 else 1066 { 1067 LogRel(("netIfListHostAdapters: failed to acquire INetCfg interface (0x%x)\n", hr)); 1068 1069 if (lpszApp) 1070 { 1071 CoTaskMemFree(lpszApp); 1072 } 1051 1073 } 1052 1074 #endif /* # if defined VBOX_WITH_NETFLT */ … … 1469 1491 int iDefault = getDefaultInterfaceIndex(); 1470 1492 1493 LogRel(("NetIfList: building the list of interfaces\n")); 1471 1494 /* we are using the INetCfg API for getting the list of miniports */ 1472 1495 hr = VBoxNetCfgWinQueryINetCfg(&pNc, FALSE, … … 1485 1508 if (hr != S_OK) 1486 1509 { 1510 LogRel(("NetIfList: could not find VBoxNetLwf component (error 0x%x), trying VBoxNetFlt instead\n", hr)); 1487 1511 /* fall back to NDIS5 miniport lookup (sun_VBoxNetFlt) */ 1488 1512 hr = pNc->FindComponent(L"sun_VBoxNetFlt", &pTcpIpNcc); … … 1514 1538 while ((hr = pEnumBp->Next(1, &pBp, NULL)) == S_OK) 1515 1539 { 1540 LogRel(("NetIfList: fetched INetCfgBindingPath interface\n")); 1516 1541 /* S_OK == enabled, S_FALSE == disabled */ 1517 1542 if (pBp->IsEnabled() == S_OK) … … 1527 1552 while ((hr = pEnumBi->Next(1, &pBi, NULL)) == S_OK) 1528 1553 { 1554 LogRel(("NetIfList: fetched INetCfgBindingInterface interface\n")); 1529 1555 hr = pBi->GetLowerComponent(&pMpNcc); 1530 1556 Assert(hr == S_OK); 1531 1557 if (hr == S_OK) 1532 1558 { 1559 LPWSTR pwszName; 1533 1560 ULONG uComponentStatus; 1561 hr = pMpNcc->GetDisplayName(&pwszName); 1562 if (hr == S_OK) 1563 LogRel(("NetIfList: got %ls\n", pwszName)); 1564 else 1565 LogRel(("NetIfList: failed to get device display name (0x%x)\n", hr)); 1534 1566 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 1535 1567 if (hr == S_OK) … … 1542 1574 if (hr == S_OK) 1543 1575 { 1576 LogRel(("NetIfList: fetched network adapter id: %.80ls\n", pId)); 1544 1577 /* 1545 1578 * Host-only interfaces are ignored here and included into the list … … 1553 1586 CoTaskMemFree(pId); 1554 1587 } 1588 else 1589 LogRel(("NetIfList: failed to get device id (0x%x)\n", hr)); 1555 1590 } 1591 else 1592 LogRel(("NetIfList: wrong device status (0x%x)\n", uComponentStatus)); 1556 1593 } 1594 else 1595 LogRel(("NetIfList: failed to get device status (0x%x)\n", hr)); 1557 1596 pMpNcc->Release(); 1558 1597 } 1598 else 1599 LogRel(("NetIfList: failed to get lower component (0x%x)\n", hr)); 1559 1600 pBi->Release(); 1560 1601 } 1561 1602 Assert(hr == S_OK || hr == S_FALSE); 1562 1603 } 1604 else 1605 LogRel(("NetIfList: IEnumNetCfgBindingInterface::Reset failed (0x%x)\n", hr)); 1563 1606 pEnumBi->Release(); 1564 1607 } 1608 else 1609 LogRel(("NetIfList: failed to enumerate binding interfaces (0x%x)\n", hr)); 1565 1610 } 1611 else 1612 LogRel(("NetIfList: INetCfgBindingPath is disabled\n")); 1566 1613 pBp->Release(); 1567 1614 } 1568 1615 Assert(hr == S_OK || hr == S_FALSE); 1569 1616 } 1617 else 1618 LogRel(("NetIfList: IEnumNetCfgBindingPath::Reset failed (0x%x)\n", hr)); 1570 1619 pEnumBp->Release(); 1571 1620 } 1621 else 1622 LogRel(("NetIfList: EnumBindingPaths failed (0x%x)\n", hr)); 1572 1623 pBindings->Release(); 1573 1624 } 1625 else 1626 LogRel(("NetIfList: failed to acquire INetCfgComponentBindings interface\n")); 1574 1627 pTcpIpNcc->Release(); 1575 1628 } … … 1581 1634 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE); 1582 1635 } 1636 else 1637 LogRel(("NetIfList: failed to acquire INetCfg interface (0x%x)\n", hr)); 1583 1638 1584 1639 /* Add host-only adapters to the list */
Note:
See TracChangeset
for help on using the changeset viewer.