VirtualBox

Ignore:
Timestamp:
Aug 25, 2015 10:57:43 AM (9 years ago)
Author:
vboxsync
Message:

Main/Network: Yet another attempt to find the root cause of failure to obtain INetCfg (#7993)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/win/NetIf-win.cpp

    r57485 r57536  
    14741474                       &lpszApp);
    14751475    Assert(hr == S_OK);
     1476    if (hr != S_OK)
     1477    {
     1478        if (pNc)
     1479            pNc->Release();
     1480        pNc = NULL;
     1481        LogRel(("NetIfList: failed to acquire INetCfg interface (0x%x), trying CoCreateInstance...\n", hr));
     1482        hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_INetCfg, (PVOID*)&pNc);
     1483        if (SUCCEEDED(hr))
     1484        {
     1485            hr = pNc->Initialize(NULL);
     1486            if (FAILED(hr))
     1487            {
     1488                LogRel(("NetIfList: INetCfg::Initialize failed with 0x%x\n", hr));
     1489                if (pNc)
     1490                    pNc->Release();
     1491                pNc = NULL;
     1492            }
     1493        }
     1494        else
     1495            LogRel(("NetIfList: CoCreateInstance failed with 0x%x\n", hr));
     1496    }
     1497
    14761498    if (hr == S_OK)
    14771499    {
     
    16131635        VBoxNetCfgWinReleaseINetCfg(pNc, FALSE);
    16141636    }
    1615     else
    1616     {
    1617         if (pNc)
    1618             pNc->Release();
    1619         pNc = NULL;
    1620         LogRel(("NetIfList: failed to acquire INetCfg interface (0x%x), trying CoCreateInstance...\n", hr));
    1621         hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_INetCfg, (PVOID*)&pNc);
    1622         LogRel(("NetIfList: CoCreateInstance failed with 0x%x\n", hr));
    1623         if (pNc)
    1624             pNc->Release();
    1625     }
    16261637
    16271638    return VINF_SUCCESS;
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