Search in sources :

Example 1 with RASENTRY

use of com.sun.jna.platform.win32.WinRas.RASENTRY in project jna by java-native-access.

the class Rasapi32Test method testRasGetEntryProperties.

public void testRasGetEntryProperties() {
    RASENTRY.ByReference rasEntry = new RASENTRY.ByReference();
    IntByReference lpdwEntryInfoSize = new IntByReference(rasEntry.size());
    int err = Rasapi32.INSTANCE.RasGetEntryProperties(null, "TEST", rasEntry, lpdwEntryInfoSize, null, null);
    assertEquals(623, err);
}
Also used : IntByReference(com.sun.jna.ptr.IntByReference) RASENTRY(com.sun.jna.platform.win32.WinRas.RASENTRY) BOOLByReference(com.sun.jna.platform.win32.WinDef.BOOLByReference) IntByReference(com.sun.jna.ptr.IntByReference)

Example 2 with RASENTRY

use of com.sun.jna.platform.win32.WinRas.RASENTRY in project jna by java-native-access.

the class Rasapi32Util method getPhoneBookEntry.

/**
	 * Return the phone book entry.
	 * @param entryName the entry name
	 * @return the RAS entry
	 * @throws Ras32Exception any errors
	 */
public static RASENTRY.ByReference getPhoneBookEntry(String entryName) throws Ras32Exception {
    synchronized (phoneBookMutex) {
        RASENTRY.ByReference rasEntry = new RASENTRY.ByReference();
        IntByReference lpdwEntryInfoSize = new IntByReference(rasEntry.size());
        int err = Rasapi32.INSTANCE.RasGetEntryProperties(null, entryName, rasEntry, lpdwEntryInfoSize, null, null);
        if (err != WinError.ERROR_SUCCESS)
            throw new Ras32Exception(err);
        return rasEntry;
    }
}
Also used : IntByReference(com.sun.jna.ptr.IntByReference) RASENTRY(com.sun.jna.platform.win32.WinRas.RASENTRY) BOOLByReference(com.sun.jna.platform.win32.WinDef.BOOLByReference) HANDLEByReference(com.sun.jna.platform.win32.WinNT.HANDLEByReference) IntByReference(com.sun.jna.ptr.IntByReference)

Aggregations

BOOLByReference (com.sun.jna.platform.win32.WinDef.BOOLByReference)2 RASENTRY (com.sun.jna.platform.win32.WinRas.RASENTRY)2 IntByReference (com.sun.jna.ptr.IntByReference)2 HANDLEByReference (com.sun.jna.platform.win32.WinNT.HANDLEByReference)1