Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Thanks for the additional diagnostic information that you gave in the comments. Your description of the problem has allowed me to isolate this as a bug in Windows.</p> <p>The problem occurs when first installing a filter. NDIS may, in some cases, ignore the notification that the bindings on a miniport have changed, if the filter driver hasn't started in kernelmode yet.</p> <p>There are several workarounds - as you've noted, one workaround is to change the StartType of the filter. Another workaround would be to use INetCfg to disable and re-enable the filter bindings to each miniport after installation. You can also disable and re-enable the miniports, or reboot the computer, although those are rather disruptive workarounds.</p> <p>&#x2713; This bug does not affect Windows 7.<br> &#x2717; This bug affects Windows 8 and Windows Server 2012.<br> &#x2713; This bug does not affect Windows 8.1 and Windows Server 2012 R2. (I unknowingly fixed this bug while cleaning up some code in NDIS.)</p> <p>If you cannot wait for the free Windows 8.1 update <a href="http://blogs.windows.com/windows/b/bloggingwindows/archive/2013/08/27/readying-windows-8-1-for-release.aspx" rel="nofollow">to roll out to all Windows 8 machines</a>, you can contact Microsoft WDK support. Please reference WindowsSE:452306 so that they can find my notes on the issue, or have them contact me internally.</p> <pre><code>// // DisableEnableBindings // // Purpose: This code can be used to quickly disable/enable all bindings to a particular // NDIS protocol or filter. // // Usage: Run this and provide the name of a NetCfg component. For example, "ms_pacer". #include &lt;Windows.h&gt; #include &lt;netcfgx.h&gt; #include &lt;atlbase.h&gt; #include &lt;atlcom.h&gt; #include &lt;stdio.h&gt; #include &lt;vector&gt; #define MY_APP_NAME L"DisableEnableBindings test app" bool RestartAllBindings(INetCfg *netcfg, PCWSTR name) { HRESULT hr; CComPtr&lt;INetCfgComponent&gt; comp; CComPtr&lt;INetCfgComponentBindings&gt; bindings; hr = netcfg-&gt;FindComponent(name, &amp;comp); if (FAILED(hr)) { wprintf(L"INetCfg::FindComponent 0x%08x\n", hr); return false; } hr = comp.QueryInterface(&amp;bindings); if (FAILED(hr)) { wprintf(L"QueryInterface(INetCfgComponentBindings) 0x%08x\n", hr); return false; } CComPtr&lt;IEnumNetCfgBindingPath&gt; enumerator; hr = bindings-&gt;EnumBindingPaths(EBP_BELOW, &amp;enumerator); if (FAILED(hr)) { wprintf(L"INetCfgComponentBindings::EnumBindingPaths 0x%08x\n", hr); return false; } // Loop over all bindings that involve this component while (true) { CComPtr&lt;INetCfgBindingPath&gt; path; hr = enumerator-&gt;Next(1, &amp;path, nullptr); if (hr == S_FALSE) { // Reached end of list; quit. break; } if (FAILED(hr)) { wprintf(L"IEnumNetCfgBindingPath::Next 0x%08x\n", hr); return false; } PWSTR token = nullptr; hr = path-&gt;GetPathToken(&amp;token); if (FAILED(hr)) { wprintf(L"INetCfgBindingPath::GetPathToken 0x%08x\n", hr); continue; } wprintf(L"Found binding %s\n", token); CoTaskMemFree(token); hr = path-&gt;IsEnabled(); if (FAILED(hr)) { wprintf(L"INetCfgBindingPath::IsEnabled 0x%08x\n", hr); continue; } if (S_FALSE == hr) { wprintf(L"\tPath is already disabled. Skipping over it.\n"); continue; } // Diable hr = path-&gt;Enable(FALSE); if (FAILED(hr)) { wprintf(L"INetCfgBindingPath::Enable(FALSE) 0x%8x\n", hr); continue; } hr = netcfg-&gt;Apply(); if (FAILED(hr)) { wprintf(L"INetCfg::Apply 0x%08x\n", hr); return false; } wprintf(L"\tPath disabled\n"); // Enable hr = path-&gt;Enable(TRUE); if (FAILED(hr)) { wprintf(L"INetCfgBindingPath::Enable(TRUE) 0x%8x\n", hr); return false; } hr = netcfg-&gt;Apply(); if (FAILED(hr)) { wprintf(L"INetCfg::Apply 0x%08x\n", hr); return false; } wprintf(L"\tPath enabled\n"); } return true; } bool ConnectToNetCfg(PCWSTR name) { HRESULT hr; CComPtr&lt;INetCfg&gt; netcfg; CComPtr&lt;INetCfgLock&gt; lock; // Before we can get started, we need to do some initialization work. hr = netcfg.CoCreateInstance(CLSID_CNetCfg); if (FAILED(hr)) { wprintf(L"CoCreateInstance(CLSID_CNetCfg 0x%08x\n", hr); return false; } hr = netcfg.QueryInterface(&amp;lock); if (FAILED(hr)) { wprintf(L"QueryInterface(INetCfgLock) 0x%08x\n", hr); return false; } // Note that this call can block. hr = lock-&gt;AcquireWriteLock(INFINITE, MY_APP_NAME, nullptr); if (FAILED(hr)) { wprintf(L"INetCfgLock::AcquireWriteLock 0x%08x\n", hr); return false; } hr = netcfg-&gt;Initialize(nullptr); if (FAILED(hr)) { wprintf(L"INetCfg::Initialize 0x%08x\n", hr); return false; } bool ok = RestartAllBindings(netcfg.p, name); hr = netcfg-&gt;Uninitialize(); if (FAILED(hr)) { wprintf(L"INetCfg::Uninitialize 0x%08x\n", hr); } hr = lock-&gt;ReleaseWriteLock(); if (FAILED(hr)) { wprintf(L"INetCfgLock::ReleaseWriteLock 0x%08x\n", hr); } return ok; } int wmain(int argc, wchar_t **argv) { if (argc != 2) { wprintf(L"Usage: DisableEnableBindings &lt;componentId&gt;\n"); return 2; } PCWSTR name = argv[1]; CComPtr&lt;INetCfg&gt; netcfg; CComPtr&lt;INetCfgLock&gt; lock; HRESULT hr; hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr)) { wprintf(L"CoInitializeEx 0x%08x\n", hr); return 1; } bool ok = ConnectToNetCfg(name); CoUninitialize(); wprintf(ok ? L"Succeeded.\n" : L"Failed.\n"); return ok ? 0 : 1; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload