use of com.sun.jna.platform.win32.WinNT.OSVERSIONINFO in project jna by java-native-access.
the class Kernel32Test method testGetVersionEx_OSVERSIONINFO.
public void testGetVersionEx_OSVERSIONINFO() {
OSVERSIONINFO lpVersionInfo = new OSVERSIONINFO();
assertEquals(lpVersionInfo.size(), lpVersionInfo.dwOSVersionInfoSize.longValue());
assertTrue(Kernel32.INSTANCE.GetVersionEx(lpVersionInfo));
assertTrue(lpVersionInfo.dwMajorVersion.longValue() > 0);
assertTrue(lpVersionInfo.dwMinorVersion.longValue() >= 0);
assertEquals(lpVersionInfo.size(), lpVersionInfo.dwOSVersionInfoSize.longValue());
assertTrue(lpVersionInfo.dwPlatformId.longValue() > 0);
assertTrue(lpVersionInfo.dwBuildNumber.longValue() > 0);
assertTrue(Native.toString(lpVersionInfo.szCSDVersion).length() >= 0);
}
use of com.sun.jna.platform.win32.WinNT.OSVERSIONINFO in project jna by java-native-access.
the class Kernel32Test method main.
public static void main(String[] args) {
OSVERSIONINFO lpVersionInfo = new OSVERSIONINFO();
assertTrue(Kernel32.INSTANCE.GetVersionEx(lpVersionInfo));
System.out.println("Operating system: " + lpVersionInfo.dwMajorVersion.longValue() + "." + lpVersionInfo.dwMinorVersion.longValue() + " (" + lpVersionInfo.dwBuildNumber + ")" + " [" + Native.toString(lpVersionInfo.szCSDVersion) + "]");
junit.textui.TestRunner.run(Kernel32Test.class);
}
Aggregations