OpenPrinter2 function winspool
Win32Result<bool>
OpenPrinter2(
- PCWSTR? pPrinterName,
- Pointer<
Pointer< phPrinter,NativeType> > - Pointer<
PRINTER_DEFAULTS> ? pDefault, - Pointer<
PRINTER_OPTIONS> ? pOptions,
Retrieves a handle to the specified printer, print server, or other types of handles in the print subsystem, while setting some of the printer options.
To learn more, see learn.microsoft.com/windows/win32/printdocs/openprinter2.
Implementation
Win32Result<bool> OpenPrinter2(
PCWSTR? pPrinterName,
Pointer<Pointer> phPrinter,
Pointer<PRINTER_DEFAULTS>? pDefault,
Pointer<PRINTER_OPTIONS>? pOptions,
) {
resolveGetLastError();
final result_ = _OpenPrinter2(
pPrinterName ?? nullptr,
phPrinter,
pDefault ?? nullptr,
pOptions ?? nullptr,
);
return .new(value: result_ != FALSE, error: GetLastError());
}