+ if (dwResult == ERROR_SUCCESS)
+ {
+ PIP_ADAPTER_ADDRESSES pCurrentAdapter = pAdapters;
+ unsigned cAdapters = 0;
+
+ /* Count adapters */
+ for(i = 0; pCurrentAdapter; ++i)
+ {
+ if (pCurrentAdapter->IfType != 24 && pCurrentAdapter->IfType != 131)
+ ++cAdapters;
+ pCurrentAdapter = pCurrentAdapter->Next;
+ }
+
+
+ /* Print adapters count */
+ if (!LoadStringW(GetModuleHandle(NULL), IDS_NETWORK_CARDS_FORMAT, Tmp, BUFFER_SIZE))
+ Tmp[0] = L'\0';
+ swprintf(Buf, Tmp, cAdapters);
+ PrintRow(IDS_NETWORK_CARDS, FALSE, L"%s", Buf);
+
+ /* Show information about each adapter */
+ pCurrentAdapter = pAdapters;
+ for(i = 0; pCurrentAdapter; ++i)
+ {
+ if (pCurrentAdapter->IfType != 24 && pCurrentAdapter->IfType != 131)//IF_TYPE_SOFTWARE_LOOPBACK)
+ {
+ PIP_ADAPTER_UNICAST_ADDRESS pAddress;
+
+ PrintRow(0, FALSE, L"[%02u]: %s", i + 1, pCurrentAdapter->Description);
+ PrintRow(IDS_CONNECTION_NAME, TRUE, L"%s", pCurrentAdapter->FriendlyName);
+ if (!(pCurrentAdapter->Flags & 0x0004))
+ {
+ if (!LoadStringW(GetModuleHandle(NULL), IDS_NO, Buf, BUFFER_SIZE))
+ Buf[0] = L'\0';
+ PrintRow(IDS_DHCP_ENABLED, TRUE, Buf);
+ }
+ if (pCurrentAdapter->OperStatus == IfOperStatusDown)
+ {
+ if (!LoadStringW(GetModuleHandle(NULL), IDS_MEDIA_DISCONNECTED, Buf, BUFFER_SIZE))
+ Buf[0] = L'\0';
+ PrintRow(IDS_STATUS, TRUE, Buf);
+ }
+ else
+ {
+ if (!LoadStringW(GetModuleHandle(NULL), IDS_IP_ADDRESSES, Buf, BUFFER_SIZE))
+ Buf[0] = L'\0';
+ PrintRow(0, TRUE, Buf);
+ pAddress = pCurrentAdapter->FirstUnicastAddress;
+ for (j = 0; pAddress; ++j)
+ {
+ dwCharCount = BUFFER_SIZE;
+ WSAAddressToStringW(pAddress->Address.lpSockaddr, pAddress->Address.iSockaddrLength, NULL, Buf, &dwCharCount);
+ PrintRow(0, TRUE, L"[%02u]: %s", j + 1, Buf);
+ pAddress = pAddress->Next;
+ }
+ }
+ }
+ pCurrentAdapter = pCurrentAdapter->Next;
+ }