EngWritePrinter

BOOL EngWritePrinter(

    HANDLE hPrinter,

    LPVOID pBuf,

    DWORD cbBuf,

    LPDWORD pcWritten

   );

EngWritePrinter provides the print spooler with data that needs to be written to the specified printer.

Parameters

hPrinter
Handle that identifies the printer to use.
pBuf
Pointer to data to be written to the printer.
cbBuf
Specifies the size, in bytes, of pBuf.
pcWritten
Pointer to a DWORD in which the number of bytes actually written to the printer is returned.

Return Value

The return value is TRUE if the function succeeds; otherwise it is FALSE.

Comments

Printer drivers call EngWritePrinter when they have data to output. Control is returned to the printer driver immediately after the data is spooled, so that the driver can continue to process print requests.

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