为什么我找不到所有网卡了?
以下是按网上写的,可是为什么只能找到一个网卡了,找到的还不是我使用的那块,
WCHAR AdapterName[2048];
ULONG adapter_length=2048;
PacketGetAdapterNames((char*)AdapterName, &adapter_length);
static char AdapterList[2048][1024];
WCHAR *temp,*temp1;
temp = AdapterName;
temp1 = AdapterName;
int i = 0;
while ((*temp != '\0')||(*(temp-1) != '\0'))
{
if (*temp == '\0')
{
memcpy(AdapterList[i],temp1,(temp-temp1)*2);
temp1 = temp+1;
i++;
}
temp++;
}
int AdapterNum = i;
for (i = 0; i < AdapterNum; i++)
{wprintf(L"\n%d- %s\n", i+1, AdapterList[i]);
MessageBox(AdapterList[i]);
}