Command values

From EDM2
(Redirected from BIDI SEND PASSTHRU(8001h))
Jump to: navigation, search

BIDI_ADD_VIRTUAL_PORT

BIDI_ADD_VIRTUAL_PORT(26h) adds a virtual printer port. This command is sent to the port driver to notify it that a port for querying purposes only has been added. The port driver does not know about the printer port passed into SplPdSet when BIDI_ADD_VIRTUAL_PORT(26h) is sent.

BIDI_CANCELJOB

BIDI_CANCELJOB(6h) cancels a job in the printer.

For all PRT_xx_JOB commands, if the caller does not know the printer job ID, the caller can set both InterpreterID and ulPrinterJobID to -1 and pass in the spooler job ID. The spooler will set the printer job ID based on information stored about the spooler job ID.

BIDI_DEL_PORT

BIDI_DEL_PORT(28h) is sent to the protocol converter and the port driver after a spooler port has been removed, even if the port driver is the application removing the port. It is not sent when a virtual port is removed. The protocol converter and port driver can free any instance data stored for the printer port.

Note: Port drivers are normally called to remove a port by the print object, but any application can remove a port by updating the system .INI file.

BIDI_DEL_VIRTUAL_PORT

BIDI_DEL_VIRTUAL_PORT(27h) deletes a virtual printer port. This command is sent to the port driver when an application calls SplDeletePort to remove a virtual port.

BIDI_DISABLE_ALERT

BIDI_DISABLE_ALERT(25h) disables alerts for the printer. This command is sent as a result of an application calling SplUnRegister to unregister for alerts. Only the alert(s) specified are disabled.

BIDI_ENABLE_ALERT

BIDI_ENABLE_ALERT(24h) enables alerts for the printer. This command is sent as a result of an application calling SplRegister to register for alerts. The alert(s) specified are enabled, in addition to any currently enabled alerts for the printer.

BIDI_END_PASSTHRU

BIDI_END_PASSTHRU(1Bh) terminates a passthru reading session. This command releases the port's passthru session and allows another application to start a temporary passthru session.

BIDI_ENDJOB

BIDI_ENDJOB(3h) is called by the port driver during SplPdClose to signal the end of the print job being sent to the printer.

Note: For this and all other BIDI_xx_JOB command structures, the caller of PrtSet can set the following parameters in the PRTJOB data structure:

  • ulInterpreterID - set to -1
  • ulPrinterJobID - set to -1

This will let the spooler fill in the values based on the current job being sent to this printer port.

BIDI_HOLDJOB

BIDI_HOLDJOB(4h) holds a job in the printer.

BIDI_INIT

BIDI_INIT(Bh) sets the printer to BIDI mode and changes the printer from unidirectional to bidirectional. BIDI_INIT is called after a BIDI_TERM call to restart bidirectional printing.

BIDI_INIT_PORTDRV

BIDI_INIT_PORTDRV(8h) initializes a port driver. This command is sent during spooler initialization and when a port driver is first installed. BIDI_INIT_PORTDRV(8h) is called only once per port driver. No other commands are sent to the port driver until this command completes. As a result, a port driver that opens network adapters has the opportunity to do so while processing the BIDI_INIT_PORTDRV(8h) command.

A port driver can spawn threads at this time, if another thread is needed in order to keep the printer connection active.

Note: If the port driver returns an error, the spooler may unload the port driver. No jobs will be sent to this port driver until the BIDI_INIT_PORTDRV(8h) command succeeds.

BIDI_INIT_PROTCNV

BIDI_INIT_PROTCNV(Fh) initializes the protocol converter for a port. The spooler passes the BIDI_Q_PORT command structure, returned by the port driver, to the protocol converter using BIDI_INIT_PROTCNV(Fh). The protocol converter should initialize its cache for the given port name.

Note: If a protocol converter or extension is unable to support the printer, it should return ERROR_NOT_SUPPORTED for BIDI_INIT_PROTCNV(Fh).

BIDI_NOTIFY_ENDJOBCONNECT

BIDI_NOTIFY_ENDJOBCONNECT(20h) notifies the port driver that a job connection is not needed. The spooler sends this command to notify the port driver that no jobs are waiting for confirmation from the printer.

BIDI_NOTIFY_ENDJOBCONNECT(20h) allows the port driver to know when the spooler is not currently using the printer for print jobs. It does not imply that the spooler will not use the printer again in the near future.

BIDI_NOTIFY_PORT_RELEASED

BIDI_NOTIFY_PORT_RELEASED(22h) notifies the port driver that the port is no longer selected in a print object. The spooler sends this command to notify the port driver that the output port is no longer connected to a print queue. BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler will not be sending print jobs to this printer.

