2 thoughts on “How to distinguish virtual network cards and physical network cards”

  1. If there are VMware or some VPN client software installed in the system, several virtual network cards will appear. They are almost different from physical network cards in form. IPCONFIG treats them equally with local physical network cards. So how to distinguish from virtual network card or physical network card?
    It people recommend using "locally bit" in the MAC address to distinguish. But in fact, it cannot be distinguished by 100 %, and the system after Win2000 is basically incompatible.
    Hi./xzq2000/blog/item/
    Pets to obtain information from all network cards in this machine, and then distinguish whether virtual network cards are distinguished by "PCI". Blog.csdn/ASEITY/Archive/2007/12/11/1929948.ASPX The specific code is as follows: (The following code quotes elsewhere)
    bool (const char *) const n ... {
    booll ret_value = FALSE;rn#define NET_CARD_KEY "SystemControlNetwork{4D36E972-E325-11CE-BFC1-}"rn char szDataBuf[MAX_PATH 1];rn DWORD dwDataLen = MAX_PATH;r n DWORD dwType = REG_SZ;rn HKEY hNetKey = NULL;rn HKEY hLocalNet = NULL;rn if(ERROR_SUCCESS != (HKEY_LOCAL_MACHINE, NET_CARD_KEY, 0, KEY_READ,

Leave a Comment