IPrintOemUni2::WritePrinter method (prcomoem.h)

The IPrintOemUni2::WritePrinter method, if supported, enables a rendering plug-in to capture all output data generated by a Unidrv driver. If this method is not supported, the output data would otherwise be sent to the spooler in a call to the spooler's WritePrinter API (described in the Microsoft Windows SDK documentation).

Syntax

HRESULT WritePrinter(
  PDEVOBJ pdevobj,
  PVOID   pBuf,
  DWORD   cbBuffer,
  PDWORD  pcbWritten
);

Parameters

pdevobj

Pointer to a DEVOBJ structure.

pBuf

Pointer to the first byte of an array of bytes that contains the output data generated by the Unidrv driver.

cbBuffer

Specifies the size, in bytes, of the array pointed to by pBuf.

pcbWritten

Pointer to a DWORD value that receives the number of bytes of data that were successfully sent to the plug-in.

Return value

If successful, this method returns S_OK. Otherwise, this method should return an appropriate value in the returned HRESULT.

Remarks

At DrvEnablePDEV time, the Unidrv driver calls this method with pBuf and pdevobj set to NULL, and cbBuf set to 0, to detect whether the plug-in implements this function. The plug-in should return S_OK to indicate it implements this method, and should return E_NOTIMPL otherwise.

This method should report the number of bytes written to the spooler's WritePrinter function in pcbWritten. A value of zero carries no special meaning; errors must be reported through the returned HRESULT.

The IPrintOemUni2::WritePrinter method is optional. If a rendering plug-in implements this method, the plug-in's IPrintOemUni::GetImplementedMethod method must return S_OK when it receives "WritePrinter" as input.

Requirements

Requirement Value
Target Platform Desktop
Header prcomoem.h (include Prcomoem.h)