Search in sources :

Example 1 with GROUP_INFO_2

use of com.sun.jna.platform.win32.LMAccess.GROUP_INFO_2 in project jna by java-native-access.

the class Netapi32Test method testNetGroupEnum.

public void testNetGroupEnum() {
    PointerByReference bufptr = new PointerByReference();
    IntByReference entriesread = new IntByReference();
    IntByReference totalentries = new IntByReference();
    assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetGroupEnum(null, 2, bufptr, LMCons.MAX_PREFERRED_LENGTH, entriesread, totalentries, null));
    GROUP_INFO_2 group = new GROUP_INFO_2(bufptr.getValue());
    GROUP_INFO_2[] groups = (GROUP_INFO_2[]) group.toArray(entriesread.getValue());
    for (GROUP_INFO_2 grpi : groups) {
        assertTrue(grpi.grpi2_name.length() > 0);
    }
    assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetApiBufferFree(bufptr.getValue()));
}
Also used : IntByReference(com.sun.jna.ptr.IntByReference) GROUP_INFO_2(com.sun.jna.platform.win32.LMAccess.GROUP_INFO_2) PointerByReference(com.sun.jna.ptr.PointerByReference)

Aggregations

GROUP_INFO_2 (com.sun.jna.platform.win32.LMAccess.GROUP_INFO_2)1 IntByReference (com.sun.jna.ptr.IntByReference)1 PointerByReference (com.sun.jna.ptr.PointerByReference)1