EngWritePrinter function (winddi.h)

The EngWritePrinter function allows printer graphics DLLs to send a data stream to printer hardware.

Syntax

ENGAPI BOOL EngWritePrinter(
  [in]  HANDLE  hPrinter,
  [in]  LPVOID  pBuf,
  [in]  DWORD   cbBuf,
  [out] LPDWORD pcWritten
);

Parameters

[in] hPrinter

Caller-supplied handle to the printer. This should be the handle received as the DrvEnablePDEV function's hDriver parameter value.

[in] pBuf

Caller-supplied pointer to a buffer containing a byte stream to be sent to the printer.

[in] cbBuf

Specifies the caller-supplied number of bytes contained in the buffer pointed to by pBuf.

[out] pcWritten

Caller-supplied pointer to a DWORD location that receives the number of bytes actually written to the printer.

Return value

If the operation succeeds, the function returns TRUE; otherwise it returns FALSE.

Remarks

Printer graphics DLLs call EngWritePrinter to send data streams (either control sequences or image data) to the print spooler, which in turn sends the data to the printer hardware by calling the appropriate print monitor. The function returns after the spooler receives the data.

The buffer pointed to by pBuf cannot be in user memory; that is, pBuf cannot point to memory allocated by EngCreateBitmap with the BMF_USERMEM flag set or by EngAllocUserMem.

For additional information about calling EngWritePrinter, see Rendering a Print Job.

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

EngAllocUserMem

EngCreateBitmap