Package com.sun.jna

Examples of com.sun.jna.NativeLong.longValue()


        NativeLongByReference phCard = new NativeLongByReference();
        IntByReference pdwActiveProtocol = new IntByReference();
        NativeLong status = nimpPcscDll.NimpSCardReconnect(new NativeLong(cardId), shareMode, preferredProtocols,
                activationPolicy,
                pdwActiveProtocol);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        return phCard.getValue().longValue();
    }
View Full Code Here


        NativeLong callStatus = nimpPcscDll.NimpSCardTransmit(new NativeLong(cardId),
                pioSendPci,
                buf, len,
                (NimpPcscDll.SCARD_IO_REQUEST) null,
                pbRecvBuffer, pcbRecvLength);
        if (SCARD_S_SUCCESS != callStatus.longValue()) {
            throw new PcScException("buf.length="+buf.length+", len="+len,callStatus.intValue());
        }
        byte out[] = new byte[pcbRecvLength.getValue()];
        for (int i = 0; i < pcbRecvLength.getValue(); i++) {
            out[i] = pbRecvBuffer[i];
View Full Code Here

        IntByReference pdwProtocol = new IntByReference();
        byte pbAtr[] = new byte[36];
        IntByReference pcbAtrLen = new IntByReference();
        pcbAtrLen.setValue(36);
        NativeLong callStatus = nimpPcscDll.NimpSCardStatusW(new NativeLong(cardId), null, pcchReaderLen, pdwState, pdwProtocol, pbAtr, pcbAtrLen);
        if (SCARD_S_SUCCESS != callStatus.longValue()) {
            throw new PcScException(callStatus.intValue());
        }
        byte out[] = new byte[pcbAtrLen.getValue()];
        for (int i = 0; i < pcbAtrLen.getValue(); i++) {
            out[i] = pbAtr[i];
View Full Code Here

        return out;
    }

    static void SCardDisconnect(long cardId, int disposition) throws PcScException {
        NativeLong status = nimpPcscDll.NimpSCardDisconnect(new NativeLong(cardId), disposition);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
    }

    static int[] SCardGetStatusChange(long contextId, long timeout, int[] currentState, String[] readerNames) throws ScardException {
View Full Code Here

            readerStates[i].cbAtr = 0;
            readerStates[i].rgbAtr = new byte[36];
        }

        NativeLong status = nimpPcscDll.NimpSCardGetStatusChangeW(new NativeLong(contextId), (int) timeout, readerStates, readerNames.length);
        if (SCARD_S_SUCCESS != status.longValue()) {
            throw new PcScException(status.intValue());
        }
        int out[] = new int[readerNames.length];
        for (int i = 0; i < readerNames.length; i++) {
            out[i] = readerStates[i].dwEventState;
View Full Code Here

    }
   
    @Test public void testSendAndReceiveNativeLong() {
        NativeLong result = Foundation.send(proxy.id(), "takesNativeLongReturnsNativeLong:",
                NativeLong.class, new NativeLong(42));
        assertEquals(42, result.longValue());
    }
   
    @Test public void testSendAndReceiveLong() {
        long result = Foundation.send(proxy.id(), "takesLongReturnsLong:",
                long.class, 42);
View Full Code Here

    }
    class WindowByReference extends ByReference {
        public WindowByReference() { super(XID.SIZE); }
        public Window getValue() {
            NativeLong value = getPointer().getNativeLong(0);
            return value.longValue() == X11.None
                ? Window.None : new Window(value.longValue());
        }
    }
    class Pixmap extends Drawable {
    private static final long serialVersionUID = 1L;
View Full Code Here

    class WindowByReference extends ByReference {
        public WindowByReference() { super(XID.SIZE); }
        public Window getValue() {
            NativeLong value = getPointer().getNativeLong(0);
            return value.longValue() == X11.None
                ? Window.None : new Window(value.longValue());
        }
    }
    class Pixmap extends Drawable {
    private static final long serialVersionUID = 1L;
    public static final Pixmap None = null;
View Full Code Here

      nposition = NativeMappings.pcap_dump_ftell(dumper);
    } finally {
      dumperLock.readLock().unlock();
    }

    long position = nposition.longValue();
    if (position < 0) {
      throw new PcapNativeException("Failed to get the file position.");
    }

    return position;
View Full Code Here

    }
    class WindowByReference extends ByReference {
        public WindowByReference() { super(XID.SIZE); }
        public Window getValue() {
            NativeLong value = getPointer().getNativeLong(0);
            return value.longValue() == X11.None
                ? Window.None : new Window(value.longValue());
        }
    }
    class Pixmap extends Drawable {
    private static final long serialVersionUID = 1L;
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.