Alternative to NdisMRebindProtocolsToAdapter for XP/Vista

Hello

On Windows CE the function NdisMRebindProtocolsToAdapter exists to rebind an adapter to its currently bound protocols, however no such API exists for XP and above.

I am writing an NDIS miniport driver for virtual adapters which must have their MAC address changed periodically. As an adapters MAC address is initially queried by the upper protocols via OID_802_3_CURRENT_ADDRESS after the miniport initialize, changing the MAC address at a later stage requires these upper protocols to be somehow informed of this change.

Can anybody please recommend an alternative strategy to effect the same outcome as calling NdisMRebindProtocolsToAdapter on Windows XP and above.

Many thanks in advance!!

The alternate is to disable and re-enable the adapter.

Depending on how you implement your Virtual Adapter device object and NDIS
Miniport, this could either be a PnP operation (coordinated with the bus
enumerator that created your PDO) or a clever application of NDIS IM driver
support (think MUX with no lower binding) and the use of
NdisIMInitializeDeviceInstance() / NdisIMDeInitializeDeviceInstance().

Even on CE what you are doing might be considered unsafe. NDIS itself might
be interested in the MAC address and simply rebinding protocols does not
assure that all parties of interest learn of the new MAC address. The
NdisIMXxxx() approach (i.e. a MUX with no lower binding) is how CE itself
provides the VEIM Virtual Ethernet facility.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, October 14, 2010 10:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Alternative to NdisMRebindProtocolsToAdapter for XP/Vista

Hello

On Windows CE the function NdisMRebindProtocolsToAdapter exists to rebind an
adapter to its currently bound protocols, however no such API exists for XP
and above.

I am writing an NDIS miniport driver for virtual adapters which must have
their MAC address changed periodically. As an adapters MAC address is
initially queried by the upper protocols via OID_802_3_CURRENT_ADDRESS after
the miniport initialize, changing the MAC address at a later stage requires
these upper protocols to be somehow informed of this change.

Can anybody please recommend an alternative strategy to effect the same
outcome as calling NdisMRebindProtocolsToAdapter on Windows XP and above.

Many thanks in advance!!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Dave’s reply is spot-on, of course: protocols aren’t the only guys who care about the MAC address (e.g., on Vista and later, NDIS exposes the MAC through iphlpapi), so any discussion about rebinding protocols only addresses part of the problem. Either of Dave’s suggestions is a better way to solve the problem.

One other thing I’d add – do you really need to change the MAC address? What if your driver just rewrites packets on-the-fly to stamp them with the MAC-of-the-day? Maybe that saves you from having to re-architect your driver.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of David R. Cattley
Sent: Thursday, October 14, 2010 7:39 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Alternative to NdisMRebindProtocolsToAdapter for XP/Vista

The alternate is to disable and re-enable the adapter.

Depending on how you implement your Virtual Adapter device object and NDIS Miniport, this could either be a PnP operation (coordinated with the bus enumerator that created your PDO) or a clever application of NDIS IM driver support (think MUX with no lower binding) and the use of
NdisIMInitializeDeviceInstance() / NdisIMDeInitializeDeviceInstance().

Even on CE what you are doing might be considered unsafe. NDIS itself might be interested in the MAC address and simply rebinding protocols does not
assure that all parties of interest learn of the new MAC address. The
NdisIMXxxx() approach (i.e. a MUX with no lower binding) is how CE itself
provides the VEIM Virtual Ethernet facility.

Good Luck,
Dave Cattley

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, October 14, 2010 10:29 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Alternative to NdisMRebindProtocolsToAdapter for XP/Vista

Hello

On Windows CE the function NdisMRebindProtocolsToAdapter exists to rebind an adapter to its currently bound protocols, however no such API exists for XP and above.

I am writing an NDIS miniport driver for virtual adapters which must have their MAC address changed periodically. As an adapters MAC address is initially queried by the upper protocols via OID_802_3_CURRENT_ADDRESS after the miniport initialize, changing the MAC address at a later stage requires these upper protocols to be somehow informed of this change.

Can anybody please recommend an alternative strategy to effect the same outcome as calling NdisMRebindProtocolsToAdapter on Windows XP and above.

Many thanks in advance!!


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer