WritePort


BOOL WritePort(
    HANDLE   hPort,
    LPBYTE   pBuffer,
    DWORD    cbBuf,
    LPDWORD  pcbWritten
);

Writes data to the printer.

hPort

The handle of the port to which to write the data.

pBuffer

Points to the buffer that contains the data to be written.

cbBuf

The size of the buffer, in bytes, pointed to by the pBuffer parameter.

pcbWritten

Points to a memory location in which to put the number of bytes written.


The port monitor WritePort function sends the data in the buffer pointed to by pBuffer to the printer. If an error is returned, the spooler displays a dialog box.

The WritePort function is called repeatedly to send blocks of data to the printer. The WritePort function in your port monitor can call the SetJob function to modify print job state information.