Examples of WString


Examples of com.sun.jna.WString

    }*/

    static long SCardConnect(long contextId, String readerName, int shareMode, int preferredProtocols) throws PcScException {
        NativeLongByReference phCard = new NativeLongByReference();
        IntByReference pdwActiveProtocol = new IntByReference();
        NativeLong status = win32PCSC.SCardConnectW(new NativeLong(contextId), new WString(readerName), shareMode, preferredProtocols,
                phCard,
                pdwActiveProtocol);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
View Full Code Here

Examples of com.sun.jna.WString

    static int[] SCardGetStatusChange(long contextId, long timeout, int[] currentState, String[] readerNames) throws ScardException {
        Win32PCSC.SCARD_READERSTATE readerStates[] = new Win32PCSC.SCARD_READERSTATE[readerNames.length];

        for (int i = 0; i < readerNames.length; i++) {
            readerStates[i] = new Win32PCSC.SCARD_READERSTATE();
            readerStates[i].szReader = new WString(readerNames[i]);
            readerStates[i].pvUserData = Pointer.NULL;
            readerStates[i].dwCurrentState = currentState[i];
            readerStates[i].dwEventState = SCARD_STATE_UNAWARE;
            readerStates[i].cbAtr = 0;
            readerStates[i].rgbAtr = new byte[36];
View Full Code Here

Examples of com.sun.jna.WString

    }*/

    static long SCardConnect(long contextId, String readerName, int shareMode, int preferredProtocols) throws PcScException {
        NativeLongByReference phCard = new NativeLongByReference();
        IntByReference pdwActiveProtocol = new IntByReference();
        NativeLong status = nimpPcscDll.NimpSCardConnectW(new NativeLong(contextId), new WString(readerName), shareMode, preferredProtocols,
                phCard,
                pdwActiveProtocol);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
View Full Code Here

Examples of com.sun.jna.WString

    static int[] SCardGetStatusChange(long contextId, long timeout, int[] currentState, String[] readerNames) throws ScardException {
        NimpPcscDll.SCARD_READERSTATE readerStates[] = new NimpPcscDll.SCARD_READERSTATE[readerNames.length];

        for (int i = 0; i < readerNames.length; i++) {
            readerStates[i] = new NimpPcscDll.SCARD_READERSTATE();
            readerStates[i].szReader = new WString(readerNames[i]);
            readerStates[i].pvUserData = Pointer.NULL;
            readerStates[i].dwCurrentState = currentState[i];
            readerStates[i].dwEventState = SCARD_STATE_UNAWARE;
            readerStates[i].cbAtr = 0;
            readerStates[i].rgbAtr = new byte[36];
View Full Code Here

Examples of com.sun.jna.WString

            // use ugly way.
            return false;
        }
        synchronized (library) {
            try {
                int rc = library.SetFileAttributesW(new WString(file.getAbsolutePath()), new NativeLong(ISVNKernel32Library.FILE_ATTRIBUTE_NORMAL));
                return rc != 0;
            } catch (Throwable th) {
            }
        }
        return false;
View Full Code Here

Examples of com.sun.jna.WString

            // use ugly way.
            return false;
        }
        synchronized (library) {
            try {
                int rc = library.SetFileAttributesW(new WString(file.getAbsolutePath()),
                        new NativeLong(ISVNKernel32Library.FILE_ATTRIBUTE_HIDDEN));
                return rc != 0;
            } catch (Throwable th) {
            }
            return false;
View Full Code Here

Examples of com.sun.jna.WString

            SVNFileUtil.setReadonly(dst, false);
            SVNFileUtil.setReadonly(src, true);
        }
        synchronized (library) {
            try {
                int rc = library.MoveFileExW(new WString(src.getAbsoluteFile().getAbsolutePath()), new WString(dst.getAbsoluteFile().getAbsolutePath()), new NativeLong(3));
                return rc != 0;
            } catch (Throwable th) {
            }
        }
        return false;
View Full Code Here

Examples of com.sun.jna.WString

            dataOut.write();
           
            synchronized (library) {
                boolean ok = library.CryptProtectData(
                        dataIn.getPointer(),
                        new WString("auth_svn.simple.wincrypt"),
                        null, null, null, new NativeLong(1),
                        dataOut.getPointer());
                if (!ok) {
                    return rawData;
                }
View Full Code Here

Examples of com.sun.jna.WString

        SEC_WINNT_AUTH_IDENTITY authIdentity = null;
        if (user != null || password != null || domain != null) {
            authIdentity = new SEC_WINNT_AUTH_IDENTITY();
            if (user != null) {
                authIdentity.User = new WString(user);
                authIdentity.UserLength = new NativeLong(user.length());
            }
           
            if (password != null) {
                authIdentity.Password = new WString(password);
                authIdentity.PasswordLength = new NativeLong(password.length());
            }
           
            if (domain != null) {
                authIdentity.Domain = new WString(domain);
                authIdentity.DomainLength = new NativeLong(domain.length());
            }
            authIdentity.Flags = new NativeLong(ISVNSecurityLibrary.SEC_WINNT_AUTH_IDENTITY_UNICODE);
            authIdentity.write();
        }
       
        SecHandle pCred = new SecHandle();
        pCred.dwLower = new NativeLong(0);
        pCred.dwUpper = new NativeLong(0);
        pCred.write();

        ISVNSecurityLibrary.TimeStamp ltime = new ISVNSecurityLibrary.TimeStamp();
        ltime.HighPart = new NativeLong(0);
        ltime.LowPart = new NativeLong(0);
        ltime.write();
       
        int securityStatus = library.AcquireCredentialsHandleW(null, new WString("NTLM"),
                new NativeLong(ISVNSecurityLibrary.SECPKG_CRED_OUTBOUND), Pointer.NULL,
                authIdentity != null ? authIdentity.getPointer() : Pointer.NULL,
                        Pointer.NULL, Pointer.NULL, pCred.getPointer(), ltime.getPointer());
        if (securityStatus == 0) {
            pCred.read();
View Full Code Here

Examples of com.sun.jna.WString

                    if (value == null)
                        return null;
                    if (value instanceof String[]) {
                        return new StringArray((String[])value, true);
                    }
                    return new WString(value.toString());
                }
                public Object fromNative(Object value, FromNativeContext context) {
                    if (value == null)
                        return null;
                    return value.toString();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.