Index: trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 15568)
+++ trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 15570)
@@ -4298,8 +4298,19 @@
                 ComPtr<IHost> host;
                 virtualBox->COMGETTER(Host)(host.asOutParam());
-                ComPtr<IHostNetworkInterfaceCollection> coll;
-                host->COMGETTER(NetworkInterfaces)(coll.asOutParam());
-                ComPtr<IHostNetworkInterface> hostInterface;
-                if (!SUCCEEDED(coll->FindByName(hostif, hostInterface.asOutParam())))
+                com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
+                CHECK_ERROR(host, 
+                            COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
+                bool found = false;
+                for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
+                {
+                    Bstr name;
+                    hostNetworkInterfaces[i].COMGETTER(Name) (name.asOutParam());
+                    if (name == hostif)
+                    {
+                        found = true;
+                        break;
+                    }
+                }
+                if (!found)
                 {
                     return setError (VBOX_E_HOST_ERROR,
Index: trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 15568)
+++ trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 15570)
@@ -1312,6 +1312,6 @@
 
 # elif defined(RT_OS_WINDOWS)
-                    ComPtr<IHostNetworkInterfaceCollection> coll;
-                    hrc = host->COMGETTER(NetworkInterfaces)(coll.asOutParam());
+                    com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
+                    hrc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
                     if(FAILED(hrc))
                     {
@@ -1320,6 +1320,15 @@
                     }
                     ComPtr<IHostNetworkInterface> hostInterface;
-                    rc = coll->FindByName(HifName, hostInterface.asOutParam());
-                    if (!SUCCEEDED(rc))
+                    for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
+                    {
+                        Bstr name;
+                        hostNetworkInterfaces[i].COMGETTER(Name) (name.asOutParam());
+                        if (name == hostif)
+                        {
+                            hostInterface = hostNetworkInterfaces[i];
+                            break;
+                        }
+                    }
+                    if (hostInterface.IsNull())
                     {
                         AssertBreakpoint();
@@ -1499,9 +1508,18 @@
                     Bstr hostInterfaceName;
                     hrc = networkAdapter->COMGETTER(HostInterface)(hostInterfaceName.asOutParam()); H();
-                    ComPtr<IHostNetworkInterfaceCollection> coll;
-                    hrc = host->COMGETTER(NetworkInterfaces)(coll.asOutParam());    H();
+                    com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
+                    hrc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces))); H();
                     ComPtr<IHostNetworkInterface> hostInterface;
-                    rc = coll->FindByName(hostInterfaceName, hostInterface.asOutParam());
-                    if (!SUCCEEDED(rc))
+                    for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
+                    {
+                        Bstr name;
+                        hostNetworkInterfaces[i].COMGETTER(Name) (name.asOutParam());
+                        if (name == hostif)
+                        {
+                            hostInterface = hostNetworkInterfaces[i];
+                            break;
+                        }
+                    }
+                    if (hostInterface.IsNull())
                     {
                         AssertMsgFailed(("Cannot get GUID for host interface '%ls'\n", hostInterfaceName));
Index: trunk/src/VBox/Main/HostImpl.cpp
===================================================================
--- trunk/src/VBox/Main/HostImpl.cpp	(revision 15568)
+++ trunk/src/VBox/Main/HostImpl.cpp	(revision 15570)
@@ -751,9 +751,10 @@
  * @param drives address of result pointer
  */
-STDMETHODIMP Host::COMGETTER(NetworkInterfaces) (IHostNetworkInterfaceCollection **networkInterfaces)
+STDMETHODIMP Host::COMGETTER(NetworkInterfaces) (ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces))
 {
 #if defined(RT_OS_WINDOWS) ||  defined(VBOX_WITH_NETFLT) /*|| defined(RT_OS_OS2)*/
-    if (!networkInterfaces)
+    if (ComSafeArrayOutIsNull (aNetworkInterfaces))
         return E_POINTER;
+
     AutoWriteLock alock (this);
     CHECK_READY();
@@ -1056,8 +1057,7 @@
 # endif /* RT_OS_LINUX */
 #endif
-    ComObjPtr <HostNetworkInterfaceCollection> collection;
-    collection.createObject();
-    collection->init (list);
-    collection.queryInterfaceTo (networkInterfaces);
+    SafeIfaceArray <IHostNetworkInterface> networkInterfaces (list);
+    networkInterfaces.detachTo (ComSafeArrayOutArg (aNetworkInterfaces));
+
     return S_OK;
 
@@ -1377,11 +1377,17 @@
     /* first check whether an interface with the given name already exists */
     {
-        ComPtr <IHostNetworkInterfaceCollection> coll;
-        rc = COMGETTER(NetworkInterfaces) (coll.asOutParam());
+        com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
+        rc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
         CheckComRCReturnRC (rc);
-        ComPtr <IHostNetworkInterface> iface;
-        if (SUCCEEDED (coll->FindByName (aName, iface.asOutParam())))
-            return setError (E_INVALIDARG,
-                tr ("Host network interface '%ls' already exists"), aName);
+        for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
+        {
+            Bstr name;
+            hostNetworkInterfaces[i].COMGETTER(Name) (name.asOutParam());
+            if (name == aName)
+            {
+                return setError (E_INVALIDARG,
+                                 tr ("Host network interface '%ls' already exists"), aName);
+            }
+        }
     }
 
@@ -1439,9 +1445,19 @@
     /* first check whether an interface with the given name already exists */
     {
-        ComPtr <IHostNetworkInterfaceCollection> coll;
-        rc = COMGETTER(NetworkInterfaces) (coll.asOutParam());
+        com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
+        rc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
         CheckComRCReturnRC (rc);
         ComPtr <IHostNetworkInterface> iface;
-        if (FAILED (coll->FindById (aId, iface.asOutParam())))
+        for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
+        {
+            Guid guid;
+            hostNetworkInterfaces[i].COMGETTER(Id) (guid.asOutParam());
+            if (guid == aId)
+            {
+                iface = hostNetworkInterfaces[i];
+                break;
+            }
+        }
+        if (iface.IsNull())
             return setError (VBOX_E_OBJECT_NOT_FOUND,
                 tr ("Host network interface with UUID {%RTuuid} does not exist"),
Index: trunk/src/VBox/Main/idl/VirtualBox.xidl
===================================================================
--- trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 15568)
+++ trunk/src/VBox/Main/idl/VirtualBox.xidl	(revision 15570)
@@ -5968,50 +5968,7 @@
   </interface>
 
-  <enumerator
-     name="IHostNetworkInterfaceEnumerator" type="IHostNetworkInterface"
-     uuid="7B52FEF7-56E8-4aec-92F5-15E6D11EC630"
-     />
-
-  <collection
-     name="IHostNetworkInterfaceCollection" type="IHostNetworkInterface"
-     enumerator="IHostNetworkInterfaceEnumerator"
-     uuid="BF1D41F2-B97B-4314-A0FB-D4823AF42FB5"
-     readonly="yes"
-     >
-    <method name="findByName">
-      <desc>
-        Searches this collection for a host network interface with the given name.
-        <note>
-          The method returns an error if the given name does not
-          correspond to any host network interface in the collection.
-        </note>
-      </desc>
-      <param name="name" type="wstring" dir="in">
-        <desc>Name of the host network interface to search for.</desc>
-      </param>
-      <param name="networkInterface" type="IHostNetworkInterface" dir="return">
-        <desc>Found host network interface object.</desc>
-      </param>
-    </method>
-    <method name="findById">
-      <desc>
-        Searches this collection for a host network interface with the given GUID.
-        <note>
-          The method returns an error if the given GUID does not
-          correspond to any host network interface in the collection.
-        </note>
-      </desc>
-      <param name="id" type="uuid" dir="in">
-        <desc>GUID of the host network interface to search for.</desc>
-      </param>
-      <param name="networkInterface" type="IHostNetworkInterface" dir="return">
-        <desc>Found host network interface object.</desc>
-      </param>
-    </method>
-  </collection>
-
   <interface
      name="IHost" extends="$unknown"
-     uuid="4be2e85f-a54c-4bc7-8bf6-f070f9113940"
+     uuid="f39438d7-abfd-409b-bc80-5f5291d92897"
      wsmap="managed"
      >
@@ -6077,5 +6034,5 @@
     </attribute>
 
-    <attribute name="networkInterfaces" type="IHostNetworkInterfaceCollection" readonly="yes">
+    <attribute name="networkInterfaces" type="IHostNetworkInterface" safearray="yes" readonly="yes">
       <desc>List of host network interfaces currently defined on the host.</desc>
     </attribute>
Index: trunk/src/VBox/Main/include/HostImpl.h
===================================================================
--- trunk/src/VBox/Main/include/HostImpl.h	(revision 15568)
+++ trunk/src/VBox/Main/include/HostImpl.h	(revision 15570)
@@ -85,5 +85,5 @@
     STDMETHOD(COMGETTER(USBDevices))(IHostUSBDeviceCollection **aUSBDevices);
     STDMETHOD(COMGETTER(USBDeviceFilters))(IHostUSBDeviceFilterCollection ** aUSBDeviceFilters);
-    STDMETHOD(COMGETTER(NetworkInterfaces))(IHostNetworkInterfaceCollection **networkInterfaces);
+    STDMETHOD(COMGETTER(NetworkInterfaces))(ComSafeArrayOut (IHostNetworkInterface *, aNetworkInterfaces));
     STDMETHOD(COMGETTER(ProcessorCount))(ULONG *count);
     STDMETHOD(COMGETTER(ProcessorOnlineCount))(ULONG *count);
Index: trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h
===================================================================
--- trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h	(revision 15568)
+++ trunk/src/VBox/Main/include/HostNetworkInterfaceImpl.h	(revision 15570)
@@ -99,62 +99,4 @@
 };
 
-COM_DECL_READONLY_ENUM_AND_COLLECTION_BEGIN (HostNetworkInterface)
-
-    STDMETHOD(FindByName) (IN_BSTR name, IHostNetworkInterface **networkInterface)
-    {
-        if (!name)
-            return E_INVALIDARG;
-        if (!networkInterface)
-            return E_POINTER;
-
-        *networkInterface = NULL;
-        Vector::value_type found;
-        Vector::iterator it = vec.begin();
-        while (it != vec.end() && !found)
-        {
-            Bstr n;
-            (*it)->COMGETTER(Name) (n.asOutParam());
-            if (n == name)
-                found = *it;
-            ++ it;
-        }
-
-        if (!found)
-            return setError (E_INVALIDARG, HostNetworkInterfaceCollection::tr (
-                "The host network interface with the given name could not be found"));
-
-        return found.queryInterfaceTo (networkInterface);
-    }
-
-    STDMETHOD(FindById) (IN_GUID id, IHostNetworkInterface **networkInterface)
-    {
-        if (Guid(id).isEmpty())
-            return E_INVALIDARG;
-        if (!networkInterface)
-            return E_POINTER;
-
-        *networkInterface = NULL;
-        Vector::value_type found;
-        Vector::iterator it = vec.begin();
-        while (it != vec.end() && !found)
-        {
-            Guid g;
-            (*it)->COMGETTER(Id) (g.asOutParam());
-            if (g == Guid(id))
-                found = *it;
-            ++ it;
-        }
-
-        if (!found)
-            return setError (E_INVALIDARG, HostNetworkInterfaceCollection::tr (
-                "The host network interface with the given GUID could not be found"));
-
-        return found.queryInterfaceTo (networkInterface);
-    }
-
-
-COM_DECL_READONLY_ENUM_AND_COLLECTION_END (HostNetworkInterface)
-
-
 #endif // ____H_H_HOSTNETWORKINTERFACEIMPL
 /* vi: set tabstop=4 shiftwidth=4 expandtab: */
Index: trunk/src/VBox/Main/xpcom/server.cpp
===================================================================
--- trunk/src/VBox/Main/xpcom/server.cpp	(revision 15568)
+++ trunk/src/VBox/Main/xpcom/server.cpp	(revision 15570)
@@ -235,5 +235,4 @@
 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostDVDDrive)
 COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostFloppyDrive)
-COM_IMPL_READONLY_ENUM_AND_COLLECTION(HostNetworkInterface)
 COM_IMPL_READONLY_ENUM_AND_COLLECTION(SharedFolder)
 #ifdef VBOX_WITH_USB
