[IPCONFIG] Display non-zero type records only and improve error messages

This commit is contained in:
Eric Kohl 2019-11-16 20:27:04 +01:00
parent d170b6ab3e
commit e196149b71

View file

@ -763,14 +763,18 @@ DisplayDnsRecord(
NULL); NULL);
if (Status != ERROR_SUCCESS) if (Status != ERROR_SUCCESS)
{ {
#if 0 if (Status == DNS_ERROR_RCODE_NAME_ERROR)
if (wType != 0) {
_tprintf(_T("\t%S\n"), pszName);
_tprintf(_T("\t----------------------------------------\n"));
_tprintf(_T("\tName does not exist\n\n"));
}
else if (Status == DNS_INFO_NO_RECORDS)
{ {
_tprintf(_T("\t%S\n"), pszName); _tprintf(_T("\t%S\n"), pszName);
_tprintf(_T("\t----------------------------------------\n")); _tprintf(_T("\t----------------------------------------\n"));
_tprintf(_T("\tNo records of type %hu\n\n"), wType); _tprintf(_T("\tNo records of type %hu\n\n"), wType);
} }
#endif
return; return;
} }
@ -862,7 +866,9 @@ DisplayDns(VOID)
{ {
pNextEntry = pThisEntry->pNext; pNextEntry = pThisEntry->pNext;
DisplayDnsRecord(pThisEntry->pszName, pThisEntry->wType1); if (pThisEntry->wType1 != 0)
DisplayDnsRecord(pThisEntry->pszName, pThisEntry->wType1);
if (pThisEntry->wType2 != 0) if (pThisEntry->wType2 != 0)
DisplayDnsRecord(pThisEntry->pszName, pThisEntry->wType2); DisplayDnsRecord(pThisEntry->pszName, pThisEntry->wType2);