Changeset 56464 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/win
- Timestamp:
- Jun 16, 2015 8:28:30 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 101081
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/cfg/VBoxNetCfg.cpp
r56293 r56464 2123 2123 } 2124 2124 2125 static 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 2125 2162 VBOXNETCFGWIN_DECL(HRESULT) VBoxNetCfgWinNetLwfInstall(IN INetCfg *pNc, 2126 2163 IN LPCWSTR const pInfFullPath) … … 2129 2166 if (SUCCEEDED(hr)) 2130 2167 { 2168 VBoxNetCfgWinFilterLimitWorkaround(); 2131 2169 NonStandardLog("NetLwf will be installed ...\n"); 2132 2170 hr = vboxNetCfgWinInstallInfAndComponent(pNc, VBOXNETCFGWIN_NETLWF_ID,
Note:
See TracChangeset
for help on using the changeset viewer.