Skip to content
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

Fixed Advapi32Util getAccountBySid for remote machines #1068

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public static Account getAccountBySid(String systemName, PSID sid) {
IntByReference cchDomainName = new IntByReference();
PointerByReference peUse = new PointerByReference();

if (Advapi32.INSTANCE.LookupAccountSid(null, sid, null, cchName, null,
if (Advapi32.INSTANCE.LookupAccountSid(systemName, sid, null, cchName, null,
cchDomainName, peUse)) {
throw new RuntimeException(
"LookupAccountSidW was expected to fail with ERROR_INSUFFICIENT_BUFFER");
Expand All @@ -278,7 +278,7 @@ public static Account getAccountBySid(String systemName, PSID sid) {
char[] domainName = new char[cchDomainName.getValue()];
char[] name = new char[cchName.getValue()];

if (!Advapi32.INSTANCE.LookupAccountSid(null, sid, name, cchName,
if (!Advapi32.INSTANCE.LookupAccountSid(systemName, sid, name, cchName,
domainName, cchDomainName, peUse)) {
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
}
Expand Down