Changeset 16967 in vbox
- Timestamp:
- Feb 20, 2009 10:03:55 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43133
- Location:
- trunk/src/VBox
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r16858 r16967 1038 1038 # endif 1039 1039 1040 if (OpenReq.enmTrunkType == kIntNetTrunkType_NetFlt) 1041 { 1042 /* 1043 * <Describe what this does here or/and in the function docs of drvIntNetWinIfGuidToBindName>. 1044 */ 1045 char szBindName[INTNET_MAX_TRUNK_NAME]; 1046 rc = drvIntNetWinIfGuidToBindName(OpenReq.szTrunk, szBindName, INTNET_MAX_TRUNK_NAME); 1047 AssertLogRelMsgRCReturn(rc, ("drvIntNetWinIfGuidToBindName failed, rc=%Rrc", rc), rc); 1048 strcpy(OpenReq.szTrunk, szBindName); 1049 } 1050 else 1051 { 1052 strcpy(OpenReq.szTrunk, "dummy name"); 1053 } 1040 /* 1041 * <Describe what this does here or/and in the function docs of drvIntNetWinIfGuidToBindName>. 1042 */ 1043 char szBindName[INTNET_MAX_TRUNK_NAME]; 1044 rc = drvIntNetWinIfGuidToBindName(OpenReq.szTrunk, szBindName, INTNET_MAX_TRUNK_NAME); 1045 AssertLogRelMsgRCReturn(rc, ("drvIntNetWinIfGuidToBindName failed, rc=%Rrc", rc), rc); 1046 strcpy(OpenReq.szTrunk, szBindName); 1054 1047 } 1055 1048 #endif /* WINDOWS && NETFLT */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMSettingsNetwork.cpp
r16927 r16967 156 156 mAdapter.SetCableConnected (mCbCable->isChecked()); 157 157 158 if (type == KNetworkAttachmentType_HostInterface) 158 if (type == KNetworkAttachmentType_HostInterface 159 #if defined (Q_WS_WIN) && defined (VBOX_WITH_NETFLT) 160 || type == KNetworkAttachmentType_HostOnly 161 #endif 162 ) 159 163 { 160 164 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT) … … 715 719 /* Load current inner list */ 716 720 QList<QTreeWidgetItem*> itemsList; 717 CHostNetworkInterfaceVector interfaces = 718 #if defined(Q_WS_WIN) && defined(VBOX_WITH_NETFLT) 719 enmAttachmentType == KNetworkAttachmentType_HostOnly ? 720 vboxGlobal().virtualBox().GetHost().GetTapInterfaces() 721 : 722 #endif 723 vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 721 CHostNetworkInterfaceVector interfaces = vboxGlobal().virtualBox().GetHost().GetNetworkInterfaces(); 724 722 for (CHostNetworkInterfaceVector::ConstIterator it = interfaces.begin(); 725 723 it != interfaces.end(); ++it) 726 itemsList << new VBoxNIListItem (it->GetName()); 724 { 725 #if defined(Q_WS_WIN) && defined(VBOX_WITH_NETFLT) 726 /* display real for not host-only and viceversa */ 727 if((enmAttachmentType == KNetworkAttachmentType_HostOnly) != it->GetReal()) 728 #endif 729 itemsList << new VBoxNIListItem (it->GetName()); 730 } 727 731 728 732 /* Save current list item name */ … … 855 859 856 860 #if defined (Q_WS_WIN) || defined (VBOX_WITH_NETFLT) 857 if (type == KNetworkAttachmentType_HostInterface && 858 page->interfaceName().isNull()) 861 if ((type == KNetworkAttachmentType_HostInterface 862 #if defined (Q_WS_WIN) && defined (VBOX_WITH_NETFLT) 863 || type == KNetworkAttachmentType_HostOnly 864 #endif 865 ) && page->interfaceName().isNull()) 859 866 { 860 867 valid = false; -
trunk/src/VBox/Main/ConsoleImpl2.cpp
r16960 r16967 1370 1370 N_("Inexistent host networking interface, name '%ls'"), 1371 1371 HifName.raw()); 1372 } 1373 1374 BOOL real; 1375 hrc = hostInterface->COMGETTER(Real)(&real); 1376 if(FAILED(hrc)) 1377 { 1378 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Real) failed, hrc (0x%x)", hrc)); 1379 H(); 1380 } 1381 1382 if(!real) 1383 { 1384 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Real) failed, hrc (0x%x)", hrc)); 1385 return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS, 1386 N_("Interface ('%ls') is a Host Adapter interface"), 1387 HifName.raw()); 1372 1388 } 1373 1389 … … 1637 1653 rc = CFGMR3InsertString(pLunL0, "Driver", "IntNet"); RC_CHECK(); 1638 1654 rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); RC_CHECK(); 1655 #if defined(RT_OS_WINDOWS) 1656 Bstr HifName; 1657 hrc = networkAdapter->COMGETTER(HostInterface)(HifName.asOutParam()); 1658 if(FAILED(hrc)) 1659 { 1660 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(HostInterface) failed, hrc (0x%x)", hrc)); 1661 H(); 1662 } 1663 1664 Utf8Str HifNameUtf8(HifName); 1665 const char *pszHifName = HifNameUtf8.raw(); 1666 ComPtr<IHostNetworkInterface> hostInterface; 1667 rc = host->FindHostNetworkInterfaceByName(HifName, hostInterface.asOutParam()); 1668 if (!SUCCEEDED(rc)) 1669 { 1670 AssertBreakpoint(); 1671 LogRel(("NetworkAttachmentType_HostOnly: FindByName failed, rc (0x%x)", rc)); 1672 return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS, 1673 N_("Inexistent host networking interface, name '%ls'"), 1674 HifName.raw()); 1675 } 1676 1677 BOOL real; 1678 hrc = hostInterface->COMGETTER(Real)(&real); 1679 if(FAILED(hrc)) 1680 { 1681 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Real) failed, hrc (0x%x)", hrc)); 1682 H(); 1683 } 1684 1685 if(real) 1686 { 1687 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Real) failed, hrc (0x%x)", hrc)); 1688 return VMSetError(pVM, VERR_INTERNAL_ERROR, RT_SRC_POS, 1689 N_("Interface ('%ls') is not a Host Adapter interface"), 1690 HifName.raw()); 1691 } 1692 1693 Guid hostIFGuid; 1694 hrc = hostInterface->COMGETTER(Id)(hostIFGuid.asOutParam()); 1695 if(FAILED(hrc)) 1696 { 1697 LogRel(("NetworkAttachmentType_HostOnly: COMGETTER(Id) failed, hrc (0x%x)", hrc)); 1698 H(); 1699 } 1700 char szDriverGUID[RTUUID_STR_LENGTH]; 1701 strcpy(szDriverGUID , hostIFGuid.toString().raw()); 1702 const char *pszTrunk = szDriverGUID; 1703 1704 /* TODO: set the proper Trunk and Network values, currently the driver uses the first adapter instance */ 1705 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK(); 1706 rc = CFGMR3InsertString(pCfg, "Trunk", pszTrunk); RC_CHECK(); 1707 char szNetwork[80]; 1708 RTStrPrintf(szNetwork, sizeof(szNetwork), "HostInterfaceNetworking-%s", pszHifName); 1709 rc = CFGMR3InsertString(pCfg, "Network", szNetwork); RC_CHECK(); 1710 #elif defined(RT_OS_DARWIN) 1639 1711 rc = CFGMR3InsertString(pCfg, "Trunk", "vboxnet0"); RC_CHECK(); 1640 1712 rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK(); 1641 #if defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)1642 /* TODO: set the proper Trunk and Network values, currently the driver uses the first adapter instance */1643 1713 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetAdp); RC_CHECK(); 1644 1714 #else 1715 rc = CFGMR3InsertString(pCfg, "Trunk", "vboxnet0"); RC_CHECK(); 1716 rc = CFGMR3InsertString(pCfg, "Network", "HostInterfaceNetworking-vboxnet0"); RC_CHECK(); 1645 1717 rc = CFGMR3InsertInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); RC_CHECK(); 1646 1718 #endif -
trunk/src/VBox/Main/HostImpl.cpp
r16929 r16967 614 614 ComObjPtr<HostNetworkInterface> IfObj; 615 615 IfObj.createObject(); 616 if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), Guid(Uuid) )))616 if (SUCCEEDED(IfObj->init(Bstr(szNICDesc), Guid(Uuid), true))) 617 617 pList->push_back(IfObj); 618 618 } … … 729 729 iface.createObject(); 730 730 /* remove the curly bracket at the end */ 731 if (SUCCEEDED (iface->init (name, Guid (IfGuid) )))731 if (SUCCEEDED (iface->init (name, Guid (IfGuid), true))) 732 732 { 733 733 pPist->push_back (iface); … … 744 744 return rc; 745 745 } 746 747 STDMETHODIMP Host::COMGETTER(TapInterfaces) (ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces)) 748 { 749 if (ComSafeArrayOutIsNull (aNetworkInterfaces)) 750 return E_POINTER; 751 752 AutoWriteLock alock (this); 753 CHECK_READY(); 754 755 std::list <ComObjPtr <HostNetworkInterface> > list; 756 #ifdef VBOX_WITH_HOSTNETIF_API 757 int rc = NetIfListTap(list); 758 if (rc) 759 { 760 Log(("Failed to get host tap network interface list with rc=%Vrc\n", rc)); 761 } 762 #else 763 #endif 764 SafeIfaceArray <IHostNetworkInterface> networkInterfaces (list); 765 networkInterfaces.detachTo (ComSafeArrayOutArg (aNetworkInterfaces)); 766 767 return S_OK; 768 } 769 #else /* !defined(RT_OS_WINDOWS) || !defined(VBOX_WITH_NETFLT) */ 770 STDMETHODIMP Host::COMGETTER(TapInterfaces) (ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces)) 771 { 772 return NS_ERROR_NOT_IMPLEMENTED; 773 } 774 #endif /* !defined(RT_OS_WINDOWS) && !defined(VBOX_WITH_NETFLT) */ 775 746 #endif /* defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) */ 776 747 /** 777 748 * Returns a list of host network interfaces. … … 804 775 ComObjPtr<HostNetworkInterface> IfObj; 805 776 IfObj.createObject(); 806 if (SUCCEEDED(IfObj->init(Bstr(pEtherNICs->szName), Guid(pEtherNICs->Uuid) )))777 if (SUCCEEDED(IfObj->init(Bstr(pEtherNICs->szName), Guid(pEtherNICs->Uuid), true))) 807 778 list.push_back(IfObj); 808 779 … … 959 930 /* remove the curly bracket at the end */ 960 931 szNetworkGUID [strlen(szNetworkGUID) - 1] = '\0'; 961 if (SUCCEEDED (iface->init (name, Guid (szNetworkGUID + 1) )))932 if (SUCCEEDED (iface->init (name, Guid (szNetworkGUID + 1), true))) 962 933 list.push_back (iface); 963 934 } … … 1085 1056 ComObjPtr<HostNetworkInterface> IfObj; 1086 1057 IfObj.createObject(); 1087 if (SUCCEEDED(IfObj->init(Bstr(pReq->ifr_name), Guid(uuid) )))1058 if (SUCCEEDED(IfObj->init(Bstr(pReq->ifr_name), Guid(uuid), true))) 1088 1059 list.push_back(IfObj); 1089 1060 } … … 3071 3042 /* initialize the object returned to the caller by 3072 3043 * CreateHostNetworkInterface() */ 3073 rc = d->iface->init (d->name, guid );3044 rc = d->iface->init (d->name, guid, false); 3074 3045 endLoop = true; 3075 3046 break; -
trunk/src/VBox/Main/HostNetworkInterfaceImpl.cpp
r15511 r16967 51 51 * @param aGuid GUID of the host network interface 52 52 */ 53 HRESULT HostNetworkInterface::init (Bstr aInterfaceName, Guid aGuid )53 HRESULT HostNetworkInterface::init (Bstr aInterfaceName, Guid aGuid, BOOL aReal) 54 54 { 55 55 LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n", … … 65 65 unconst (mInterfaceName) = aInterfaceName; 66 66 unconst (mGuid) = aGuid; 67 mReal = aReal; 68 67 69 68 70 /* Confirm a successful initialization */ … … 110 112 * @param aGuid GUID of the host network interface 111 113 */ 112 HRESULT HostNetworkInterface::init (Bstr aInterfaceName, PNETIFINFO pIf)114 HRESULT HostNetworkInterface::init (Bstr aInterfaceName, BOOL aReal, PNETIFINFO pIf) 113 115 { 114 116 // LogFlowThisFunc (("aInterfaceName={%ls}, aGuid={%s}\n", … … 125 127 unconst (mInterfaceName) = aInterfaceName; 126 128 unconst (mGuid) = pIf->Uuid; 129 mReal = aReal; 130 127 131 m.IPAddress = pIf->IPAddress.u; 128 132 m.networkMask = pIf->IPNetMask.u; … … 311 315 } 312 316 317 /** 318 * Returns true if this is a "real" adapter, false if this is a Virtualbox Host Adapter 319 * 320 * @returns COM status code 321 * @param aReal address of result pointer 322 */ 323 STDMETHODIMP HostNetworkInterface::COMGETTER(Real) (BOOL *aReal) 324 { 325 CheckComArgOutPointerValid(aReal); 326 327 AutoCaller autoCaller (this); 328 CheckComRCReturnRC (autoCaller.rc()); 329 330 *aReal = mReal; 331 332 return S_OK; 333 334 } 335 313 336 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r16560 r16967 943 943 if (!(attachmentNode = aAdapterNode.findKey ("HostOnlyNetwork")).isNull()) 944 944 { 945 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) 946 Bstr name = attachmentNode.stringValue ("name"); 947 /* name can be empty, but not null */ 948 ComAssertRet (!name.isNull(), E_FAIL); 949 950 rc = COMSETTER(HostInterface) (name); 951 CheckComRCReturnRC (rc); 952 #endif 953 945 954 /* Host Interface Networking */ 946 955 rc = AttachToHostOnlyNetwork(); … … 1042 1051 { 1043 1052 Key attachmentNode = aAdapterNode.createKey ("HostOnlyNetwork"); 1053 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) 1054 Assert (!mData->mHostInterface.isNull()); 1055 attachmentNode.setValue <Bstr> ("name", mData->mHostInterface); 1056 #endif 1044 1057 break; 1045 1058 } … … 1200 1213 case NetworkAttachmentType_HostOnly: 1201 1214 { 1215 #if defined(RT_OS_WINDOWS) && defined(VBOX_WITH_NETFLT) 1216 /* reset handle and device name */ 1217 mData->mHostInterface = ""; 1218 #endif 1202 1219 break; 1203 1220 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r16966 r16967 6441 6441 <interface 6442 6442 name="IHostNetworkInterface" extends="$unknown" 6443 uuid=" 832720ac-2df6-41d4-a867-a0b40df14c7f"6443 uuid="4fc2445f-fb73-4f55-b3b4-ecee47c7077b" 6444 6444 wsmap="managed" 6445 6445 > … … 6485 6485 <desc>Status of the interface.</desc> 6486 6486 </attribute> 6487 6488 <attribute name="real" type="boolean" readonly="yes"> 6489 <desc>True if this is a real interface false 6490 if this is a Virtualbox Host Adapter interface.</desc> 6491 </attribute> 6487 6492 </interface> 6488 6493 … … 6555 6560 <attribute name="networkInterfaces" type="IHostNetworkInterface" safearray="yes" readonly="yes"> 6556 6561 <desc>List of host network interfaces currently defined on the host.</desc> 6557 </attribute>6558 6559 <attribute name="tapInterfaces" type="IHostNetworkInterface" safearray="yes" readonly="yes">6560 <desc>List of host tap interfaces currently defined on the host.</desc>6561 6562 </attribute> 6562 6563 -
trunk/src/VBox/Main/include/HostImpl.h
r16929 r16967 98 98 99 99 // IHost methods 100 STDMETHOD(COMGETTER(TapInterfaces))(ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces));101 100 #ifdef RT_OS_WINDOWS 102 101 -
trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
r15570 r16967 60 60 61 61 // public initializer/uninitializer for internal purposes only 62 HRESULT init (Bstr interfaceName, Guid guid );62 HRESULT init (Bstr interfaceName, Guid guid, BOOL aReal); 63 63 #ifdef VBOX_WITH_HOSTNETIF_API 64 HRESULT init (Bstr aInterfaceName, struct NETIFINFO *pIfs);64 HRESULT init (Bstr aInterfaceName, BOOL aReal, struct NETIFINFO *pIfs); 65 65 #endif 66 66 … … 75 75 STDMETHOD(COMGETTER(Type)) (HostNetworkInterfaceType_T *aType); 76 76 STDMETHOD(COMGETTER(Status)) (HostNetworkInterfaceStatus_T *aStatus); 77 STDMETHOD(COMGETTER(Real)) (BOOL *aReal); 77 78 78 79 // for VirtualBoxSupportErrorInfoImpl … … 82 83 const Bstr mInterfaceName; 83 84 const Guid mGuid; 85 BOOL mReal; 86 84 87 struct Data 85 88 { 86 89 Data() : IPAddress (0), networkMask (0), 87 90 type (HostNetworkInterfaceType_Unknown), 88 status(HostNetworkInterfaceStatus_Down) 89 91 status(HostNetworkInterfaceStatus_Down){} 92 90 93 ULONG IPAddress; 91 94 ULONG networkMask; -
trunk/src/VBox/Main/include/netif.h
r16927 r16967 77 77 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list); 78 78 79 #if defined(VBOX_WITH_NETFLT) && defined(RT_OS_WINDOWS)80 int NetIfListTap(std::list <ComObjPtr <HostNetworkInterface> > &list);81 79 #endif 82 80 83 #endif84 -
trunk/src/VBox/Main/win/NetIfList-win.cpp
r16927 r16967 151 151 # define VBOX_APP_NAME L"VirtualBox" 152 152 153 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc )153 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc, bool bReal) 154 154 { 155 155 LPWSTR lpszName; … … 183 183 iface.createObject(); 184 184 /* remove the curly bracket at the end */ 185 if (SUCCEEDED (iface->init (name, &Info)))185 if (SUCCEEDED (iface->init (name, bReal, &Info))) 186 186 { 187 187 pPist->push_back (iface); … … 268 268 } 269 269 #endif /* #ifndef VBOX_WITH_NETFLT */ 270 271 272 static int NetIfListHostAdapters(std::list <ComObjPtr <HostNetworkInterface> > &list) 273 { 274 #ifndef VBOX_WITH_NETFLT 275 /* VBoxNetAdp is available only when VBOX_WITH_NETFLT is enabled */ 276 return VERR_NOT_IMPLEMENTED; 277 #else /* # if defined VBOX_WITH_NETFLT */ 278 INetCfg *pNc; 279 INetCfgComponent *pMpNcc; 280 LPWSTR lpszApp = NULL; 281 HRESULT hr; 282 IEnumNetCfgComponent *pEnumComponent; 283 284 /* we are using the INetCfg API for getting the list of miniports */ 285 hr = VBoxNetCfgWinQueryINetCfg( FALSE, 286 VBOX_APP_NAME, 287 &pNc, 288 &lpszApp ); 289 Assert(hr == S_OK); 290 if(hr == S_OK) 291 { 292 hr = VBoxNetCfgWinGetComponentEnum(pNc, &GUID_DEVCLASS_NET, &pEnumComponent); 293 if(hr == S_OK) 294 { 295 while((hr = VBoxNetCfgWinGetNextComponent(pEnumComponent, &pMpNcc)) == S_OK) 296 { 297 ULONG uComponentStatus; 298 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 299 #ifndef DEBUG_bird 300 Assert(hr == S_OK); 301 #endif 302 if(hr == S_OK) 303 { 304 if(uComponentStatus == 0) 305 { 306 LPWSTR pId; 307 hr = pMpNcc->GetId(&pId); 308 Assert(hr == S_OK); 309 if(hr == S_OK) 310 { 311 if(!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2)) 312 { 313 vboxNetWinAddComponent(&list, pMpNcc, false); 314 } 315 CoTaskMemFree(pId); 316 } 317 } 318 } 319 VBoxNetCfgWinReleaseRef(pMpNcc); 320 } 321 Assert(hr == S_OK || hr == S_FALSE); 322 323 VBoxNetCfgWinReleaseRef(pEnumComponent); 324 } 325 else 326 { 327 LogRel(("failed to get the sun_VBoxNetFlt component, error (0x%x)", hr)); 328 } 329 330 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE); 331 } 332 else if(lpszApp) 333 { 334 CoTaskMemFree(lpszApp); 335 } 336 #endif /* # if defined VBOX_WITH_NETFLT */ 337 return VINF_SUCCESS; 338 } 270 339 271 340 int NetIfList(std::list <ComObjPtr <HostNetworkInterface> > &list) … … 401 470 ULONG uComponentStatus; 402 471 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 403 #ifndef DEBUG_bird404 Assert(hr == S_OK);405 #endif472 //#ifndef DEBUG_bird 473 // Assert(hr == S_OK); 474 //#endif 406 475 if(hr == S_OK) 407 476 { 408 477 if(uComponentStatus == 0) 409 478 { 410 vboxNetWinAddComponent(&list, pMpNcc );479 vboxNetWinAddComponent(&list, pMpNcc, true); 411 480 } 412 481 } … … 435 504 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE); 436 505 } 506 507 NetIfListHostAdapters(list); 437 508 #endif /* # if defined VBOX_WITH_NETFLT */ 438 509 return VINF_SUCCESS; 439 510 } 440 441 int NetIfListTap(std::list <ComObjPtr <HostNetworkInterface> > &list)442 {443 #ifndef VBOX_WITH_NETFLT444 /* VBoxNetAdp is available only when VBOX_WITH_NETFLT is enabled */445 return VERR_NOT_IMPLEMENTED;446 #else /* # if defined VBOX_WITH_NETFLT */447 INetCfg *pNc;448 INetCfgComponent *pMpNcc;449 LPWSTR lpszApp = NULL;450 HRESULT hr;451 IEnumNetCfgComponent *pEnumComponent;452 453 /* we are using the INetCfg API for getting the list of miniports */454 hr = VBoxNetCfgWinQueryINetCfg( FALSE,455 VBOX_APP_NAME,456 &pNc,457 &lpszApp );458 Assert(hr == S_OK);459 if(hr == S_OK)460 {461 hr = VBoxNetCfgWinGetComponentEnum(pNc, &GUID_DEVCLASS_NET, &pEnumComponent);462 if(hr == S_OK)463 {464 while((hr = VBoxNetCfgWinGetNextComponent(pEnumComponent, &pMpNcc)) == S_OK)465 {466 ULONG uComponentStatus;467 hr = pMpNcc->GetDeviceStatus(&uComponentStatus);468 #ifndef DEBUG_bird469 Assert(hr == S_OK);470 #endif471 if(hr == S_OK)472 {473 if(uComponentStatus == 0)474 {475 LPWSTR pId;476 hr = pMpNcc->GetId(&pId);477 Assert(hr == S_OK);478 if(hr == S_OK)479 {480 if(!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2))481 {482 vboxNetWinAddComponent(&list, pMpNcc);483 }484 CoTaskMemFree(pId);485 }486 }487 }488 VBoxNetCfgWinReleaseRef(pMpNcc);489 }490 Assert(hr == S_OK || hr == S_FALSE);491 492 VBoxNetCfgWinReleaseRef(pEnumComponent);493 }494 else495 {496 LogRel(("failed to get the sun_VBoxNetFlt component, error (0x%x)", hr));497 }498 499 VBoxNetCfgWinReleaseINetCfg(pNc, FALSE);500 }501 else if(lpszApp)502 {503 CoTaskMemFree(lpszApp);504 }505 #endif /* # if defined VBOX_WITH_NETFLT */506 return VINF_SUCCESS;507 } -
trunk/src/VBox/Main/xml/VirtualBox-settings-common.xsd
r16509 r16967 607 607 <xsd:element name="HostOnlyNetwork"> 608 608 <xsd:complexType> 609 <xsd:attribute name="name" type="xsd:string" use="optional"/> 609 610 </xsd:complexType> 610 611 </xsd:element>
Note:
See TracChangeset
for help on using the changeset viewer.