In fact, using Visual studio 6, I used the number of adapters:
DWORD drc = GetAdaptersInfo(NULL, &(Buflen = 0L)); if (drc == ERROR_BUFFER_OVERFLOW) n = Buflen / sizeof(IP_ADAPTER_INFO);
Everything was in order, for example, 2 Buflen adapters were set to 1280, and sizeof(IP_ADAPTER_INFO) was set to 640.
Now I'm using Visual C ++ 2008 Express, and my result is truncated, because the function still sets Buflen to 1280, but the value of sizeof(IP_ADAPTER_INFO) now 648!
Is this a mistake or am I missing something?
Olivier bertrand
source share