Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem of Creation VNICs dynamically (from IOCTL) in windows 2000

0 views
Skip to first unread message

subrata

unread,
Mar 13, 2003, 6:27:13 AM3/13/03
to
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
regarding binding the IM as a protocol with NIC and creating virtual interfaces when I want.
 

I observed my driver performed following steps in proper order:
 
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
 
3. Then I called NdisIMInitializeDeviceInstanceEx().
 
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.
 
In my machine I have two ethernet cards. Hence upon installation I see two more
virtual interfaces and steps (1-4) mentioned above  executed two times.
 
As DDK suggests - NDIS automatically invoke the ProtocolBindAdapter handler for all existing adapters upon
protocol driver registration.
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!!
 
Unless calling ProtocolBindAdapter I can not call NdisOpenAdapter and NdisIMInitializeDeviceInstanceEx ? Thus my intention to create VNIC goes in vain
 
What  should I do now for creating multiple VNIC dynamically (as per an IOCTL request ) from my driver on demand from IOCTL?

Could any one give some idea on this. I am really stuck at this.
Please suggests ASAP, I am in hurry...

Best Regards

Stephan Wolf

unread,
Mar 13, 2003, 8:22:41 AM3/13/03
to
On Thu, 13 Mar 2003 16:57:13 +0530, "subrata" <sub...@alumnux.com>
wrote:

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 =

0 new messages