OID_GEN_MAC_ADDRESS

Is this Oid what is used to change an adapter’s MAC address? The comments in ntddndis.h makes me think so. I don’t understand the piece about NDIS handling it on behalf of the miniport but it does say it can be set.

//
// new for NDIS 6.0. NDIS will handle on behalf of the miniports
//
#define OID_GEN_MAC_ADDRESS 0x00010205 // query and set

There doesn’t seem to be any information about this Oid on MSDN but if it is the way to change the address, I’m not exactly sure how to use it. FilterRestart in the NDIS LWF filter sample has this comment:

// Check to see if we need to change any attributes. For example, the
// driver can change the current MAC address here. Or the driver can add
// media specific info attributes.

So I’ve tried sending this Oid as a request during FilterRestart with NdisFOidRequest but it returns STATUS_NOT_SUPPORTED (0xc00000bb). And I’ve tried adding this Oid as an attribute but with no effect. I have only been testing this in a VMware VM so it’s possible that the adapter really doesn’t support the Oid but with little information available it could be that I’m just not using it properly.

Can anyone provide some more details on this Oid and if it is the correct way to change the MAC during FilterRestart as the comment mentions is possible?

If I remember correctly, MAC address cannot be changed with this OID.

See here:
https://docs.microsoft.com/en-us/windows-hardware/drivers/network/oid-802-3-current-address

“The network management software cannot set the current station address using the NDIS interface library. It must set this address as a configuration parameter.”

If the miniport has NDIS_MAC_OPTION_SUPPORTS_MAC_ADDRESS_OVERWRITE, upper layers can try to change the standard registry parameter for MAC address and restart the miniport.

– pa

Thanks Pavel.

I saw that comment as well as I was researching the problem.

I know you can do it through a configuration write. The only issue I’m having with that getting the NdisWriteConfiguration to do it in the right location. The parameter needs to be added to the appropriate adapter subkey under

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class{4d36e972-e325-11ce-bfc1-08002be10318}\

The handle you pass to NdisOpenConfig determines where the config is written but none of the handles I have seem to point to the adapter’s key, only to different locations under the filter driver’s service key.

This whole thing can be done in user-mode but for it to take effect requires the following steps

ipconfig /release
disable adapter
re-enable adapter
ipconfig /renew

Doing that at boot isn’t a big deal but it’d be nice to find a way to do it without that disruption.

xxxxx@gmail.com wrote:

This whole thing can be done in user-mode but for it to take effect requires the following steps

ipconfig /release
disable adapter
re-enable adapter
ipconfig /renew

Doing that at boot isn’t a big deal but it’d be nice to find a way to do it without that disruption.

Is that really so unreasonable?  Assigning a new MAC address is a
disruptive operation.  You’re altering the low-level identity of the
device.  There are tables that need to be cleared out and reset.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.