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);
}
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;
}
}
Aggregations