use of com.sun.jna.platform.win32.WinDef.DWORDByReference in project jna by java-native-access.
the class Dxva2Test method setUp.
@Before
public void setUp() {
HMONITOR hMonitor = User32.INSTANCE.MonitorFromWindow(User32.INSTANCE.GetDesktopWindow(), WinUser.MONITOR_DEFAULTTOPRIMARY);
DWORDByReference pdwNumberOfPhysicalMonitors = new DWORDByReference();
assertTrue(Dxva2.INSTANCE.GetNumberOfPhysicalMonitorsFromHMONITOR(hMonitor, pdwNumberOfPhysicalMonitors).booleanValue());
monitorCount = pdwNumberOfPhysicalMonitors.getValue().intValue();
physMons = new PHYSICAL_MONITOR[monitorCount];
assumeTrue(Dxva2.INSTANCE.GetPhysicalMonitorsFromHMONITOR(hMonitor, monitorCount, physMons).booleanValue());
}
use of com.sun.jna.platform.win32.WinDef.DWORDByReference in project jna by java-native-access.
the class Kernel32DiskManagementFunctionsTest method testGetDiskFreeSpace.
private void testGetDiskFreeSpace(String lpRootPathName) {
DWORDByReference lpSectorsPerCluster = new DWORDByReference();
DWORDByReference lpBytesPerSector = new DWORDByReference();
DWORDByReference lpNumberOfFreeClusters = new DWORDByReference();
DWORDByReference lpTotalNumberOfClusters = new DWORDByReference();
assertCallSucceeded("GetDiskFreeSpace(" + lpRootPathName + ")", Kernel32.INSTANCE.GetDiskFreeSpace(lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters));
// System.out.append(getCurrentTestName()).append('[').append(lpRootPathName).println(']');
// System.out.append('\t').append("SectorsPerCluster: ").println(lpSectorsPerCluster.getValue());
// System.out.append('\t').append("BytesPerSector: ").println(lpBytesPerSector.getValue());
// System.out.append('\t').append("NumberOfFreeClusters: ").println(lpNumberOfFreeClusters.getValue());
// System.out.append('\t').append("TotalNumberOfClusters: ").println(lpTotalNumberOfClusters.getValue());
DWORD freeSize = lpNumberOfFreeClusters.getValue();
assertTrue("No free clusters for " + lpRootPathName, freeSize.longValue() > 0L);
DWORD totalSize = lpTotalNumberOfClusters.getValue();
assertTrue("Free clusters (" + freeSize + ") not below total (" + totalSize + ") for " + lpRootPathName, freeSize.longValue() < totalSize.longValue());
}
use of com.sun.jna.platform.win32.WinDef.DWORDByReference in project jna by java-native-access.
the class Dxva2Test method testGetMonitorContrast.
@Test
public void testGetMonitorContrast() {
HANDLE hPhysicalMonitor = physMons[0].hPhysicalMonitor;
// the method returns FALSE if the monitor driver doesn't support it,
// but verifies that the JNA mapping is correct (no exception)
DWORDByReference pdwMinimumContrast = new DWORDByReference();
DWORDByReference pdwCurrentContrast = new DWORDByReference();
DWORDByReference pdwMaximumContrast = new DWORDByReference();
Dxva2.INSTANCE.GetMonitorContrast(hPhysicalMonitor, pdwMinimumContrast, pdwCurrentContrast, pdwMaximumContrast);
}
use of com.sun.jna.platform.win32.WinDef.DWORDByReference in project jna by java-native-access.
the class Dxva2Test method testGetMonitorRedGreenOrBlueDrive.
@Test
public void testGetMonitorRedGreenOrBlueDrive() {
HANDLE hPhysicalMonitor = physMons[0].hPhysicalMonitor;
// the method returns FALSE if the monitor driver doesn't support it,
// but verifies that the JNA mapping is correct (no exception)
MC_DRIVE_TYPE ptDriveType = MC_DRIVE_TYPE.MC_RED_DRIVE;
DWORDByReference pdwMinimumDrive = new DWORDByReference();
DWORDByReference pdwCurrentDrive = new DWORDByReference();
DWORDByReference pdwMaximumDrive = new DWORDByReference();
Dxva2.INSTANCE.GetMonitorRedGreenOrBlueDrive(hPhysicalMonitor, ptDriveType, pdwMinimumDrive, pdwCurrentDrive, pdwMaximumDrive);
}
use of com.sun.jna.platform.win32.WinDef.DWORDByReference in project jna by java-native-access.
the class Dxva2Test method testGetMonitorBrightness.
@Test
public void testGetMonitorBrightness() {
HANDLE hPhysicalMonitor = physMons[0].hPhysicalMonitor;
// the method returns FALSE if the monitor driver doesn't support it,
// but verifies that the JNA mapping is correct (no exception)
DWORDByReference pdwMinimumBrightness = new DWORDByReference();
DWORDByReference pdwCurrentBrightness = new DWORDByReference();
DWORDByReference pdwMaximumBrightness = new DWORDByReference();
Dxva2.INSTANCE.GetMonitorBrightness(hPhysicalMonitor, pdwMinimumBrightness, pdwCurrentBrightness, pdwMaximumBrightness);
}
Aggregations