[ADNS] Add function to return number of DNS servers available for query.
[reactos.git] / reactos / dll / win32 / dnsapi / dnsapi / query.c
index 4c2599b..a57f0e6 100644 (file)
@@ -798,6 +798,14 @@ DnsQuery_W(LPCWSTR Name,
             }
         }
 
+        if (!adns_numservers(astate))
+        {
+            /* There are no servers to query so bail out */
+            adns_finish(astate);
+            RtlFreeHeap(RtlGetProcessHeap(), 0, AnsiName);
+            return ERROR_FILE_NOT_FOUND;
+        }
+
         /*
         * adns doesn't resolve chained CNAME records (a CNAME which points to
         * another CNAME pointing to another... pointing to an A record), according