Skip to content

Fix switched serverName/domainName arguments in Netapi32Util#getDCName#1721

Merged
dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:fix-netgetdcname-args
May 10, 2026
Merged

Fix switched serverName/domainName arguments in Netapi32Util#getDCName#1721
dbwiddis merged 1 commit into
java-native-access:masterfrom
dbwiddis:fix-netgetdcname-args

Conversation

@dbwiddis
Copy link
Copy Markdown
Contributor

Fix the argument order in Netapi32Util#getDCName which was passing (domainName, serverName, bufptr) to Netapi32#NetGetDCName instead of the correct (serverName, domainName, bufptr).

The NetGetDCName Windows API expects serverName first and domainName second. The bug was unnoticed because all existing callers pass (null, null).

Closes #1650

Closes java-native-access#1650

The arguments to NetGetDCName were passed in the wrong order
(domainName, serverName) instead of (serverName, domainName).
Copy link
Copy Markdown
Member

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Makes sense. Thank you.

@dbwiddis dbwiddis merged commit d2788ca into java-native-access:master May 10, 2026
12 checks passed
@dbwiddis dbwiddis deleted the fix-netgetdcname-args branch May 10, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Netapi32Util#getDCName(String, String) has switched arguments for NetGetDCName call

2 participants