Index: /trunk/src/VBox/Main/ConsoleImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 16206)
+++ /trunk/src/VBox/Main/ConsoleImpl.cpp	(revision 16207)
@@ -4253,18 +4253,6 @@
                 ComPtr<IHost> host;
                 virtualBox->COMGETTER(Host)(host.asOutParam());
-                com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
-                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)
+                ComPtr<IHostNetworkInterface> hostInterface;
+                if (!SUCCEEDED(host->FindHostNetworkInterfaceByName(hostif, hostInterface.asOutParam())))
                 {
                     return setError (VBOX_E_HOST_ERROR,
Index: /trunk/src/VBox/Main/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 16206)
+++ /trunk/src/VBox/Main/ConsoleImpl2.cpp	(revision 16207)
@@ -1322,23 +1322,7 @@
 
 # elif defined(RT_OS_WINDOWS)
-                    com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
-                    hrc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces));
-                    if(FAILED(hrc))
-                    {
-                        LogRel(("NetworkAttachmentType_HostInterface: COMGETTER(NetworkInterfaces) failed, hrc (0x%x)", hrc));
-                        H();
-                    }
                     ComPtr<IHostNetworkInterface> hostInterface;
-                    for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
-                    {
-                        Bstr name;
-                        hostNetworkInterfaces[i]->COMGETTER(Name) (name.asOutParam());
-                        if (name == HifName)
-                        {
-                            hostInterface = hostNetworkInterfaces[i];
-                            break;
-                        }
-                    }
-                    if (hostInterface.isNull())
+                    rc = host->FindHostNetworkInterfaceByName(HifName, hostInterface.asOutParam());
+                    if (!SUCCEEDED(rc))
                     {
                         AssertBreakpoint();
@@ -1518,18 +1502,7 @@
                     Bstr hostInterfaceName;
                     hrc = networkAdapter->COMGETTER(HostInterface)(hostInterfaceName.asOutParam()); H();
-                    com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
-                    hrc = host->COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)); H();
                     ComPtr<IHostNetworkInterface> hostInterface;
-                    for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
-                    {
-                        Bstr name;
-                        hostNetworkInterfaces[i]->COMGETTER(Name) (name.asOutParam());
-                        if (name == hostInterfaceName)
-                        {
-                            hostInterface = hostNetworkInterfaces[i];
-                            break;
-                        }
-                    }
-                    if (hostInterface.isNull())
+                    rc = host->FindHostNetworkInterfaceByName(hostInterfaceName, hostInterface.asOutParam());
+                    if (!SUCCEEDED(rc))
                     {
                         AssertMsgFailed(("Cannot get GUID for host interface '%ls'\n", hostInterfaceName));
Index: /trunk/src/VBox/Main/HostImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/HostImpl.cpp	(revision 16206)
+++ /trunk/src/VBox/Main/HostImpl.cpp	(revision 16207)
@@ -1386,17 +1386,8 @@
     /* first check whether an interface with the given name already exists */
     {
-        com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
-        rc = COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces));
-        CheckComRCReturnRC (rc);
-        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);
-            }
-        }
+        ComPtr <IHostNetworkInterface> iface;
+        if (SUCCEEDED (FindHostNetworkInterfaceByName (aName, iface.asOutParam())))
+            return setError (E_INVALIDARG,
+                             tr ("Host network interface '%ls' already exists"), aName);
     }
 
@@ -1454,19 +1445,6 @@
     /* first check whether an interface with the given name already exists */
     {
-        com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
-        rc = COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces));
-        CheckComRCReturnRC (rc);
         ComPtr <IHostNetworkInterface> iface;
-        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())
+        if (FAILED (FindHostNetworkInterfaceById (aId, iface.asOutParam())))
             return setError (VBOX_E_OBJECT_NOT_FOUND,
                 tr ("Host network interface with UUID {%RTuuid} does not exist"),
