EngGetPrinter function (winddi.h)

The EngGetPrinter function retrieves information about the specified printer.

Syntax

ENGAPI BOOL EngGetPrinter(
  [in]            HANDLE  hPrinter,
  [in]            DWORD   dwLevel,
  [out, optional] LPBYTE  pPrinter,
  [in]            DWORD   cbBuf,
  [out]           LPDWORD pcbNeeded
);

Parameters

[in] hPrinter

Handle to the printer for which data should be retrieved. This is the handle that is passed as the hDriver parameter of DrvEnablePDEV.

[in] dwLevel

Specifies the version of the structure to which pPrinter points. This parameter can have any of the following values:

Value Structure Returned via pPrinter
1 PRINTER_INFO_1
2 PRINTER_INFO_2
3 PRINTER_INFO_3
4 PRINTER_INFO_4
5 PRINTER_INFO_5

[out, optional] pPrinter

Pointer to the memory buffer in which the printer information structure, identified by dwLevel, is loaded.

[in] cbBuf

Specifies the size, in bytes, of the memory buffer pointed to by pPrinter.

[out] pcbNeeded

Pointer to a memory location that receives the number of bytes copied if the function succeeds, or the number of required bytes if cbBuf is too small.

Return value

EngGetPrinter returns TRUE upon success; otherwise, it logs an error and returns FALSE. To get error information, call EngGetLastError.

Remarks

The PRINTER_INFO_X structures are defined in the Microsoft Windows SDK documentation.

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of the Windows operating systems.
Target Platform Universal
Header winddi.h (include Winddi.h)
Library Win32k.lib
DLL Win32k.sys

See also

DrvEnablePDEV