@Override public IWindowsIdentity getIdentity() { final HANDLEByReference phContextToken = new HANDLEByReference(); final int rc = Secur32.INSTANCE.QuerySecurityContextToken(this.ctx, phContextToken); if (WinError.SEC_E_OK != rc) { throw new Win32Exception(rc); } return new WindowsIdentityImpl(phContextToken.getValue()); }
@Override public IWindowsIdentity getIdentity() { final HANDLEByReference phContextToken = new HANDLEByReference(); final int rc = Secur32.INSTANCE.QuerySecurityContextToken(this.ctx, phContextToken); if (WinError.SEC_E_OK != rc) { throw new Win32Exception(rc); } return new WindowsIdentityImpl(phContextToken.getValue()); }
@Override public IWindowsIdentity getIdentity() { final HANDLEByReference phContextToken = new HANDLEByReference(); final int rc = Secur32.INSTANCE.QuerySecurityContextToken(this.ctx, phContextToken); if (WinError.SEC_E_OK != rc) { throw new Win32Exception(rc); } return new WindowsIdentityImpl(phContextToken.getValue()); }
@Override public IWindowsIdentity logonDomainUserEx(final String username, final String domain, final String password, final int logonType, final int logonProvider) { final HANDLEByReference phUser = new HANDLEByReference(); if (!Advapi32.INSTANCE.LogonUser(username, domain, password, logonType, logonProvider, phUser)) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } return new WindowsIdentityImpl(phUser.getValue()); }
@Override public IWindowsIdentity logonDomainUserEx(final String username, final String domain, final String password, final int logonType, final int logonProvider) { final HANDLEByReference phUser = new HANDLEByReference(); if (!Advapi32.INSTANCE.LogonUser(username, domain, password, logonType, logonProvider, phUser)) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } return new WindowsIdentityImpl(phUser.getValue()); }
@Override public IWindowsIdentity logonDomainUserEx(final String username, final String domain, final String password, final int logonType, final int logonProvider) { final HANDLEByReference phUser = new HANDLEByReference(); if (!Advapi32.INSTANCE.LogonUser(username, domain, password, logonType, logonProvider, phUser)) { throw new Win32Exception(Kernel32.INSTANCE.GetLastError()); } return new WindowsIdentityImpl(phUser.getValue()); }