GetPrinterDataFromPort

BOOL (WINAPI *pfnGetPrinterDataFromPort)(

    HANDLE hPort,

    DWORD ControlID,

    LPWSTR pValueName,

    LPWSTR lpInBuffer,

    DWORD cbInBuffer,

    LPWSTR lpOutBuffer,

    DWORD  cbOutBuffer,

    LPDWORD lpcbReturned

   );

GetPrinterDataFromPort gets data from a bidirectional printer.

Parameters

hPort
Handle to the port to which the bidirectional printer is connected.
ControlID
Specifies the I/O control code for the operation.
pValueName
Points to a null-terminated string value understood by both monitors and print drivers. Vendors can define a set of values for this parameter that their language monitor can interpret as requests for bidirectional printer status from their printer driver(s).

Port monitors should ignore this parameter.

lpInBuffer
Points to a buffer containing the data required to perform the operation. This parameter can be null if the call does not require input data.
cbInBuffer
Specifies the size, in bytes, of lpInBuffer.
lpOutBuffer
Points to a buffer in which the specified operation’s output data is returned. This parameter can be null if the call does not produce output data.
cbOutBuffer
Specifies the size, in bytes, of lpOutBuffer.
lpcbReturned
Points to a DWORD in which the number of bytes written in lpOutBuffer is returned.

Return Value

GetPrinterDataFromPort returns TRUE if the operation is successful; otherwise, it returns FALSE.

Comments

A port monitor can implement GetPrinterDataFromPort to provide IEEE 1284 support for a language monitor’s usage. A language monitor can support GetPrinterDataFromPort to query information from a bidirectional printer that supports the IEEE 1284 standard. Vendors define the status request strings passed from a language monitor to the associated bidirectional printer.

Monitors should log the ERROR_INVALID_PARAMETER error for all calls that they do not understand. This ensures that the spooler will then try to read the key from the registry directly.

GetPrinterDataFromPort can be optionally implemented by all monitors.

See Also

ReadPort