Previous Next

EngWritePrinter

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

BOOL
  EngWritePrinter(
    IN HANDLE  hPrinter,
    IN LPVOID  pBuf,
    IN DWORD  cbBuf,
    OUT LPDWORD  pcWritten
    );

Parameters

hPrinter
Caller-supplied handle to the printer. This should be the handle received as the DrvEnablePDEV function's hDriver parameter value.
pBuf
Caller-supplied pointer to a buffer containing a byte stream to be sent to the printer.
cbBuf
Specifies the caller-supplied number of bytes contained in the buffer pointed to by pBuf.
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.

Headers

Declared in winddi.h. Include winddi.h.

Comments

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.

See Also

DrvEnablePDEV, EngCreateBitmap, EngAllocUserMem