https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b4777797aaa287f71fe87…
commit b4777797aaa287f71fe877b9d2a229b98c7deaf4
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Sun Dec 22 14:40:18 2019 +0100
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Sun Dec 22 14:40:18 2019 +0100
[DNSAPI] Set proper record flags for query results and converted records
---
dll/win32/dnsapi/query.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/dll/win32/dnsapi/query.c b/dll/win32/dnsapi/query.c
index f16d8ec883f..0603b322390 100644
--- a/dll/win32/dnsapi/query.c
+++ b/dll/win32/dnsapi/query.c
@@ -223,9 +223,15 @@ DnsQuery_CodePage(UINT CodePage,
}
if (CodePage == CP_ACP)
+ {
ConvertedRecord->pName = DnsWToC((PWCHAR)QueryResultWide->pName);
+ ConvertedRecord->Flags.S.CharSet = DnsCharSetAnsi;
+ }
else
+ {
ConvertedRecord->pName = DnsWToUTF8((PWCHAR)QueryResultWide->pName);
+ ConvertedRecord->Flags.S.CharSet = DnsCharSetUtf8;
+ }
ConvertedRecord->wType = QueryResultWide->wType;
@@ -625,6 +631,8 @@ Query_Main(LPCWSTR Name,
(*QueryResultSet)->pNext = NULL;
(*QueryResultSet)->wType = Type;
(*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA);
+ (*QueryResultSet)->Flags.S.Section = DnsSectionAnswer;
+ (*QueryResultSet)->Flags.S.CharSet = DnsCharSetUnicode;
(*QueryResultSet)->Data.A.IpAddress = Address;
(*QueryResultSet)->pName = (LPSTR)xstrsave(Name);
@@ -696,6 +704,8 @@ Query_Main(LPCWSTR Name,
(*QueryResultSet)->pNext = NULL;
(*QueryResultSet)->wType = Type;
(*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA);
+ (*QueryResultSet)->Flags.S.Section = DnsSectionAnswer;
+ (*QueryResultSet)->Flags.S.CharSet = DnsCharSetUnicode;
(*QueryResultSet)->Data.A.IpAddress = Address;
(*QueryResultSet)->pName = (LPSTR)DnsCToW(HostWithDomainName);
@@ -787,6 +797,8 @@ Query_Main(LPCWSTR Name,
(*QueryResultSet)->pNext = NULL;
(*QueryResultSet)->wType = Type;
(*QueryResultSet)->wDataLength = sizeof(DNS_A_DATA);
+ (*QueryResultSet)->Flags.S.Section = DnsSectionAnswer;
+ (*QueryResultSet)->Flags.S.CharSet = DnsCharSetUnicode;
(*QueryResultSet)->Data.A.IpAddress =
answer->rrs.addr->addr.inet.sin_addr.s_addr;
adns_finish(astate);