22 char host_nameUTF8[255];
23 char test_nameUTF8[255];
25 WCHAR host_nameW[255];
26 WCHAR test_nameW[255];
28 ULONG network_info_blen = 0;
29 DWORD network_info_result;
33 if (
NULL == network_info)
35 skip(
"Not enough memory. Can't continue!\n");
43 skip(
"Can't get network info. Some results may be wrong.\n");
55 mbstowcs(host_nameW, host_name, 255);
56 wcstombs(host_nameUTF8, host_nameW, 255);
76 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
79 ok(
strcmp(dp->
pName, host_name) == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName, host_name);
89 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
92 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
103 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
117 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
131 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
134 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
144 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
161 ok(
strcmp(dp->
pName, host_name) == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName, host_name);
170 ok(dns_status ==
NO_ERROR,
"DnsQuery_A failed with error %lu\n", dns_status);
173 ok(
strcmp(dp->
pName,
"0.0.0.0") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"0.0.0.0");
187 ok(
strcmp(dp->
pName,
"0.0.0.0") == 0 ||
broken(
strcmp(dp->
pName,
"0.0.0.0 ") == 0),
"DnsQuery_A returned wrong answer '%s' expected '%s' or '%s'\n", dp->
pName,
"0.0.0.0",
"0.0.0.0 ");
201 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0 ||
strcmp(dp->
pName,
"127.0.0.1 ") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s' or '%s'\n", dp->
pName,
"127.0.0.1",
"127.0.0.1 ");
214 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
227 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
240 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
253 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
267 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_A returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
292 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
295 ok(
strcmp(dp->
pName, host_name) == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName, host_name);
304 wcscpy(test_nameW,
L"127.0.0.1");
305 wcstombs(test_nameUTF8, test_nameW, 255);
307 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
310 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
320 wcscpy(test_nameW,
L"LocalHost");
321 wcstombs(test_nameUTF8, test_nameW, 255);
323 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
327 ok(
strcmp(dp->
pName,
"localhost") == 0 ||
broken(
strcmp(dp->
pName,
"LocalHost") == 0),
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
336 wcscpy(test_nameW,
L"Localhost");
337 wcstombs(test_nameUTF8, test_nameW, 255);
339 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
343 ok(
strcmp(dp->
pName,
"localhost") == 0 ||
broken(
strcmp(dp->
pName,
"Localhost") == 0),
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
352 wcscpy(test_nameW,
L"localhost");
353 wcstombs(test_nameUTF8, test_nameW, 255);
355 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
358 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
368 wcstombs(test_nameUTF8, test_nameW, 255);
370 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
383 wcstombs(test_nameUTF8, test_nameW, 255);
389 ok(
strcmp(dp->
pName, host_name) == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName, host_name);
397 wcscpy(test_nameW,
L"0.0.0.0");
398 wcstombs(test_nameUTF8, test_nameW, 255);
400 ok(dns_status ==
NO_ERROR,
"DnsQuery_UTF8 failed with error %lu\n", dns_status);
403 ok(
strcmp(dp->
pName,
"0.0.0.0") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"0.0.0.0");
412 wcscpy(test_nameW,
L"0.0.0.0 ");
413 wcstombs(test_nameUTF8, test_nameW, 255);
419 ok(
strcmp(dp->
pName,
"0.0.0.0") == 0 ||
broken(
strcmp(dp->
pName,
"0.0.0.0 ") == 0),
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s' or '%s'\n", dp->
pName,
"0.0.0.0",
"0.0.0.0 ");
428 wcscpy(test_nameW,
L"127.0.0.1 ");
429 wcstombs(test_nameUTF8, test_nameW, 255);
435 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0 ||
strcmp(dp->
pName,
"127.0.0.1 ") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s' or '%s'\n", dp->
pName,
"127.0.0.1",
"127.0.0.1 ");
444 wcscpy(test_nameW,
L" 127.0.0.1 ");
445 wcstombs(test_nameUTF8, test_nameW, 255);
450 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
459 wcscpy(test_nameW,
L" 127.0. 0.1 ");
460 wcstombs(test_nameUTF8, test_nameW, 255);
465 ok(
strcmp(dp->
pName,
"127.0.0.1") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"127.0.0.1");
474 wcscpy(test_nameW,
L"localhost ");
475 wcstombs(test_nameUTF8, test_nameW, 255);
480 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
489 wcscpy(test_nameW,
L" localhost");
490 wcstombs(test_nameUTF8, test_nameW, 255);
495 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
504 wcscpy(test_nameW,
L" local host ");
505 wcstombs(test_nameUTF8, test_nameW, 255);
510 ok(
strcmp(dp->
pName,
"localhost") == 0,
"DnsQuery_UTF8 returned wrong answer '%s' expected '%s'\n", dp->
pName,
"localhost");
525 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
545 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
557 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
570 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
582 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
594 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
606 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
631 ok(dns_status ==
NO_ERROR,
"DnsQuery_W failed with error %lu\n", dns_status);
721 wcscpy(test_nameW,
L" local host ");
742 ok(iResult == 0,
"WSAStartup failed: %d\n", iResult);
743 if (iResult != 0)
return;
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
#define ERROR_INVALID_PARAMETER
#define HeapFree(x, y, z)
#define ERROR_INVALID_NAME
DNS_STATUS WINAPI DnsQuery_A(LPCSTR Name, WORD Type, DWORD Options, PVOID Extra, PDNS_RECORD *QueryResultSet, PVOID *Reserved)
DNS_STATUS WINAPI DnsQuery_W(LPCWSTR Name, WORD Type, DWORD Options, PVOID Extra, PDNS_RECORD *QueryResultSet, PVOID *Reserved)
DNS_STATUS WINAPI DnsQuery_UTF8(LPCSTR Name, WORD Type, DWORD Options, PVOID Extra, PDNS_RECORD *QueryResultSet, PVOID *Reserved)
VOID WINAPI DnsRecordListFree(PDNS_RECORD list, DNS_FREE_TYPE type)
INT WINAPI WSAStartup(IN WORD wVersionRequested, OUT LPWSADATA lpWSAData)
DWORD WINAPI GetNetworkParams(PFIXED_INFO pFixedInfo, PULONG pOutBufLen)
static const char * test_name
FIXED_INFO_W2KSP1 * PFIXED_INFO
#define DNS_QUERY_STANDARD
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
char DomainName[MAX_DOMAIN_NAME_LEN+4]
char HostName[MAX_HOSTNAME_LEN+4]
union _DnsRecordA::@3510 Data
#define DNS_ERROR_RCODE_NAME_ERROR
#define DNS_ERROR_INVALID_NAME_CHAR
int PASCAL FAR WSACleanup(void)