Using the INetCfg APIs you can unbind and rebind a protocol from your user-space application. See the BindView sample in the DDK.
You can also pend this OID until you have the MAC address and then complete it later via NdisMQueryInformationComplete, but I’m not sure if that will introduce any upper-layer timeout issues (don’t think so). It’s not like the transport will be useful until it gets a legitimate MAC address anyway, so you might as well wait until you’re ready.
No other OIDs will be sent down to you while this OID is pended and the binding process (as far as TCPIP is concerned) won’t complete until the OID completes.
Bryan S. Burgin
xxxxx@online.microsoft.com
This posting is provided “AS IS” with no warranties, and confers no rights.
-----Original Message-----
From: Paul Benware [mailto:xxxxx@koolspan.com]
Sent: Thursday, October 28, 2004 1:31 PM
To: ‘Windows System Software Devs Interest List’
Cc: Bryan Burgin
Subject: RE: [ntdev] OID_802_3_CURRENT_ADDRESS in a virtual adapter…
Ideally, I’d like to control this from a user mode app (I can set the
address as it changes via an IOCTL or use a registry entry.) So, I guess I
can do this at bind time. Can I force an unbind and then a bind for my
virtual adapter so that the protocols will get the new address? Is there a
Win32 API to do this? I.e. The feature available in “Network Connections”
where one can “disable” and then “enable” an adapter?
BTW, what is the point of distinguishing between the permanent address and
the current address? Just for hardware manufactures so they can encode an
address on the physical device, but give the user the opportunity to manage
this?
Paul Benware
Director of Client Development
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
TELE: 1-301-468-9434
DIRECT: 1-301-560-4531
FAX: 1-301-576-6341
CELL: 1-585-739-0441
www.koolspan.com
-----Original Message-----
From: Bryan Burgin [mailto:xxxxx@microsoft.com]
Sent: Thursday, October 28, 2004 3:44 PM
To: Windows System Software Devs Interest List
Cc: xxxxx@koolspan.com
Subject: RE: [ntdev] OID_802_3_CURRENT_ADDRESS in a virtual adapter…
Most protocols gather this information while they are binding and hold onto
them until the adapter is unbound. A change in connect status will not
necessarily make the protocol to re-query this information. Is there a
problem with coming up with a MAC address earlier?
Bryan S. Burgin
xxxxx@online.microsoft.com
This posting is provided “AS IS” with no warranties, and confers no rights.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Paul Benware
Sent: Thursday, October 28, 2004 10:26 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] OID_802_3_CURRENT_ADDRESS in a virtual adapter…
Hi,
I have a virtual NDIS miniport adapter pretending to be an 802.3 network
adapter.? I am trying to effect the MAC address that is reported to protocol
stacks and when I respond initially to the OID_802_3_CURRENT_ADDRESS, it is
all zeros (i.e. 00-00-00-00-00-00).? I am reporting a “valid” (non-zero) MAC
address for the query to OID_802_3_PERMANENT_ADDRESS.? Also, btw, my adapter
comes up “disconnected” by responding accordingly to the
OID_GEN_MEDIA_CONNECT_STATUS query.? So, later on when I want to update the
“current” address, I have the right value ready to respond with and I
indicate up a media connect change.? There are queries (I assume from the
TCP/IP protocol stack) for OID_802_3_CURRENT_ADDRESS and my code returns the
right stuff, but it doesn’t seem to be reflected in the system.
What do I mean by “reflected”?? Well, “ipconfig /all” still reports my MAC
address as the initial value of current address (all zeros).? Also, all the
outbound packets have the zeros in the “src” field of the MAC header when my
other (NDIS IM) driver gets them.
Any insight to how I’d get this to work as desired would be appreciated.
Thanks,
Paul
Paul Benware
KoolSpan Inc.
11134 Stephalee Lane
North Bethesda, MD 20852
www.koolspan.com
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com