- Timestamp:
- Feb 18, 2009 12:40:55 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/win/NetIfList-win.cpp
r15966 r16899 38 38 #ifdef VBOX_WITH_NETFLT 39 39 #include "VBox/WinNetConfig.h" 40 #include "devguid.h" 40 41 #endif 41 42 … … 437 438 return VINF_SUCCESS; 438 439 } 440 441 int NetIfListTap(std::list <ComObjPtr <HostNetworkInterface> > &list) 442 { 443 #ifndef VBOX_WITH_NETFLT 444 /* 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_bird 469 Assert(hr == S_OK); 470 #endif 471 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(!wcscmp(pId, L"sun_VBoxNetAdp")) 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 else 495 { 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 }
Note:
See TracChangeset
for help on using the changeset viewer.