Under HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows NT/CurrentVersion/NetworkCards/, I can enumerate each network card installed on my machine. However, some application, especially virtual machines, will install some virtual network cards.
My question is: How to programmatically determine a network card is a virtual one?
Depends on the virtual machine. If it uses for example QEMU as the hardware emulation it will be very hard to determine that it’s not “the real thing” – at best, you may notice that it’s faster than a the real thing should be, but you’d be hard pushed to know that.
Of course, a virtual machine may also have real network cards installed into the virtual machine. So you can’t really know for sure that it is or isn’t a real one, even if you, somehow, know that you are running on a virtual machine.
If it’s a “paravirtual” network adapter, then you may find that the manufacturer is something like Citrix, VMWare or Oracle, or something like that.
I’m not entirely sure there is a good reason to know the difference…