OpenPrinter function winspool

Win32Result<bool> OpenPrinter(
  1. PCWSTR? pPrinterName,
  2. Pointer<Pointer<NativeType>> phPrinter,
  3. Pointer<PRINTER_DEFAULTS>? pDefault
)

Retrieves a handle to the specified printer or print server or other types of handles in the print subsystem.

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

Implementation

Win32Result<bool> OpenPrinter(
  PCWSTR? pPrinterName,
  Pointer<Pointer> phPrinter,
  Pointer<PRINTER_DEFAULTS>? pDefault,
) {
  final result_ = OpenPrinterW_Wrapper(
    pPrinterName ?? nullptr,
    phPrinter,
    pDefault ?? nullptr,
  );
  return Win32Result(value: result_.value.i32 != FALSE, error: result_.error);
}