Skip to content

[DNSAPI_APITEST] Fix dnsapi:DnsQuery on Server 2003 x86, 8.1 x86, 8.1 x64, 10 x86, 10 x64 #8043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cbialorucki
Copy link
Contributor

Purpose

Fixes the dnsapi:DnsQuery test on Server 2003 x86, 8.1 x86, 8.1 x64, 10 x86, and 10 x64.

Windows Server 2003 x64 does not handle the hostname tests properly; however there is some discussion regarding abandoning our Server 2003 x64 testbot and using a Vista x64 testbot instead, so I felt it appropriate to PR this now.

Proposed changes

  • Windows Server 2003 x86 may return a DNS_ERROR_RCODE_NAME_ERROR in some tests where other versions of Windows may return ERROR_INVALID_NAME, ERROR_TIMEOUT, or DNS_ERROR_INVALID_NAME_CHAR. Pass this behavior.
  • Windows 8+ sets the query to a null pointer when given an invalid query pointer while earlier Windows versions don't change the query pointer. Pass either behavior.

Testbot runs (Filled in by Devs)

  • KVM x86:
  • KVM x64:

@github-actions github-actions bot added the ROSTESTS Label for ROS testcases PRs. label May 28, 2025
@@ -61,11 +61,14 @@ void TestHostName(void)
dp = InvalidPointer;
dns_status = DnsQuery_A(NULL, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0);
ok(dns_status == ERROR_INVALID_PARAMETER, "DnsQuery_A failed with error %lu\n", dns_status);
ok(dp == InvalidPointer, "dp = %p\n", dp);
ok(dp == InvalidPointer || dp == 0, "dp = %p\n", dp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and elsewhere/everywhere,
do we have to accept all/any different values, or could we match Windows versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why match a specific Windows version if both represent a valid implementation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You wrote, in PR description, that

Windows 8+ sets the query to a null pointer [...] while earlier Windows versions don't change the query pointer.

but your code implies that any Windows version can return any of the values.
That seems contradictory/wrong. (Instead of checking the Windows version.)

@@ -61,11 +61,14 @@ void TestHostName(void)
dp = InvalidPointer;
dns_status = DnsQuery_A(NULL, DNS_TYPE_A, DNS_QUERY_STANDARD, 0, &dp, 0);
ok(dns_status == ERROR_INVALID_PARAMETER, "DnsQuery_A failed with error %lu\n", dns_status);
ok(dp == InvalidPointer, "dp = %p\n", dp);
ok(dp == InvalidPointer || dp == 0, "dp = %p\n", dp);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ok(dp == InvalidPointer || dp == 0, "dp = %p\n", dp);
ok(dp == InvalidPointer || dp == NULL, "dp = %p\n", dp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ROSTESTS Label for ROS testcases PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants