Reference

The following topics describe the functions and structures used with language monitors that differ from the functions and structures used by port monitors.

GetPrinterDataFromPort

BOOL GetPrinterDataFromPort(
    HANDLE   hPort,
    DWORD    ControlID,
    LPTSTR   pValueName,
    LPTSTR   lpInBuffer,
    DWORD    cbInBuffer,
    LPTSTR   lpOutBuffer,
    DWORD    cbOutBuffer,
    LPDWORD  lpcbReturned
);
 

Gets data from a bidirectional printer by providing IEEE 1284 support.

hPort The handle of the port to which the bidirectional printer is connected.
ControlID Specifies the control code for the operation.
pValueName A string that contains a name understood by both the language monitor and the printer driver with which it was associated at printer installation time. Since both the language monitor and printer driver are developed by a printer vendor, the developer can define a set of values for this pValueName parameter which the language monitor can interpret as requests for bidirectional printer status from the printer driver.
lpInBuffer Points to a buffer containing the data required to perform the operation. This parameter can be NULL if the ControlID parameter specifies an operation that does not require input data.
cbInBuffer Size of the input buffer, in bytes.
lpOutBuffer Points to a buffer in which to return the specified operation's output data. This parameter can be NULL if the ControlID parameter specifies an operation that does not produce output data.
cbOutBuffer Size of the output buffer, in bytes.
lpcbReturned Points to a variable that receives the actual size, in bytes, of the output data returned in the output buffer.

The GetPrinterDataFromPort function can be used to make any IEEE 1284 specification IOCTL call.

The language monitor GetPrinterDataFromPort function is called by the printer driver associated with the language monitor at printer installation. If the language monitor does not have the bidirectional printer status information requested by the printer driver, the language monitor can call the port monitor GetPrinterDataFromPort or ReadPort function to get current printer status information.