use of com.sun.jna.platform.win32.LMAccess.USER_INFO_1 in project jna by java-native-access.
the class Netapi32Test method testNetUserAdd.
public void testNetUserAdd() {
USER_INFO_1 userInfo = new USER_INFO_1();
userInfo.usri1_name = "JNANetapi32TestUser";
userInfo.usri1_password = "!JNAP$$Wrd0";
userInfo.usri1_priv = LMAccess.USER_PRIV_USER;
// ignore test if not able to add user (need to be administrator to do this).
if (LMErr.NERR_Success != Netapi32.INSTANCE.NetUserAdd(Kernel32Util.getComputerName(), 1, userInfo, null)) {
return;
}
assertEquals(LMErr.NERR_Success, Netapi32.INSTANCE.NetUserDel(Kernel32Util.getComputerName(), userInfo.usri1_name.toString()));
}
Aggregations