658{
661 int adns_error;
664 unsigned CNameLoop;
666 ULONG network_info_blen = 0;
667 DWORD network_info_result;
671 PCHAR HostWithDomainName;
673 size_t NameLen = 0;
674
677 if (QueryResultSet ==
NULL)
679
680 *QueryResultSet =
NULL;
681
683 {
685
687 0,
689 -1,
691 0,
693 0);
695 if (
NULL == AnsiName)
696 {
698 }
700 0,
702 -1,
703 AnsiName,
704 NameLen,
706 0);
707 NameLen--;
708
711 if (
NULL == network_info)
712 {
714 }
715
718 {
720 return network_info_result;
721 }
722
724 {
725 size_t TempLen = 2, StringLength = 0;
728 TempLen += StringLength;
730 TempLen += StringLength;
734 {
737 }
740
741 if (
NULL == *QueryResultSet)
742 {
743 RtlFreeHeap(RtlGetProcessHeap(), 0, HostWithDomainName);
745 }
746
747 (*QueryResultSet)->pNext =
NULL;
748 (*QueryResultSet)->wType =
Type;
749 (*QueryResultSet)->wDataLength =
sizeof(
DNS_A_DATA);
752 (*QueryResultSet)->Data.A.IpAddress =
Address;
753
754 (*QueryResultSet)->pName = (
LPSTR)
DnsCToW(HostWithDomainName);
755
756 RtlFreeHeap(RtlGetProcessHeap(), 0, HostWithDomainName);
758 }
759
761 {
765 }
766
769 {
773 }
775 {
779 }
781 {
783 }
785
787 {
788
792 }
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807#define CNAME_LOOP_MAX 16
808
809 CurrentName = AnsiName;
810
812 {
814
816 {
818
819 if (CurrentName != AnsiName)
821
824 }
825
826 if (answer && answer->
rrs.
addr)
827 {
828 if (CurrentName != AnsiName)
830
833
834 if (
NULL == *QueryResultSet)
835 {
838 }
839
840 (*QueryResultSet)->pNext =
NULL;
841 (*QueryResultSet)->wType =
Type;
842 (*QueryResultSet)->wDataLength =
sizeof(
DNS_A_DATA);
845 (*QueryResultSet)->Data.A.IpAddress = answer->
rrs.
addr->
addr.
inet.sin_addr.s_addr;
846
848
850
852 }
853
855 {
857
858 if (CurrentName != AnsiName)
860
863 }
864
865 if (CurrentName != AnsiName)
867
869
870 if (!CurrentName)
871 {
875 }
876 }
877
882
883 default:
885 }
886}
DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS(int Status)
ADNS_API void adns_addserver(adns_state state, struct in_addr server)
ADNS_API void adns_finish(adns_state ads)
ADNS_API int adns_synchronous(adns_state ads, const char *owner, adns_rrtype type, adns_queryflags flags, adns_answer **answer_r)
ADNS_API int adns_numservers(adns_state state)
ADNS_API int adns_init(adns_state *newstate_r, adns_initflags flags, FILE *diagfile)
ADNS_API void adns_ccf_search(adns_state state, const char *fn, int lno, const char *buf)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define ERROR_INVALID_PARAMETER
#define WideCharToMultiByte
static PWCHAR DnsCToW(const CHAR *NarrowString)
IP4_ADDRESS CheckForCurrentHostname(CONST CHAR *Name, PFIXED_INFO network_info)
CHAR * xstrsaveA(const CHAR *str)
WCHAR * xstrsave(const WCHAR *str)
GLenum const GLvoid * addr
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
struct FIXED_INFO * PFIXED_INFO
#define ERROR_FILE_NOT_FOUND
STRSAFEAPI StringCchCatA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
STRSAFEAPI StringCchLengthA(STRSAFE_LPCSTR psz, size_t cchMax, size_t *pcchLength)
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
IP_ADDR_STRING DnsServerList
char HostName[MAX_HOSTNAME_LEN+4]
char DomainName[MAX_DOMAIN_NAME_LEN+4]
struct _IP_ADDR_STRING * Next
IP_ADDRESS_STRING IpAddress
union adns_answer::@4221 rrs
union adns_rr_addr::@4220 addr
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
#define DNS_QUERY_NO_RECURSION
#define DNS_QUERY_NO_WIRE_QUERY