VirtualBox

Ignore:
Timestamp:
Dec 16, 2008 10:39:34 AM (16 years ago)
Author:
vboxsync
Message:

#3282: Collection got replaced with safe array. Warning, windows builds/tests may break.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r15448 r15570  
    42984298                ComPtr<IHost> host;
    42994299                virtualBox->COMGETTER(Host)(host.asOutParam());
    4300                 ComPtr<IHostNetworkInterfaceCollection> coll;
    4301                 host->COMGETTER(NetworkInterfaces)(coll.asOutParam());
    4302                 ComPtr<IHostNetworkInterface> hostInterface;
    4303                 if (!SUCCEEDED(coll->FindByName(hostif, hostInterface.asOutParam())))
     4300                com::SafeIfaceArray <IHostNetworkInterface> hostNetworkInterfaces;
     4301                CHECK_ERROR(host,
     4302                            COMGETTER(NetworkInterfaces) (ComSafeArrayAsOutParam (hostNetworkInterfaces)));
     4303                bool found = false;
     4304                for (size_t i = 0; i < hostNetworkInterfaces.size(); ++i)
     4305                {
     4306                    Bstr name;
     4307                    hostNetworkInterfaces[i].COMGETTER(Name) (name.asOutParam());
     4308                    if (name == hostif)
     4309                    {
     4310                        found = true;
     4311                        break;
     4312                    }
     4313                }
     4314                if (!found)
    43044315                {
    43054316                    return setError (VBOX_E_HOST_ERROR,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette