I\'ve got some legacy code in C++ here that does some things I don\'t understand. I\'m running it in Visual C++ 2008 Express Edition on a machine running Windows XP.
<
Indeed, Using Visual studio 6, I used to get the number of adapters by:
DWORD drc = GetAdaptersInfo(NULL, &(Buflen = 0L));
if (drc == ERROR_BUFFER_OVERFLOW)
n = Buflen / sizeof(IP_ADAPTER_INFO);
It was all right, for instance for 2 adapters Buflen was set to 1280 and sizeof(IP_ADAPTER_INFO) was 640.
Now I am 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) is now 648!
Is this a bug or am I missing something?