Not sure if I got your question fully.
1. If you actually want to "create" new virtual interfaces (i.e.
miniport instances), then you certainly cannot do that from your IM
directly. You need to do that from your IM's Notify Object. See the
MUX sample on how to do that.
2. If you need NDIS to call ProcolBindAdapter() for any newly enabled
NICs (or any thrid-party virtual miniport instances), then the trick
is as follows:
In ProtocolPnPEvent(), for a 'NetPnPEvent' of 'NetEventReconfigure'
*and* a NULL 'ProtocolBindingContext', call
NdisReEnumerateProtocolBindings(). That will make NDIS call your
ProtocolBindAdapter() for any not yet bound lower-edge adapters.
See the docs on NdisReEnumerateProtocolBindings() and the PASSTHRU
sample in the DDK for further info.
HTH, Stephan
---
>Hi all,
>
>Could you please spent few minutes to make me out of stuck !
>I have been working on a IM driver (in Windows 2000) and having some =
>confusion=20
>regarding binding the IM as a protocol with NIC and creating virtual =
>interfaces when I want.
>=20
>
>I observed my driver performed following steps in proper order:
>=20
>1. After executing DriverEntry(), NDIS calls ProtocolBindAdapter() for a =
>Miniport.
>
>2. Then I do NdisOpenAdapter() which performs actual binding and returns =
>a valid NDIS bindinghandle
>=20
>3. Then I called NdisIMInitializeDeviceInstanceEx().
>=20
>4. I can see my MiniportInitialize() is getting called, and the upper =
>layer protocol send some OID requests. My driver handled those OID =
>request properly.
>=20
>In my machine I have two ethernet cards. Hence upon installation I see =
>two more=20
>virtual interfaces and steps (1-4) mentioned above executed two times.
>=20
>As DDK suggests - NDIS automatically invoke the ProtocolBindAdapter =
>handler for all existing adapters upon
>protocol driver registration.=20
>I need : Creation of virtual interfaces dynamically from my IM driver =
>code preferably from IOCTL request(not depends on how many real =
>interfaces are currently in my system).
>Which means what NDIS initiates (when any NIC available to my machine)by =
>calling ProtocolBindAdapter (to bind higher level protocols who can bind =
>new NIC) that I need to do from my code .
>I am really worried direct call to ProtocolBindAdapter is possible from =
>the IM driver IOCTL dispatcth routine !!! It is going to crash again =
>and again.
>It seems to me quite weird because of setting IN params (BindContext, =
>SystemSpecific1 and SystemSpecific2) in ProtocolBindAdapter from my =
>driver instead of setting them by NDIS automatically once a New NIC =
>comes up!!
>=20
>Unless calling ProtocolBindAdapter I can not call NdisOpenAdapter and =
>NdisIMInitializeDeviceInstanceEx ? Thus my intention to create VNIC goes =
>in vain
>=20
>What should I do now for creating multiple VNIC dynamically (as per an =