From: David R. Cattley on
Calling NdisOpenAdapter() outside the 'scope' of a call to
ProtocolBindAdapter(). If you note in the DDK docs for NdisOpenAdapter()
it says:

<ddkdocs>
NDIS no longer supports calling NdisOpenAdapter from the DriverEntry
function, which was an option available to legacy (V3.0) protocols. NDIS no
longer supports V3.0 protocols. NDIS fails any attempt to call
NdisOpenAdapter outside the context of ProtocolBindAdapter.
</ddkdocs>

Well, in NDIS5 it was still possible to make this work but technically
illegal. In NDIS6 I am guessing it might now be a bigger problem since so
much more activity needs to be synchronized when 'binding' an IM driver.
Again, that is a guess.

What specifically are you trying to accomplish? Why do you need to
manipulate the 'bindings' directly instead of through INetCfg (to
enable/disable them)?

If your protocol needs to close or re-open adapters to which it is bound, it
can do so by calling NdisCloseAdapter() at any time and then
NdisReEnumerateProtocolBindings() when it wants to have another (legally
syncronized) chance at binding to an adapter it has closed.

Good Luck
Dave Cattley
Consulting Engineer
Systems Software Development

"lgonhia" <lgonhia(a)discussions.microsoft.com> wrote in message
news:FE5BD311-AC7E-4D1A-95E5-A71827E2EE15(a)microsoft.com...
> Thanks for your answer.
>
> The ProtocolBind is my code.
> It is works well in windows 2K,XP,2k3.
> It is not using the INetCfg interfaces .It calls the NdisOpenAdapter
> directly
> (as the wireshark).
>
> The ProtocolBind processed the PnP notifications (from NDIS) and
> promptly unbind when requested.
>
>
> My question :
> 1,It must use NETCFG to bind a protocol driver?
> 2,If it doesn't use the NETCFG ,how to improve the binding process.
>
> Thank you.
>