SetPrinter function winspool

Win32Result<bool> SetPrinter(
  1. PRINTER_HANDLE hPrinter,
  2. int level,
  3. Pointer<Uint8>? pPrinter,
  4. int command,
)

Sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs.

To learn more, see learn.microsoft.com/windows/win32/printdocs/setprinter.

Implementation

Win32Result<bool> SetPrinter(
  PRINTER_HANDLE hPrinter,
  int level,
  Pointer<Uint8>? pPrinter,
  int command,
) {
  resolveGetLastError();
  final result_ = _SetPrinter(hPrinter, level, pPrinter ?? nullptr, command);
  return .new(value: result_ != FALSE, error: GetLastError());
}