use of com.sun.jna.platform.win32.WinNT.GENERIC_MAPPING in project jna by java-native-access.
the class Advapi32Test method testMapGenericWriteMask.
public void testMapGenericWriteMask() {
final GENERIC_MAPPING mapping = new GENERIC_MAPPING();
mapping.genericRead = new DWORD(FILE_GENERIC_READ);
mapping.genericWrite = new DWORD(FILE_GENERIC_WRITE);
mapping.genericExecute = new DWORD(FILE_GENERIC_EXECUTE);
mapping.genericAll = new DWORD(FILE_ALL_ACCESS);
final DWORDByReference rights = new DWORDByReference(new DWORD(GENERIC_WRITE));
Advapi32.INSTANCE.MapGenericMask(rights, mapping);
assertEquals(FILE_GENERIC_WRITE, rights.getValue().intValue());
assertTrue(GENERIC_WRITE != (rights.getValue().intValue() & GENERIC_WRITE));
}
Aggregations