The port driver should not assume that no job can be sent to this port, because an application can still print OD_DIRECT to this port. BIDI_NOTIFY_PORT_RELEASED(22h) can assist the port driver in determining the type of connection necessary for the printer.

BIDI_NOTIFY_PORT_SELECTED

BIDI_NOTIFY_PORT_SELECTED(21h) notifies the port driver that the port is selected in a print object. The spooler sends this command to notify the port driver that the output port is selected by a print queue.

BIDI_NOTIFY_PORT_SELECTED(21h) allows the port driver to know that the spooler has a print queue connected to this printer and that jobs may be submitted to this printer. This command can assist the port driver in determining the type of connection necessary for the printer.

BIDI_PACKET_SIZE

BIDI_PACKET_SIZE(Eh) defines the printer-to-host maximum packet size.

BIDI_Q_CONVERTER_INFO

BIDI_Q_CONVERTER_INFO(8021h) gets protocol converter information.

This function returns information about the protocol converter currently active for the printer. If an extension protocol converter is being used, the extension should call the base converter to get the information about the base converter. The extension converter should then copy the base converter version and strings into the caller's buffer, along with the extension's information.

BIDI_Q_DEVICE

BIDI_Q_DEVICE(800Dh) queries the printer device characteristics. This function returns the capabilities and characteristics of the printer.

BIDI_Q_FONTS

BIDI_Q_FONTS(8012h) queries fonts for a particular

BIDI_Q_INPUTBINS

BIDI_Q_INPUTBINS(800Fh) queries input bins.

BIDI_Q_INTERPRETER

BIDI_Q_INTERPRETER(800Eh) returns information on interpreters that are available in the printer.

BIDI_Q_JOBID

BIDI_Q_JOBID(8017h) returns the printer job ID for the job being sent to this port. This function call is issued by the spooler during PrtOpen, after a successful SplPdOpen to the port driver. It allows the spooler to synchronize the printer job ID with the spooler job ID.

BIDI_Q_JOBS_COMPLETE

BIDI_Q_JOBS_COMPLETE(8013h) returns a list of completed jobs known to the printer.

BIDI_Q_JOBS_QUEUED

BIDI_Q_JOBS_QUEUED(8014h) returns a list of queued jobs known to the printer.

BIDI_Q_OUTPUTBINS

BIDI_Q_OUTPUTBINS(8010h) queries output bins.

BIDI_Q_PORT

BIDI_Q_PORT(800Bh) queries the port configuration from the port driver. This function returns BIDI capabilities of the port and the BIDI software protocol of the attached printer. It also performs an implicit BIDI_INIT(Bh) to the port driver to put the printer in BIDI mode.

BIDI_Q_PORT(800Bh) does not go to the BIDI protocol converter because the information returned is used to determine the BIDI protocol converter to be used for the port.

BIDI_Q_PORTDRV

BIDI_Q_PORTDRV(8019h) queries the port driver's configuration for the port.

BIDI_Q_RESPONSE_FMT

BIDI_Q_RESPONSE_FMT(8018h) returns the format of the printer-to-host messages.

The spooler calls the protocol converter to get this information. The information is passed to the port driver as BIDI_RESPONSE_FMT(Dh), to let the port driver determine printer response message boundaries.

BIDI_Q_STORAGE

BIDI_Q_STORAGE(8023h) returns printer storage media information.

BIDI_Q_SPOOLER_VERSION

BIDI_Q_SPOOLER_VERSION(8022h) gets version information about the spooler.

This information can be used by an application to determine if the spooler on a remote server supports the PrtQuery and PrtSet APIs.

BIDI_Q_STATUS

BIDI_Q_STATUS(8015h) queries the protocol converter for the current status of the print device.

BIDI_Q_SW

BIDI_Q_SW(800Ch) queries BIDI software capabilities.

BIDI_READ_ALERT

BIDI_READ_ALERT(801Dh) requests extended alert information from the protocol converter.

BIDI_READ_PASSTHRU

BIDI_READ_PASSTHRU(8001h) waits for any response from the printer and must be done from within a passthru session.

See #BIDI_START_PASSTHRU(1Ah) for more details. #BIDI_SEND_PASSTHRU(1h) must be called to send any protocol-specific commands to the printer.

BIDI_RELEASEJOB

BIDI_RELEASEJOB(5h) releases a job held in the printer.

BIDI_RESET

BIDI_RESET(9h) resets the printer. This command resets the printer to the state defined in ulResetValue. If the printer is connected using a network card, the network card is not reset.

BIDI_RESPONSE_FMT

