All structures used by PrtQuery and PrtSet use offsets into the return buffer for variable-length data, instead of returning pointers. These offsets are used to make transmission of the bidirectional structures easier between processes and machines.
For example, in a structure that returns a description string, the field that references the storage location of this string is a ULONG. If zero, that string is not returned. If nonzero, the field is the offset, from the beginning of the output buffer, to the description string.
All structures with variable-length data should pack this data immediately following all the fixed-length structures. As a result, *pcbOutData contains the number of bytes to copy from the beginning of the pOutData buffer.
Note: All returned structure-offset fields are offsets from the beginning of the output buffer given, not offsets from the beginning of the structure.
The Query and Set command structures are listed in the following two tables. The tables show which part of the system is called for each command structure. The values indicate the following:
The numbers in the "Init Sequence #/Description" column indicate, across both the Query and the Set tables, the order in which these command structures are called.
┌──────────────────────────┬────────┬──────────┬─────────────────┐│Query Command │Command │First Sent│Init Sequence # │ │ │Code │To: │and Description │ │ │ │PrCo/PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_CONVERTER_INFO │(8021h) │PrCo │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_Device │(800Dh) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_FONTS │(8012h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_INPUTBINS │(800Fh) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_INTERPRETER │(800Eh) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_JOBID │(8017h) │PrCo │During PrtOpen, │ │ │ │ │after │ │ │ │ │BIDI_STARTJOB │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_JOBS_COMPLETE │(8013h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_JOBS_QUEUED │(8014h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_OUTPUTBINS │(8010h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_PORT │(800Bh) │PDrv │2 - Determines │ │ │ │ │protocol │ │ │ │ │converter to use │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_PORTDRV │(8019h) │PDrv │Free-format │ │ │ │ │buffer │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_RESPONSE_FMT │(8018h) │PrCo │5 - Gets printer │ │ │ │ │msg format │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_SPOOLER_VERSION │(8022h) │ │Handled by │ │ │ │ │spooler │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_STATUS │(8015h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_STORAGE │(8023h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_Q_SW │(800Ch) │PrCo │7 │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_READ_ALERT │(801Dh) │PrCo │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_READ_PASSTHRU │(8001h) │PrCo │Copies │ │ │ │ │SplProtXlateCmd │ │ │ │ │data │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_WAIT_ALERT │(8016h) │PDrv │3 - One thread │ │ │ │ │per port driver │ └──────────────────────────┴────────┴──────────┴─────────────────┘
┌──────────────────────────┬────────┬──────────┬─────────────────┐ │Set Command │Command │First Sent│Init Sequence # │ │ │Code │To: │and Description │ │ │ │PrCo/PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_ADD_VIRTUAL_PORT │(26h) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_CANCELJOB │(6h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_DEL_PORT │(28h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_DEL_VIRTUAL_PORT │(27h) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_DISABLE_ALERT │(25h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_ENABLE_ALERT │(24h) │PrCo; PDrv│9 │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_END_PASSTHRU │(1Bh) │PrCo │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_ENDJOB │(3h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_HOLDJOB │(4h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_INIT │(Bh) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_INIT_PORTDRV │(8h) │PDrv │1 - Once per │ │ │ │ │PortDRV │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_INIT_PROTCNV │(Fh) │PrCo │4 - Given Q_PORT │ │ │ │ │for each port │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_NOTIFY_ENDJOBCONNECT │(20h) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_NOTIFY_PORT_RELEASED │(22h) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_NOTIFY_PORT_SELECTED │(21h) │PDrv │10 │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_PACKET_SIZE │(Eh) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_RELEASEJOB │(5h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_RESPONSE_FMT │(Dh) │PDrv │6 │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_RESET │(9h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_SEND_PASSTHRU │(1h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_SET_DEVICE_ID │(23h) │PDrv │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_SET_PORTDRV │(19h) │PDrv │Free-format │ │ │ │ │buffer │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_SET_SW │(10h) │PDrv │8 │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_SHUTDOWN │(Ah) │PrCo; PDrv│Sent to both │ │ │ │ │protocol │ │ │ │ │converter and │ │ │ │ │port driver │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_START_PASSTHRU │(1Ah) │PrCo │ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_STARTJOB │(2h) │PrCo; PDrv│ │ ├──────────────────────────┼────────┼──────────┼─────────────────┤ │BIDI_TERM │(Ch) │PrCo; PDrv│ │ └──────────────────────────┴────────┴──────────┴─────────────────┘