Changeset 17275 in vbox for trunk/src/VBox/Main/win
- Timestamp:
- Mar 3, 2009 1:28:12 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43635
- Location:
- trunk/src/VBox/Main/win
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/win/NetIfList-win.cpp
r17229 r17275 361 361 } 362 362 363 static HRESULT VBoxNetCfgWinEnableDHCP(IWbemServices * pSvc, IWbemClassObject *pObj, in_addr* aIp, in_addr * aMask, UINT cIp) 364 { 365 IWbemClassObject * pClass; 366 BSTR ClassName = SysAllocString(L"Win32_NetworkAdapterConfiguration"); 367 HRESULT hr; 368 if(ClassName) 369 { 370 hr = pSvc->GetObject(ClassName, 0, NULL, &pClass, NULL); 371 if(SUCCEEDED(hr)) 372 { 373 BSTR ObjPath; 374 hr = netIfAdapterConfigPath(pObj, &ObjPath); 375 if(SUCCEEDED(hr)) 376 { 377 IWbemClassObject * pOutParams; 378 379 hr = netIfExecMethod(pSvc, pClass, ObjPath, 380 bstr_t(L"EnableDHCP"), NULL, NULL, 0, &pOutParams); 381 if(SUCCEEDED(hr)) 382 { 383 } 384 SysFreeString(ObjPath); 385 } 386 pClass->Release(); 387 } 388 SysFreeString(ClassName); 389 } 390 else 391 { 392 DWORD dwError = GetLastError(); 393 Assert(0); 394 hr = HRESULT_FROM_WIN32( dwError ); 395 } 396 397 return hr; 398 } 363 399 364 400 static int collectNetIfInfo(Bstr &strName, PNETIFINFO pInfo) … … 448 484 else 449 485 memcpy(pInfo->MACAddress.au8, pAdapter->PhysicalAddress, sizeof(pInfo->MACAddress)); 450 pInfo->enm Type = NETIF_T_ETHERNET;486 pInfo->enmMediumType = NETIF_T_ETHERNET; 451 487 pInfo->enmStatus = pAdapter->OperStatus == IfOperStatusUp ? NETIF_S_UP : NETIF_S_DOWN; 452 488 RTStrFree(pszUuid); … … 464 500 # define VBOX_APP_NAME L"VirtualBox" 465 501 466 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc, bool bReal)502 static int vboxNetWinAddComponent(std::list <ComObjPtr <HostNetworkInterface> > * pPist, INetCfgComponent * pncc, HostNetworkInterfaceType enmType) 467 503 { 468 504 LPWSTR lpszName; … … 496 532 iface.createObject(); 497 533 /* remove the curly bracket at the end */ 498 if (SUCCEEDED (iface->init (name, bReal, &Info)))534 if (SUCCEEDED (iface->init (name, enmType, &Info))) 499 535 { 500 536 pPist->push_back (iface); … … 624 660 if(!_wcsnicmp(pId, L"sun_VBoxNetAdp", sizeof(L"sun_VBoxNetAdp")/2)) 625 661 { 626 vboxNetWinAddComponent(&list, pMpNcc, false);662 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_HostOnly); 627 663 } 628 664 CoTaskMemFree(pId); … … 765 801 } 766 802 767 if (SUCCEEDED (iface->init (name, TRUE, &Info)))803 if (SUCCEEDED (iface->init (name, HostNetworkInterfaceType_Bridged, &Info))) 768 804 list.push_back (iface); 769 805 } … … 841 877 if(uComponentStatus == 0) 842 878 { 843 vboxNetWinAddComponent(&list, pMpNcc, true);879 vboxNetWinAddComponent(&list, pMpNcc, HostNetworkInterfaceType_Bridged); 844 880 } 845 881 } -
trunk/src/VBox/Main/win/svchlp.cpp
r13835 r17275 272 272 switch (msgCode) 273 273 { 274 case SVCHlpMsg::CreateHost NetworkInterface:275 case SVCHlpMsg::RemoveHost NetworkInterface:274 case SVCHlpMsg::CreateHostOnlyNetworkInterface: 275 case SVCHlpMsg::RemoveHostOnlyNetworkInterface: 276 276 { 277 277 vrc = Host::networkInterfaceHelperServer (this, msgCode); -
trunk/src/VBox/Main/win/svchlp.h
r14948 r17275 38 38 Error, /* Utf8Str string (may be null but must present) */ 39 39 40 CreateHost NetworkInterface = 100, /* see usage in code */41 CreateHost NetworkInterface_OK, /* see usage in code */42 RemoveHost NetworkInterface, /* see usage in code */40 CreateHostOnlyNetworkInterface = 100, /* see usage in code */ 41 CreateHostOnlyNetworkInterface_OK, /* see usage in code */ 42 RemoveHostOnlyNetworkInterface, /* see usage in code */ 43 43 }; 44 44 };
Note:
See TracChangeset
for help on using the changeset viewer.