Changeset 10896 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 25, 2008 11:58:01 PM (17 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HostImpl.cpp
r10753 r10896 81 81 #include "HostDVDDriveImpl.h" 82 82 #include "HostFloppyDriveImpl.h" 83 #include "HostNetworkInterfaceImpl.h" 83 84 #ifdef VBOX_WITH_USB 84 85 # include "HostUSBDeviceImpl.h" … … 94 95 #endif 95 96 96 #ifdef RT_OS_WINDOWS97 # include "HostNetworkInterfaceImpl.h"98 #endif99 97 100 98 #include <VBox/usb.h> … … 454 452 455 453 #ifdef RT_OS_WINDOWS 456 454 /** 455 * Windows helper function for Host::COMGETTER(NetworkInterfaces). 456 * 457 * @returns true / false. 458 * 459 * @param guid The GUID. 460 */ 457 461 static bool IsTAPDevice(const char *guid) 458 462 { … … 467 471 return false; 468 472 469 while(true)473 for (;;) 470 474 { 471 475 char szEnumName[256]; … … 482 486 if (status == ERROR_SUCCESS) 483 487 { 484 len = sizeof 488 len = sizeof(szNetCfgInstanceId); 485 489 status = RegQueryValueExA(hNetCardGUID, "NetCfgInstanceId", NULL, &dwKeyType, (LPBYTE)szNetCfgInstanceId, &len); 486 490 if (status == ERROR_SUCCESS && dwKeyType == REG_SZ) … … 499 503 if ( !strcmp(szNetCfgInstanceId, guid) 500 504 && !strcmp(szNetProductName, "VirtualBox TAP Adapter") 501 && (!strcmp(szNetProviderName, "innotek GmbH") || !strcmp(szNetProviderName, "Sun Microsystems, Inc."))) 505 && ( !strcmp(szNetProviderName, "innotek GmbH") 506 || !strcmp(szNetProviderName, "Sun Microsystems, Inc."))) 502 507 { 503 508 ret = true; … … 511 516 } 512 517 513 RegCloseKey 518 RegCloseKey(hNetcard); 514 519 return ret; 515 520 } 521 #endif /* RT_OS_WINDOWS */ 516 522 517 523 /** … … 523 529 STDMETHODIMP Host::COMGETTER(NetworkInterfaces) (IHostNetworkInterfaceCollection **networkInterfaces) 524 530 { 531 #if defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN) /*|| defined(RT_OS_SOLARIS)*/ /*|| defined(RT_OS_OS2)*/ 525 532 if (!networkInterfaces) 526 533 return E_POINTER; … … 530 537 std::list <ComObjPtr <HostNetworkInterface> > list; 531 538 539 # if defined(RT_OS_DARWIN) 540 PDARWINETHERNIC pEtherNICs = DarwinGetEthernetControllers(); 541 while (pEtherNICs) 542 { 543 ComObjPtr<HostNetworkInterface> IfObj; 544 IfObj.createObject(); 545 if (SUCCEEDED(IfObj->init(Bstr(pEtherNICs->szName), Guid(pEtherNICs->Uuid)))) 546 list.push_back(IfObj); 547 548 /* next, free current */ 549 void *pvFree = pEtherNICs; 550 pEtherNICs = pEtherNICs->pNext; 551 RTMemFree(pvFree); 552 } 553 554 # elif defined RT_OS_WINDOWS 532 555 static const char *NetworkKey = "SYSTEM\\CurrentControlSet\\Control\\Network\\" 533 556 "{4D36E972-E325-11CE-BFC1-08002BE10318}"; … … 585 608 } 586 609 RegCloseKey (hCtrlNet); 610 # endif /* RT_OS_WINDOWS */ 587 611 588 612 ComObjPtr <HostNetworkInterfaceCollection> collection; … … 591 615 collection.queryInterfaceTo (networkInterfaces); 592 616 return S_OK; 593 } 594 #endif /* RT_OS_WINDOWS */ 617 618 #else 619 /* Not implemented / supported on this platform. */ 620 return E_NOTIMPL; 621 #endif 622 } 595 623 596 624 STDMETHODIMP Host::COMGETTER(USBDevices)(IHostUSBDeviceCollection **aUSBDevices) -
trunk/src/VBox/Main/Makefile.kmk
r10868 r10896 217 217 HostDVDDriveImpl.cpp \ 218 218 HostFloppyDriveImpl.cpp \ 219 HostNetworkInterfaceImpl.cpp \ 219 220 GuestOSTypeImpl.cpp \ 220 221 NetworkAdapterImpl.cpp \ … … 236 237 237 238 VBoxSVC_SOURCES.win = \ 238 HostNetworkInterfaceImpl.cpp \239 239 win/svcmain.cpp \ 240 240 win/svchlp.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r10797 r10896 2763 2763 <desc> 2764 2764 This setting determines whether VirtualBox will try to make use of 2765 the nested paging extension of Intel VT-x and AMD-V. Note that in case 2765 the nested paging extension of Intel VT-x and AMD-V. Note that in case 2766 2766 such extensions are not available, they will not be used. 2767 2767 </desc> … … 4853 4853 </collection> 4854 4854 4855 <if target="midl">4856 4855 <interface 4857 4856 name="IHostNetworkInterface" extends="$unknown" … … 4910 4909 </method> 4911 4910 </collection> 4912 </if>4913 4911 4914 4912 <interface 4915 4913 name="IHost" extends="$unknown" 4916 uuid=" 3d864057-ae6b-4d05-9cf7-c341139b6062"4914 uuid="D56DC1AF-8D1B-4A06-86D7-26016E0E2B74" 4917 4915 wsmap="managed" 4918 4916 > … … 4978 4976 </attribute> 4979 4977 4980 <if target="midl">4981 4978 <attribute name="networkInterfaces" type="IHostNetworkInterfaceCollection" readonly="yes"> 4982 4979 <desc>List of host network interfaces currently defined on the host.</desc> 4983 4980 </attribute> 4984 </if>4985 4981 4986 4982 <attribute name="processorCount" type="unsigned long" readonly="yes"> … … 10340 10336 <param name="period" type="unsigned long" dir="in"> 10341 10337 <desc> 10342 Time interval in seconds between two consecutive samples of performace 10338 Time interval in seconds between two consecutive samples of performace 10343 10339 data. 10344 10340 </desc> … … 10346 10342 <param name="count" type="unsigned long" dir="in"> 10347 10343 <desc> 10348 Number of samples to retain in performance data history. Older samples 10344 Number of samples to retain in performance data history. Older samples 10349 10345 get discarded. 10350 10346 </desc> … … 10397 10393 <desc> 10398 10394 Queries collected metrics data for a set of objects. 10399 10395 10400 10396 The data itself and related metric information are returned in four 10401 10397 parallel and one flattened array of arrays. Elements of @c 10402 returnMetricNames, @c returnObjects, @c returnDataIndices and @ 10403 returnDataLengths with the same index describe one set of values 10398 returnMetricNames, @c returnObjects, @c returnDataIndices and @ 10399 returnDataLengths with the same index describe one set of values 10404 10400 corresponding to a single metric. 10405 10401 … … 10448 10444 <param name="returnData" type="long" dir="return" safearray="yes"> 10449 10445 <desc> 10450 Flattened array of all metric data containing sequences of values for 10446 Flattened array of all metric data containing sequences of values for 10451 10447 each metric. 10452 10448 </desc> -
trunk/src/VBox/Main/include/HostImpl.h
r10595 r10896 80 80 STDMETHOD(COMGETTER(USBDevices))(IHostUSBDeviceCollection **aUSBDevices); 81 81 STDMETHOD(COMGETTER(USBDeviceFilters))(IHostUSBDeviceFilterCollection ** aUSBDeviceFilters); 82 #ifdef RT_OS_WINDOWS83 82 STDMETHOD(COMGETTER(NetworkInterfaces))(IHostNetworkInterfaceCollection **networkInterfaces); 84 #endif85 83 STDMETHOD(COMGETTER(ProcessorCount))(ULONG *count); 86 84 STDMETHOD(GetProcessorSpeed)(ULONG cpuId, ULONG *speed); -
trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
r8155 r10896 22 22 #ifndef ____H_HOSTNETWORKINTERFACEIMPL 23 23 #define ____H_HOSTNETWORKINTERFACEIMPL 24 25 #ifndef RT_OS_WINDOWS26 #error This is Windows only stuff!27 #endif28 24 29 25 #include "VirtualBoxBase.h" -
trunk/src/VBox/Main/xpcom/server.cpp
r10544 r10896 102 102 #include <HostDVDDriveImpl.h> 103 103 #include <HostFloppyDriveImpl.h> 104 #include <HostNetworkInterfaceImpl.h> 104 105 #include <GuestOSTypeImpl.h> 105 106 #include <NetworkAdapterImpl.h> … … 165 166 NS_DECL_CLASSINFO(HostFloppyDrive) 166 167 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostFloppyDrive, IHostFloppyDrive) 168 NS_DECL_CLASSINFO(HostNetworkInterface) 169 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface) 167 170 NS_DECL_CLASSINFO(GuestOSType) 168 171 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(GuestOSType, IGuestOSType) … … 205 208 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive) 206 209 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive) 210 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostNetworkInterface) 207 211 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HardDisk) 208 212 COM_IMPL_READONLY_ENUM_AND_COLLECTION(DVDImage)
Note:
See TracChangeset
for help on using the changeset viewer.