Package com.sun.jna.ptr

Examples of com.sun.jna.ptr.LongByReference


    public void setLatency(long min, long max) {
        gst().gst_app_src_set_latency(this, min, max);
    }
    public void getLatency(long[] minmax) {
        LongByReference minRef = new LongByReference();
        LongByReference maxRef = new LongByReference();
        gst().gst_app_src_get_latency(this, minRef, minRef);
        if ((minmax == null) || (minmax.length != 2)) minmax = new long[2];
        minmax[0] = minRef.getValue();
        minmax[1] = maxRef.getValue();
    }
View Full Code Here


            }
        });
    }
   
    public long block() {
      LongByReference result = new LongByReference();
      emit("block", result);
      return result.getValue();
    }
View Full Code Here

  public long getTotalCPU()
  {
    long result = -1;
    if (!isRunning())
      return -1;
    LongByReference lpCreationTime = new LongByReference();
    LongByReference lpExitTime = new LongByReference();
    LongByReference lpKernelTime = new LongByReference();
    LongByReference lpUserTime = new LongByReference();

    if (MyKernel32.INSTANCE.GetProcessTimes(_processInformation.hProcess, lpCreationTime, lpExitTime, lpKernelTime, lpUserTime))
      result = lpUserTime.getValue() + lpKernelTime.getValue();
    return result;
  }
View Full Code Here

        public Pointer getPointer(long offset) {
            if (Platform.getPlatform().longSize() == 32) {
                IntByReference ref = new IntByReference(getInt(offset));
                return ref.getPointer().getPointer(0);
            } else {
                LongByReference ref = new LongByReference(getLong(offset));
                return ref.getPointer().getPointer(0);
            }
        }
View Full Code Here

    }
    if (lpType.getValue() != WinNT.REG_QWORD) {
      throw new RuntimeException("Unexpected registry type "
          + lpType.getValue() + ", expected REG_QWORD");
    }
    LongByReference data = new LongByReference();
    rc = Advapi32.INSTANCE.RegQueryValueEx(hKey, value, 0,
        lpType, data, lpcbData);
    if (rc != W32Errors.ERROR_SUCCESS
        && rc != W32Errors.ERROR_INSUFFICIENT_BUFFER) {
      throw new Win32Exception(rc);
    }
    return data.getValue();
  }
View Full Code Here

    private void testAlignStruct(int index) {
        AlignmentTest lib = (AlignmentTest)Native.loadLibrary("testlib", AlignmentTest.class);
        try {
            IntByReference offset = new IntByReference();
            LongByReference value = new LongByReference();
            Class cls = Class.forName(getClass().getName() + "$TestStructure" + index);
            Structure s = (Structure)cls.newInstance();
            int result = lib.testStructureAlignment(s, index, offset, value);
            assertEquals("Wrong native value at field " + result
                         + "=0x" + Long.toHexString(value.getValue())
                         + " (actual native field offset=" + offset.getValue()
                         + ") in " + s, -2, result);
        }
        catch(Exception e) {
            throw new Error(e);
View Full Code Here

    private void testAlignStruct(int index) {
        AlignmentTest lib = (AlignmentTest)Native.loadLibrary("testlib", AlignmentTest.class);
        try {
            IntByReference offset = new IntByReference();
            LongByReference value = new LongByReference();
            Class cls = Class.forName(getClass().getName() + "$TestStructure" + index);
            Structure s = (Structure)cls.newInstance();
            int result = lib.testStructureAlignment(s, index, offset, value);
            assertEquals("Wrong native value at field " + result
                         + "=0x" + Long.toHexString(value.getValue())
                         + " (actual native field offset=" + offset.getValue()
                         + ") in " + s, -2, result);
        }
        catch(Exception e) {
            throw new Error(e);
View Full Code Here

        lib.incrementNativeLongByReference(iref);
        assertEquals("Native long argument not modified",
                     new NativeLong(1), iref.getValue());
    }
    public void testLongByReference() {
        LongByReference lref = new LongByReference();
        lib.incrementInt64ByReference(lref);
        assertEquals("Long argument not modified", 1, lref.getValue());
    }
View Full Code Here

        lpRootPathName_chars[i] = driveName.charAt(i);
      }
      lpRootPathName_chars[3] = '\0';
      int nVolumeNameSize = 256;
      CharBuffer lpVolumeNameBuffer_char = CharBuffer.allocate(nVolumeNameSize);
      LongByReference lpVolumeSerialNumber = new LongByReference();
      LongByReference lpMaximumComponentLength = new LongByReference();
      LongByReference lpFileSystemFlags = new LongByReference();
      int nFileSystemNameSize = 256;
      CharBuffer lpFileSystemNameBuffer_char = CharBuffer.allocate(nFileSystemNameSize);

      boolean result2 = Kernel32.INSTANCE.GetVolumeInformationW(
        lpRootPathName_chars,
View Full Code Here

        lpRootPathName_chars[i] = driveName.charAt(i);
      }
      lpRootPathName_chars[3] = '\0';
      int nVolumeNameSize = 256;
      CharBuffer lpVolumeNameBuffer_char = CharBuffer.allocate(nVolumeNameSize);
      LongByReference lpVolumeSerialNumber = new LongByReference();
      LongByReference lpMaximumComponentLength = new LongByReference();
      LongByReference lpFileSystemFlags = new LongByReference();
      int nFileSystemNameSize = 256;
      CharBuffer lpFileSystemNameBuffer_char = CharBuffer.allocate(nFileSystemNameSize);

      boolean result2 = Kernel32.INSTANCE.GetVolumeInformationW(
        lpRootPathName_chars,
View Full Code Here

TOP

Related Classes of com.sun.jna.ptr.LongByReference

Copyright © 2018 www.massapicom. 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.