Index: ipconfig.c =================================================================== --- ipconfig.c (revision 37784) +++ ipconfig.c (working copy) @@ -360,15 +360,18 @@ ULONG adaptOutBufLen = 0; PFIXED_INFO pFixedInfo = NULL; ULONG netOutBufLen = 0; + ULONG ret = 0; /* call GetAdaptersInfo to obtain the adapter info */ - if (GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen) == ERROR_BUFFER_OVERFLOW) + ret = GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen); + if (ret == ERROR_BUFFER_OVERFLOW) { pAdapterInfo = (IP_ADAPTER_INFO *)HeapAlloc(ProcessHeap, 0, adaptOutBufLen); if (pAdapterInfo == NULL) return; - if (GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen) != NO_ERROR) + ret = GetAdaptersInfo(pAdapterInfo, &adaptOutBufLen); + if (ret != NO_ERROR) { DoFormatMessage(0); HeapFree(ProcessHeap, 0, pAdapterInfo); @@ -377,8 +380,11 @@ } else { - DoFormatMessage(0); - return; + if( ERROR_NO_DATA != ret ) + { + DoFormatMessage(0); + return; + } } /* call GetNetworkParams to obtain the network info */ @@ -413,7 +419,7 @@ _tprintf(_T("\tIP Routing Enabled. . . . . . . . : Yes\n")); else _tprintf(_T("\tIP Routing Enabled. . . . . . . . : No\n")); - if (pAdapter->HaveWins) + if (pAdapter && pAdapter->HaveWins) _tprintf(_T("\tWINS Proxy enabled. . . . . . . . : Yes\n")); else _tprintf(_T("\tWINS Proxy enabled. . . . . . . . : No\n"));