VirtualBox

Ignore:
Timestamp:
Apr 21, 2016 11:48:49 PM (9 years ago)
Author:
vboxsync
Message:

hostdrivers/VBoxNetFlt/cfg: fix for ​​bugref:8335: disabled setting metric for NetLwf.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp

    r60620 r60638  
    6161#define VBOX_NETCFG_LOCK_TIME_OUT     5000  /** @todo r=bird: What does this do? */
    6262
     63#define VBOXNETCFGWIN_NETADP_ID L"sun_VBoxNetAdp"
    6364
    6465/*
     
    324325            */
    325326            res = pTempComponent->OpenParamKey(&hkey);
    326             if(SUCCEEDED(res) && hkey != NULL)
     327
     328            /* Set default metric value for host-only interface only */
     329            if (SUCCEEDED(res) && hkey != NULL && wcsnicmp(pszwComponentId, VBOXNETCFGWIN_NETADP_ID, 256) == 0)
     330            {
    327331                res = vboxNetCfgWinSetupMetric(hkey);
    328             if (FAILED(res))
    329             {
    330                 /* 
    331                  *   The setting of Metric is not very important functionality,
    332                  *   So we will not break installation process due to this error.
    333                  */
    334                 NonStandardLogFlow(("VBoxNetCfgWinInstallComponent Warning! "
    335                                     "vboxNetCfgWinSetupMetric failed, default metric "
    336                                     "for new interface will not be set, hr (0x%x)\n", res));
     332                if (FAILED(res))
     333                {
     334                    /*
     335                     *   The setting of Metric is not very important functionality,
     336                     *   So we will not break installation process due to this error.
     337                     */
     338                    NonStandardLogFlow(("VBoxNetCfgWinInstallComponent Warning! "
     339                        "vboxNetCfgWinSetupMetric failed, default metric "
     340                        "for new interface will not be set, hr (0x%x)\n", res));
     341                }
    337342            }
    338343            if (ppComponent != NULL)
     
    21652170}
    21662171
    2167 #define VBOXNETCFGWIN_NETADP_ID L"sun_VBoxNetAdp"
    21682172static HRESULT vboxNetCfgWinNetAdpUninstall(IN INetCfg *pNc, LPCWSTR pwszId, DWORD InfRmFlags)
    21692173{
     
    34253429
    34263430    rc = g_pfnGetIpInterfaceEntry(&row);
    3427     if (rc != 0)
    3428         return E_FAIL;
     3431    if (rc != NO_ERROR)
     3432        return HRESULT_FROM_WIN32(rc);
    34293433
    34303434    *Metric = row.Metric;
     
    34523456
    34533457    // change settings
    3454     return g_pfnSetIpInterfaceEntry(&newRow);
     3458    return HRESULT_FROM_WIN32(g_pfnSetIpInterfaceEntry(&newRow));
    34553459}
    34563460
     
    34693473    res = RegQueryValueExW(hKey, L"NetLuidIndex", NULL,
    34703474        &dwValueType, (LPBYTE)&luidIndex, &cbSize);
    3471     if (FAILED(res))
    3472         return res;
     3475    if (res != 0)
     3476        return HRESULT_FROM_WIN32(res);
    34733477
    34743478    cbSize = sizeof(ifType);
     
    34763480    res = RegQueryValueExW(hKey, L"*IfType", NULL,
    34773481        &dwValueType, (LPBYTE)&ifType, &cbSize);
    3478     if (FAILED(res))
    3479         return res;
     3482    if (res != 0)
     3483        return HRESULT_FROM_WIN32(res);
    34803484
    34813485    ZeroMemory(pLUID, sizeof(NET_LUID));
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