use of com.sun.jna.platform.win32.WinBase.FILETIME in project jna by java-native-access.
the class Kernel32Test method testGetSystemTimes.
public void testGetSystemTimes() {
Kernel32 kernel = Kernel32.INSTANCE;
FILETIME lpIdleTime = new FILETIME();
FILETIME lpKernelTime = new FILETIME();
FILETIME lpUserTime = new FILETIME();
boolean succ = kernel.GetSystemTimes(lpIdleTime, lpKernelTime, lpUserTime);
assertTrue(succ);
long idleTime = lpIdleTime.toDWordLong().longValue();
long kernelTime = lpKernelTime.toDWordLong().longValue();
long userTime = lpUserTime.toDWordLong().longValue();
// All should be >= 0. kernel includes idle.
assertTrue(idleTime >= 0);
assertTrue(kernelTime >= idleTime);
assertTrue(userTime >= 0);
}
use of com.sun.jna.platform.win32.WinBase.FILETIME in project jna by java-native-access.
the class Advapi32Test method testRegQueryInfoKey.
public void testRegQueryInfoKey() {
IntByReference lpcClass = new IntByReference();
IntByReference lpcSubKeys = new IntByReference();
IntByReference lpcMaxSubKeyLen = new IntByReference();
IntByReference lpcValues = new IntByReference();
IntByReference lpcMaxClassLen = new IntByReference();
IntByReference lpcMaxValueNameLen = new IntByReference();
IntByReference lpcMaxValueLen = new IntByReference();
IntByReference lpcbSecurityDescriptor = new IntByReference();
FILETIME lpftLastWriteTime = new FILETIME();
assertEquals(W32Errors.ERROR_SUCCESS, Advapi32.INSTANCE.RegQueryInfoKey(WinReg.HKEY_LOCAL_MACHINE, null, lpcClass, null, lpcSubKeys, lpcMaxSubKeyLen, lpcMaxClassLen, lpcValues, lpcMaxValueNameLen, lpcMaxValueLen, lpcbSecurityDescriptor, lpftLastWriteTime));
assertTrue(lpcSubKeys.getValue() > 0);
}
Aggregations