Package com.sun.jna.platform.win32.WinDef

Examples of com.sun.jna.platform.win32.WinDef.UINT_PTR.intValue()


    public void testVirtualQueryEx() {
        HANDLE selfHandle = Kernel32.INSTANCE.GetCurrentProcess();
        MEMORY_BASIC_INFORMATION mbi = new MEMORY_BASIC_INFORMATION();
        SIZE_T bytesRead = Kernel32.INSTANCE.VirtualQueryEx(selfHandle, Pointer.NULL, mbi, new SIZE_T(mbi.size()));
        assertTrue(bytesRead.intValue() > 0);
    }
}
View Full Code Here


    protected String getType(TYPEDESC typeDesc) {
        VARTYPE vt = typeDesc.vt;
        String type = "not_defined";

        if (vt.intValue() == Variant.VT_PTR) {
            TYPEDESC lptdesc = typeDesc._typedesc.getLptdesc();
            type = this.getType(lptdesc);
        } else if (vt.intValue() == Variant.VT_SAFEARRAY
                || vt.intValue() == Variant.VT_CARRAY) {
            TYPEDESC tdescElem = typeDesc._typedesc.getLpadesc().tdescElem;
View Full Code Here

        String type = "not_defined";

        if (vt.intValue() == Variant.VT_PTR) {
            TYPEDESC lptdesc = typeDesc._typedesc.getLptdesc();
            type = this.getType(lptdesc);
        } else if (vt.intValue() == Variant.VT_SAFEARRAY
                || vt.intValue() == Variant.VT_CARRAY) {
            TYPEDESC tdescElem = typeDesc._typedesc.getLpadesc().tdescElem;
            type = this.getType(tdescElem);
        } else if (vt.intValue() == Variant.VT_USERDEFINED) {
            HREFTYPE hreftype = typeDesc._typedesc.hreftype;
View Full Code Here

        if (vt.intValue() == Variant.VT_PTR) {
            TYPEDESC lptdesc = typeDesc._typedesc.getLptdesc();
            type = this.getType(lptdesc);
        } else if (vt.intValue() == Variant.VT_SAFEARRAY
                || vt.intValue() == Variant.VT_CARRAY) {
            TYPEDESC tdescElem = typeDesc._typedesc.getLpadesc().tdescElem;
            type = this.getType(tdescElem);
        } else if (vt.intValue() == Variant.VT_USERDEFINED) {
            HREFTYPE hreftype = typeDesc._typedesc.hreftype;
            type = this.getUserdefinedType(hreftype);
View Full Code Here

            type = this.getType(lptdesc);
        } else if (vt.intValue() == Variant.VT_SAFEARRAY
                || vt.intValue() == Variant.VT_CARRAY) {
            TYPEDESC tdescElem = typeDesc._typedesc.getLpadesc().tdescElem;
            type = this.getType(tdescElem);
        } else if (vt.intValue() == Variant.VT_USERDEFINED) {
            HREFTYPE hreftype = typeDesc._typedesc.hreftype;
            type = this.getUserdefinedType(hreftype);
        } else {
            type = this.getVarType(vt);
        }
View Full Code Here

    // Capabilities string
    DWORDByReference pdwCapabilitiesStringLengthInCharacters = new DWORDByReference();
    Dxva2.INSTANCE.GetCapabilitiesStringLength(hPhysicalMonitor, pdwCapabilitiesStringLengthInCharacters);
    DWORD capStrLen = pdwCapabilitiesStringLengthInCharacters.getValue();
   
    LPSTR pszASCIICapabilitiesString = new LPSTR(new Memory(capStrLen.intValue()));
    Dxva2.INSTANCE.CapabilitiesRequestAndCapabilitiesReply(hPhysicalMonitor, pszASCIICapabilitiesString, capStrLen);
    System.out.println("Cap-String:" + new String(pszASCIICapabilitiesString.getPointer().getString(0)));

    // Position
    MC_POSITION_TYPE ptPositionType = MC_POSITION_TYPE.MC_HORIZONTAL_POSITION;
View Full Code Here

      assertEquals(0, lpBuffer.ullAvailExtendedVirtual.intValue());
    }

    public void testGetLogicalDriveStrings() {
      DWORD dwSize = Kernel32.INSTANCE.GetLogicalDriveStrings(new DWORD(0), null);
      assertTrue(dwSize.intValue() > 0);
      char buf[] = new char[dwSize.intValue()];
      assertTrue(Kernel32.INSTANCE.GetLogicalDriveStrings(dwSize, buf).intValue() > 0);
    }

    public void testGetDiskFreeSpaceEx() {
View Full Code Here

    }

    public void testGetLogicalDriveStrings() {
      DWORD dwSize = Kernel32.INSTANCE.GetLogicalDriveStrings(new DWORD(0), null);
      assertTrue(dwSize.intValue() > 0);
      char buf[] = new char[dwSize.intValue()];
      assertTrue(Kernel32.INSTANCE.GetLogicalDriveStrings(dwSize, buf).intValue() > 0);
    }

    public void testGetDiskFreeSpaceEx() {
      LARGE_INTEGER.ByReference lpFreeBytesAvailable = new LARGE_INTEGER.ByReference();
View Full Code Here

        writer.close();

        final char[] buffer = new char[8];
       
        DWORD len = Kernel32.INSTANCE.GetPrivateProfileString("Section", "existingKey", "DEF", buffer, new DWORD(buffer.length), tmp.getCanonicalPath());
        assertEquals(3, len.intValue());
        assertEquals("ABC", Native.toString(buffer));
       
        len = Kernel32.INSTANCE.GetPrivateProfileString("Section", "missingKey", "DEF", buffer, new DWORD(buffer.length), tmp.getCanonicalPath());
        assertEquals(3, len.intValue());
        assertEquals("DEF", Native.toString(buffer));
View Full Code Here

        DWORD len = Kernel32.INSTANCE.GetPrivateProfileString("Section", "existingKey", "DEF", buffer, new DWORD(buffer.length), tmp.getCanonicalPath());
        assertEquals(3, len.intValue());
        assertEquals("ABC", Native.toString(buffer));
       
        len = Kernel32.INSTANCE.GetPrivateProfileString("Section", "missingKey", "DEF", buffer, new DWORD(buffer.length), tmp.getCanonicalPath());
        assertEquals(3, len.intValue());
        assertEquals("DEF", Native.toString(buffer));
    }

    public final void testWritePrivateProfileString() throws IOException {
        final File tmp = File.createTempFile("testWritePrivateProfileString", ".ini");
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.