BIDI_RESPONSE_FMT(Dh) sets the format of the printer-to-host messages. The spooler queries the protocol converter with BIDI_Q_RESPONSE_FMT(8018h). The spooler then passes this information to the port driver, using BIDI_RESPONSE_FMT. This allows the port driver to determine printer response message boundaries.

BIDI_SEND_PASSTHRU

BIDI_SEND_PASSTHRU(1h) is a protocol-specific command that can be issued to the printer. This command does not return any response data to the caller. BIDI_SEND_PASSTHRU(1h) can be sent at any time, not just during a passthru session. See #BIDI_START_PASSTHRU(1Ah) for more details.

BIDI_SET_DEVICE_ID

BIDI_SET_DEVICE_ID(23h) sets the printer's device ID. The protocol converter calls PrtSet with this command structure to notify the spooler of the device ID of an attached printer.

BIDI_SET_DEVICE_ID(23h) is used when the port driver is unable to determine the device ID during BIDI_Q_PORT(800Bh), and allows the protocol converter to retrieve the device ID.

BIDI_STARTJOB

BIDI_STARTJOB(2h) is called by the port driver during SplPdOpen to signal the protocol converter that the print job is starting. The port driver should use the pPrtOpenStruct parameter in SplPdOpen to derive the parameters for this command.

Note: The caller of PrtSet can set the following parameters in the PRTSTARTJOB data structure:

  • ulSpoolerJobID - set to -1
  • ulInterpreterID - set to -1

This will let the spooler fill in the values based on the current job being sent to this printer port.

BIDI_SHUTDOWN

BIDI_SHUTDOWN(Ah) releases all threads waiting for this protocol converter and port driver. This command is used to shut down the protocol converter and port driver when disabling the spooler. The command is sent first to the protocol converter to shut down the port; then the port driver is called.

BIDI_SET_SW

BIDI_SET_SW(10h) tells the port driver the BIDI software capabilities of the printer. The spooler passes the BIDI_Q_SW(800Ch) command structure, returned by the protocol converter, to the port driver using BIDI_SET_SW(10h).

BIDI_TERM

BIDI_TERM(Ch) sets the printer to unidirectional mode. This tells the port driver and kernel device driver the port is set to unidirectional mode.

BIDI_SET_PORTDRV

BIDI_SET_PORTDRV(19h) stores port driver configuration data. A port driver on a client implements SplPdRemoteSetPort by calling PrtQuery(BIDI_Q_PORTDRV(8019h)). This call gets the port driver configuration from the server. Next, the port driver displays the port configuration and, if the user changes anything, updates the server's port driver settings using PrtSet(BIDI_SET_PORTDRV).

BIDI_START_PASSTHRU

BIDI_START_PASSTHRU(1Ah) starts a passthru reading session. An application or printer driver that needs to issue a passthru query to the printer, and get its response, must establish a temporary passthru session.

There can be only one passthru session active for a printer port. A passthru session is necessary in order to use the BIDI_READ_PASSTHRU(8001h) command structure. The passthru session receives all data returned by the printer via BIDI_READ_PASSTHRU(8001h). After the application has received its answer(s), it must use BIDI_END_PASSTHRU(1Bh) to allow other applications or printer drivers to get a passthru session.

Giving a remote control panel display to the user is an example of using a passthru session. The printer driver uses BIDI_START_PASSTHRU, then sends any printer-specific commands using BIDI_SEND_PASSTHRU(1h). Next, the printer driver waits for the printer responses using BIDI_READ_PASSTHRU(8001h) and, finally, after the query is satisfied, the printer driver must use BIDI_END_PASSTHRU(1Bh).

Passthru sessions must be responsive. The protocol converter will store only the last five (5) printer messages if a passthru session is active. If a passthru session is not active for more than three (3) minutes, the session can be terminated.

BIDI_WAIT_ALERT

BIDI_WAIT_ALERT(8016h) waits for an alert. The port driver must be able to store the PRTPORT.ulMaxHeldResponses number of responses, to give the spooler time to ask for each printer-generated message. If an alert does not change the currently known state of the printer, the spooler may disregard the alert.

The spooler has a single thread dedicated to calling each port driver with BIDI_WAIT_ALERT. No other application can use the BIDI_WAIT_ALERT command.

If a protocol converter is used, the port driver will process the request by calling SplProtXlateCmd with all data returned by the printer. If the protocol converter indicates by its return that the data was an alert, the port driver returns this information to the caller of SplPdQuery (the spooler).

When an alert condition is cleared, an alert should be returned, with the current status of the printer (that is, PRTALERT_TYPE_ONLINE or PRTALERT_TYPE_OFFLINE), to the caller of BIDI_WAIT_ALERT.