From df7f55f01c43aab4c7acd0f59e34e8d0bca7a06a Mon Sep 17 00:00:00 2001 From: "Rudolph, Nils" Date: Wed, 20 Feb 2019 13:49:27 +0100 Subject: [PATCH] Pass systemName parameter to functions --- .../platform/src/com/sun/jna/platform/win32/Advapi32Util.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java b/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java index 3bbe7c10d7..509b8ab521 100755 --- a/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java +++ b/contrib/platform/src/com/sun/jna/platform/win32/Advapi32Util.java @@ -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"); @@ -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()); }