Changeset 36121 in vbox for trunk/src/VBox/Main/src-server/win
- Timestamp:
- Mar 1, 2011 3:25:18 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/NetIf-win.cpp
r35785 r36121 33 33 34 34 #ifdef VBOX_WITH_NETFLT 35 # include "VBox/WinNetConfig.h"36 # include "devguid.h"35 # include "VBox/VBoxNetCfg-win.h" 36 # include "devguid.h" 37 37 #endif 38 38 … … 1001 1001 1002 1002 /* we are using the INetCfg API for getting the list of miniports */ 1003 hr = VBoxNetCfgWinQueryINetCfg( FALSE,1003 hr = VBoxNetCfgWinQueryINetCfg(&pNc, FALSE, 1004 1004 VBOX_APP_NAME, 1005 &pNc,1005 10000, 1006 1006 &lpszApp); 1007 1007 Assert(hr == S_OK); 1008 1008 if (hr == S_OK) 1009 1009 { 1010 hr = VBoxNetCfgWinGetComponentEnum(pNc,&GUID_DEVCLASS_NET, &pEnumComponent);1010 hr = pNc->EnumComponents(&GUID_DEVCLASS_NET, &pEnumComponent); 1011 1011 if (hr == S_OK) 1012 1012 { 1013 while ((hr = VBoxNetCfgWinGetNextComponent(pEnumComponent, &pMpNcc)) == S_OK)1013 while ((hr = pEnumComponent->Next(1, &pMpNcc, NULL)) == S_OK) 1014 1014 { 1015 1015 ULONG uComponentStatus; … … 1032 1032 } 1033 1033 } 1034 VBoxNetCfgWinReleaseRef(pMpNcc);1034 pMpNcc->Release(); 1035 1035 } 1036 1036 Assert(hr == S_OK || hr == S_FALSE); 1037 1037 1038 VBoxNetCfgWinReleaseRef(pEnumComponent);1038 pEnumComponent->Release(); 1039 1039 } 1040 1040 else 1041 1041 { 1042 LogRel(( "failed to get the sun_VBoxNetFlt component,error (0x%x)", hr));1042 LogRel((__FUNCTION__": EnumComponents error (0x%x)", hr)); 1043 1043 } 1044 1044 … … 1442 1442 1443 1443 /* we are using the INetCfg API for getting the list of miniports */ 1444 hr = VBoxNetCfgWinQueryINetCfg( FALSE,1444 hr = VBoxNetCfgWinQueryINetCfg(&pNc, FALSE, 1445 1445 VBOX_APP_NAME, 1446 &pNc,1446 10000, 1447 1447 &lpszApp); 1448 1448 Assert(hr == S_OK); … … 1466 1466 if (hr == S_OK) 1467 1467 { 1468 hr = VBoxNetCfgWinGetBindingPathEnum(pTcpIpNcc, EBP_BELOW, &pEnumBp); 1468 INetCfgComponentBindings *pBindings; 1469 hr = pTcpIpNcc->QueryInterface(IID_INetCfgComponentBindings, (PVOID*)&pBindings); 1469 1470 Assert(hr == S_OK); 1470 1471 if (hr == S_OK) 1471 1472 { 1472 hr = VBoxNetCfgWinGetFirstBindingPath(pEnumBp, &pBp);1473 Assert(hr == S_OK || hr == S_FALSE);1474 while(hr == S_OK)1473 hr = pBindings->EnumBindingPaths(EBP_BELOW, &pEnumBp); 1474 Assert(hr == S_OK); 1475 if (hr == S_OK) 1475 1476 { 1476 /* S_OK == enabled, S_FALSE == disabled */ 1477 if (pBp->IsEnabled() == S_OK) 1478 { 1479 hr = VBoxNetCfgWinGetBindingInterfaceEnum(pBp, &pEnumBi); 1480 Assert(hr == S_OK); 1481 if ( hr == S_OK ) 1477 hr = pEnumBp->Reset(); 1478 Assert(hr == S_OK); 1479 if (hr == S_OK) 1480 { 1481 while ((hr = pEnumBp->Next(1, &pBp, NULL)) == S_OK) 1482 1482 { 1483 hr = VBoxNetCfgWinGetFirstBindingInterface(pEnumBi, &pBi); 1484 Assert(hr == S_OK); 1485 while (hr == S_OK) 1483 /* S_OK == enabled, S_FALSE == disabled */ 1484 if (pBp->IsEnabled() == S_OK) 1486 1485 { 1487 hr = pB i->GetLowerComponent( &pMpNcc);1486 hr = pBp->EnumBindingInterfaces(&pEnumBi); 1488 1487 Assert(hr == S_OK); 1489 if ( hr == S_OK)1488 if ( hr == S_OK ) 1490 1489 { 1491 ULONG uComponentStatus;1492 hr = pMpNcc->GetDeviceStatus(&uComponentStatus);1490 hr = pEnumBi->Reset(); 1491 Assert(hr == S_OK); 1493 1492 if (hr == S_OK) 1494 1493 { 1495 if (uComponentStatus == 0)1494 while ((hr = pEnumBi->Next(1, &pBi, NULL)) == S_OK) 1496 1495 { 1497 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged, iDefault); 1496 hr = pBi->GetLowerComponent( &pMpNcc ); 1497 Assert(hr == S_OK); 1498 if (hr == S_OK) 1499 { 1500 ULONG uComponentStatus; 1501 hr = pMpNcc->GetDeviceStatus(&uComponentStatus); 1502 if (hr == S_OK) 1503 { 1504 if (uComponentStatus == 0) 1505 { 1506 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged, iDefault); 1507 } 1508 } 1509 pMpNcc->Release(); 1510 } 1511 pBi->Release(); 1498 1512 } 1513 Assert(hr == S_OK || hr == S_FALSE); 1499 1514 } 1500 VBoxNetCfgWinReleaseRef( pMpNcc);1515 pEnumBi->Release(); 1501 1516 } 1502 VBoxNetCfgWinReleaseRef(pBi);1503 1504 hr = VBoxNetCfgWinGetNextBindingInterface(pEnumBi, &pBi);1505 1517 } 1506 VBoxNetCfgWinReleaseRef(pEnumBi);1518 pBp->Release(); 1507 1519 } 1508 } 1509 VBoxNetCfgWinReleaseRef(pBp); 1510 1511 hr = VBoxNetCfgWinGetNextBindingPath(pEnumBp, &pBp); 1520 Assert(hr == S_OK || hr == S_FALSE); 1521 } 1522 pEnumBp->Release(); 1512 1523 } 1513 VBoxNetCfgWinReleaseRef(pEnumBp);1514 } 1515 VBoxNetCfgWinReleaseRef(pTcpIpNcc);1524 pBindings->Release(); 1525 } 1526 pTcpIpNcc->Release(); 1516 1527 } 1517 1528 else
Note:
See TracChangeset
for help on using the changeset viewer.