VirtualBox

Ignore:
Timestamp:
Jun 16, 2015 8:28:30 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101081
Message:

Installer/Win: Bump MaxNumFilters to 14 upon NetLwf installation (#7899)

File:
1 edited

Legend:

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

    r56293 r56464  
    21232123}
    21242124
     2125static void VBoxNetCfgWinFilterLimitWorkaround(void)
     2126{
     2127    /*
     2128     * Need to check if the system has a limit of installed filter drivers. If it
     2129     * has, bump the limit to 14, which the maximum value supported by Windows 7.
     2130     * Note that we only touch the limit if it is set to the default value (8).
     2131     * See @bugref{7899}.
     2132     */
     2133    HKEY hNetKey;
     2134    DWORD dwMaxNumFilters = 0;
     2135    DWORD cbMaxNumFilters = sizeof(dwMaxNumFilters);
     2136    LONG hr = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
     2137                           _T("SYSTEM\\CurrentControlSet\\Control\\Network"),
     2138                           0, KEY_QUERY_VALUE | KEY_SET_VALUE, &hNetKey);
     2139    if (SUCCEEDED(hr))
     2140    {
     2141        hr = RegQueryValueEx(hNetKey, _T("MaxNumFilters"), NULL, NULL,
     2142                             (LPBYTE)&dwMaxNumFilters, &cbMaxNumFilters);
     2143        if (SUCCEEDED(hr) && cbMaxNumFilters == sizeof(dwMaxNumFilters) && dwMaxNumFilters == 8)
     2144        {
     2145            dwMaxNumFilters = 14;
     2146            hr = RegSetValueEx(hNetKey, _T("MaxNumFilters"), 0, REG_DWORD,
     2147                             (LPBYTE)&dwMaxNumFilters, sizeof(dwMaxNumFilters));
     2148            if (SUCCEEDED(hr))
     2149                NonStandardLog("Adjusted the installed filter limit to 14...\n");
     2150            else
     2151                NonStandardLog("Failed to set MaxNumFilters, error code 0x%x\n", hr);
     2152        }
     2153        RegCloseKey(hNetKey);
     2154    }
     2155    else
     2156    {
     2157        NonStandardLog("Failed to open network key, error code 0x%x\n", hr);
     2158    }
     2159
     2160}
     2161
    21252162VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetLwfInstall(IN INetCfg *pNc,
    21262163                                                       IN LPCWSTR const pInfFullPath)
     
    21292166    if (SUCCEEDED(hr))
    21302167    {
     2168        VBoxNetCfgWinFilterLimitWorkaround();
    21312169        NonStandardLog("NetLwf will be installed ...\n");
    21322170        hr = vboxNetCfgWinInstallInfAndComponent(pNc, VBOXNETCFGWIN_NETLWF_ID,
Note: See TracChangeset for help on using the changeset viewer.

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