Skip to content

Commit b5b875f

Browse files
nilsrudolphmatthiasblaesing
authored andcommitted
Pass systemName parameter of Advapi32Util.getAccountBySid to native functions
1 parent b9f0b99 commit b5b875f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Features
1313
* [#1064](https://github.com/java-native-access/jna/pull/1064): Add `c.s.j.p.win32.Kernel32.GetLogicalProcessorInformationEx` function, convenience Util method and supporting structures - [@dbwiddis](https://github.com/dbwiddis).
1414
* [#1065](https://github.com/java-native-access/jna/pull/1065): Add `c.s.j.p.win32.PowrProf#CallNTPowerInformation` and supporting structures - [@dbwiddis](https://github.com/dbwiddis).
1515
* [#1063](https://github.com/java-native-access/jna/pull/1063): Enhance `c.s.j.p.win32.User32` and associated classes to support keyboard related functionality. - [@kevemueller](https://github.com/kevemueller).
16+
* [#1068](https://github.com/java-native-access/jna/pull/1068): `c.s.j.p.win32.Advapi32Util.getAccountBySid(String systemName, PSID sid)` ignored parameter instead of passing it to the native function - [@nirud](https://github.com/nirud).
1617

1718
Bug Fixes
1819
---------

contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public static Account getAccountBySid(String systemName, PSID sid) {
263263
IntByReference cchDomainName = new IntByReference();
264264
PointerByReference peUse = new PointerByReference();
265265

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

281-
if (!Advapi32.INSTANCE.LookupAccountSid(null, sid, name, cchName,
281+
if (!Advapi32.INSTANCE.LookupAccountSid(systemName, sid, name, cchName,
282282
domainName, cchDomainName, peUse)) {
283283
throw new Win32Exception(Kernel32.INSTANCE.GetLastError());
284284
}

0 commit comments

Comments
 (0)