CodePudding user response:
The general idea is that
IP_ADAPTER_INFO AdapterInfo [1024].
DWORD dwBufLen=sizeof (AdapterInfo);
DWORD dwStatus=GetAdaptersInfo (AdapterInfo, & amp; DwBufLen);
PIP_ADAPTER_INFO pAdapterInfo=AdapterInfo;
Do
{
LAN_RouteFile [LANFoundQty]. Interface=pAdapterInfo - & gt; The Index;
LAN_RouteFile [LANFoundQty] IPAddr=pAdapterInfo - & gt; IpAddressList. IpAddress. String;
LAN_RouteFile [LANFoundQty] Mask=pAdapterInfo - & gt; IpAddressList. IpMask. String;
LAN_RouteFile [LANFoundQty]. The Gateway=pAdapterInfo - & gt; GatewayList. IpAddress. String;
PAdapterInfo=pAdapterInfo - & gt; Next;//Progress through linked list
LANFoundQty + +;
} while (pAdapterInfo);
CodePudding user response:
According to the network adapter name