I am writing a network device driver for Windows. I have got the driver working but it shows up as generic Ethernet 2
in both ipconfig
output and in Control Panel>Network Adapters. How do I set the interface name to a custom name from within the driver code? I do not want to do it from user level tools.
ipconfig
output:
Ethernet adapter Ethernet 2:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::b5d1:2ce1:3e7c:5aa7%18
Autoconfiguration IPv4 Address. . : 169.254.90.167
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :
Network Adapters GUI screenshot: Control Panel>Network Adapters
Windows does not have any feature for a NIC driver to name itself.
Naming is a bit more complicated than it looks:
Allowing the NIC driver to directly assign its own name would undermine the OS's ability to deliver features like those.
Source: I wrote the OS code to determine the name that is assigned to a newly-installed network interface.
Maybe there's another way to solve this problem? What is the ultimate problem you want to solve? (Stack Overflow isn't a discussion board, so an in-depth discussion with back-and-forth is difficult here. Many Windows driver developers hang out on the OSR forum instead.)