MAC addresses on a machine / filtering out the MAC addresses of plug and play devices
问题 I have the following code which runs through and populates a character array with up to 3 WiFi and Ethernet adapter MAC addresses on a Windows machine: IP_ADAPTER_INFO *info = NULL, *pos; DWORD size = 0; if (GetAdaptersInfo(info, &size) != ERROR_BUFFER_OVERFLOW) return; info = (IP_ADAPTER_INFO *)malloc(size); if (GetAdaptersInfo(info, &size) != ERROR_SUCCESS) return; char addresses[1024]; char buffer[1024]; memset(addresses, 0, sizeof(addresses)); memset(buffer, 0, sizeof(buffer)); int