I thought I answered this question, but re-reading it, I guess I wasn’t terribly clear. Sorry.
A network interface has a few networking-specific properties, derived from RFC 2863. Of interest are ifAlias and ifDescr:
ifAlias: “Local Area Connection 2” – this is the user’s name for the interface. What you call Explorer/Rename.
ifDescr: “Intel(R) 82567LM Gigabit Network Adapter” – this is the vendor’s description of the hardware (or virtual miniport).
Also, the underlying hardware device has a couple PNP names (this is an NT kernel thing, not a networking-specific thing):
Device description: This comes from the INF.
Friendly name: This is initially snapshotted from the device description, but it can be renamed later. In particular, the networking setup engine keeps the ifDescr in synch with this name, so if you change the ifDescr, the PNP friendly name is changed too.
You want to modify the ifAlias. The way to do that is, as I mentioned before, with the “netcfg int set int” command. As you’ve noticed, what INetCfgComponent::SetFriendlyName calls the “Friendly name” does not modify the ifAlias – it actually modifies the ifDescr and PNP friendly name.
There is a rationale behind all this. If you look at the RFC, the idea is that users typically modify the ifAlias (which is why the shell makes it easy to rename that); while vendors get to billboard in ifDescr (which is why there’s a handy INetCfg API for setting that).
BTW, in case you’re curious, there’s also an ifName for a network interface, and it’s different from all of the above. (On Windows, it’s defined to be the NET_LUID.) I suppose someday I should bang out a blog post on all this.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@email.com
Sent: Friday, December 17, 2010 2:42 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] How do I programatically change a device’s FriendlyName
It turns out that my use of the term “FriendlyName” was not correct. In fact, I’m not trying to change the friendly name of the driver.
It seems that a device has at least 3 names (probably more).
- The name derived from the INF file. Maybe called the DeviceDescription
- The Friendly Name that can be displayed in place of #1. It is called FriendlyName or DisplayName
- Some as of yet unidentified (to me) name used by Explorer and Autoconfig
If you look at this screenshot, you will see that Explorer shows 2 names on my wireles card. The one at the bottom “TEST1” is the name that I set by using INetCfgComponent->SetDisplayName()
It can also be set using SetupDiSetDeviceRegistryProperty(… SPDRP_FRIENDLYNAME…)
The name at the top “Renamed Wireless” is set from Explorer/Rename.
http://vragor.smugmug.com/photos/1129640885_4fAax-O.jpg
As you can see in the next screen shot, Autoconfig does not use the FriendlyName. Instead it uses the same name as Explorer - “Renamed Wireless”
http://vragor.smugmug.com/photos/1129640891_coBaV-O.jpg
In the next shot you can see me renaming the wireless card with Explorer
http://vragor.smugmug.com/photos/1129640893_HqZuy-O.jpg
And you can see that new name is reflected in Autoconfig
http://vragor.smugmug.com/photos/1129640890_h8dae-O.jpg
As a little more example, you can see that Device Manager uses the Friendly Name when it displays the device.
http://vragor.smugmug.com/photos/1129640898_GgaMC-O.jpg
But the Network Sharing Center uses the same name as Explorer and Autoconfig.
http://vragor.smugmug.com/photos/1129640892_dt2ze-O.jpg
So my originally misworded question still remains. How can I programatically rename the device in such a way that it will be reflected in autoconfig?
Thanks
Clay
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