1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#![allow(non_snake_case)]

use crate::decl::*;
use crate::gdi::ffi;
use crate::kernel::privs::*;

/// [`GdiFlush`](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-gdiflush)
/// function.
pub fn GdiFlush() -> SysResult<()> {
	bool_to_sysresult(unsafe { ffi::GdiFlush() })
}

/// [`GdiGetBatchLimit`](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-gdigetbatchlimit)
/// function.
///
/// # Related functions
///
/// * [`GdiSetBatchLimit`](crate::GdiSetBatchLimit)
#[must_use]
pub fn GdiGetBatchLimit() -> u32 {
	unsafe { ffi::GdiGetBatchLimit() }
}

/// [`GdiSetBatchLimit`](https://learn.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-gdisetbatchlimit)
/// function.
///
/// # Related functions
///
/// * [`GdiGetBatchLimit`](crate::GdiGetBatchLimit)
pub fn GdiSetBatchLimit(limit: u32) -> SysResult<u32> {
	match unsafe { ffi::GdiSetBatchLimit(limit) } {
		0 => Err(GetLastError()),
		n => Ok(n),
	}
}