Indicates
type of query and options.
Values are as follows:
TYPE_CACHE_ONLY(0)
Returns information from the
protocol converter or port driver's cache only. Does not send anything to
the printer.
If the requested information is not available, ERROR_INFO_NOT_AVAIL is returned.
The caller should reissue the command with a different ulType value.
TYPE_SHORT_WAIT(1)
Returns
information via a communications channel with the printer that can be used
while a job is being sent to the printer.
An example would be using NPAP or SNMP. If the requested information cannot
be returned using this type of channel (for instance, if a PJL command is
required in order to get this information), ERROR_INFO_NOT_AVAIL is returned.
TYPE_LONG_WAIT(2)
Returns
information using any necessary communications channel with the printer,
even if the request has to wait for the current job being sent to the printer
to complete.
If the printer supports only one command channel, and this channel can be
used while a job is being sent to the printer, TYPE_SHORT_WAIT(1) and TYPE_LONG_WAIT(2)
will behave in the same way.
TYPE_CACHE_UPDATE(3)
Returns information from the protocol converter
or port driver's cache and also updates the cache in the background.
This is an optional type of query to support and, if it is not supported,
will return ERROR_INVALID_FUNCTION.
If the requested information is not available in the cache, ERROR_INFO_NOT_AVAIL
is returned. The caller should reissue the command with a different ulType
value.
TYPE_WITHOUT_WRAPPER(4)
Returns
passthru information without any packet wrapper around it.
This is useful for BIDI_READ_PASSTHRU as it allows an application to send
and receive printer-interpreter language commands without having to know
the format of the BIDI protocol's data wrappers. An example would be removing
the NPAP wrapper before returning PostScript response data to an application.
If BIDI_READ_PASSTHRU is used without this value, the calling application
requests the data as the printer returns it, possibly with any data wrappers.
Note: If this value is used with any command other than BIDI_READ_PASSTHRU,
ERROR_INVALID_PARAMETER is returned.
TYPE_CACHE_WAIT(5)
Returns information from the protocol converter
or port driver's cache only. If the data is not available in the cache,
use any mechanism available to get the information.
If TYPE_CACHE_WAIT(5) is not supported by the port driver or protocol converter,
ERROR_INVALID_FUNCTION is returned.
The value of TYPE_CACHE_WAIT(5) may be used by the print object to issue
BIDI_Q_STATUS, in order to get the current status of the printer without
waiting to communicate with the printer.
ulCommand (ULONG) - input
Generic
command code.
See BIDI Command Structures
and Command Flow for contents of pInData and pOutData for
each of the following commands.
Current commands are as follows:
BIDI_READ_PASSTHRU(8001h)
BIDI_Q_PORT(800Bh)
Query BIDI capabilities of the port. See BIDI_Q_PORT(800Bh)
for input and output parameters.
BIDI_Q_SW(800Ch)
Query BIDI software capabilities. See BIDI_Q_SW(800Ch)
for input and output parameters.
BIDI_Q_DEVICE(800Dh)
BIDI_Q_INTERPRETER(800Eh)
BIDI_Q_INPUTBINS(800Fh)
BIDI_Q_OUTPUTBINS(8010h)
BIDI_Q_FONTS(8012h)
Query fonts for a particular interpreter. See BIDI_Q_FONTS(8012h)
for input and output parameters.
BIDI_Q_JOBS
_ COMPLETE ( 8013h )
BIDI
_ Q _ JOBS _ QUEUED ( 8014h )
BIDI _
Q _ STATUS ( 8015h )
BIDI _ WAIT _
ALERT ( 8016h )
BIDI
_ Q _ JOBID ( 8017h )
BIDI _ Q _ RESPONSE _ FMT ( 8018h )
BIDI
_ Q _ PORTDRV ( 8019h )
BIDI_READ_ALERT(801Dh)
BIDI_Q_CONVERTER_INFO(8021h)
BIDI_Q_SPOOLER_VERSION(8022h)
BIDI_Q_STORAGE(8023h)
0x00009000
- 0x00009FFF
Protocol-converter-specific commands.
0x0000B000 - 0x0000BFFF
Port-driver-specific
commands.
pInData (PVOID) - input
cbInData (ULONG) - input
Length
of information in pInData, in bytes.
pOutData (PVOID) - output
Return
buffer.
Format of buffer depends on ulCommand. For BIDI_READ_PASSTHRU, this
will contain BIDI protocol-specific response data and will not be interpreted
by the BIDI protocol converter. However, if ulType is TYPE_WITHOUT_WRAPPER,
any protocol data wrapper is removed before returning the printer-specific
information.
For other commands, it will return a structure containing queried information
for the command as defined in BIDI
Command Structures and Command Flow.
pcbOutData (PULONG) - in/out
Points
to the length of the output buffer.
On entry, this is set to the length of the buffer passed in. On exit, it
is updated with the length of data available.
If ERROR_MORE_DATA(234) or NERR_BufTooSmall(2123) is set, this field has
the buffer size required to get all available information on exit.
rc (ULONG) - returns
Return
codes.
- Success
- ERROR_INVALID_FUNCTION)
The command code
is not supported. This lack of support may occur if a new command is sent
to an old spooler, port driver, or protocol converter, or if the printer
rejects the command.
2(ERROR_FILE_NOT_FOUND)
The
pszDeviceName given is not a valid port name with a port driver,
a printer device name, or a printer queue name.
5(ERROR_ACCESS_DENIED)
Not authorized to access printer port.
8(ERROR_NOT_ENOUGH_MEMORY)
Not enough memory to satisfy request.
29(ERROR_WRITE_FAULT)
Failure attempting to write to the device. The
printer might not have received the query request.
53(ERROR_BAD_NETPATH)
The computer name specified is not available or
is invalid.
67(ERROR_BAD_NET_NAME)
The
computer name cannot be found.
87(ERROR_INVALID_PARAMETER)
An invalid parameter was specified; most likely
an invalid buffer pointer was given.
211(ERROR_INFO_NOT_AVAIL
)
Therequestedinformationisnotavailableintheprotocolconvertercache
,ortherequestcannotbesentwiththegivenulTypevalue .TherequestshouldbereissuedwithadifferentulTypevalue
.
234 ( ERROR _ MORE _ DATA )
Partoftheinformationrequestedwasreturned
,buttherewasnotenoughroomforallthedata .* pcbOutDatacontainsthesizeofbufferneededtoretrieveallthequeryresponsedata
.
640 ( ERROR _ TIMEOUT )
Theprinterresponsewasnotreceivedwithinthetimeallotted
.Thecallermayreissuethequery ,atwhichtimetheinformationmightbeavailable
.
683 ( ERROR _ BIDI _ NO _ SUPPORT )
Theprinterisnotinbidirectionalmode
,thereforequeryrequestsarenotsupported .Theportalsomaybeintheprocessofbeingshutdown
.
2123 ( NERR _ BufTooSmall )
Noinformationwasreturnedbecausetheoutputbufferwastoosmall
.* pcbOutDatacontainsthesizeofbufferneededtoretrieveallthequeryresponsedata
.
0x4005 ( PMERR _ SPL _ INV _ HSPL )
Notcurrentlyinapassthrusession
.
0x4009 ( PMERR _ SPL _ SPOOLER _ NOT _ INSTALLED
)
Thespoolerisnotenabled ,thereforebidirectionalqueryrequestsarenotsupported
.
0x4011 ( PMERR _ SPL _ INV _ JOB _ ID )
Nojobisbeingactivelysenttotheprinterport
,thereforeBIDI _ Q _ JOBIDisnotsuccessful .
0x403D
( PMERR _ SPL _ CNV _ NOT _ INIT )
Theprotocolconverterorportdriverhasnotbeeninitializedforthisport
.
0x403E ( PMERR _ SPL _ INIT _ IN _ PROGRESS )
AnotherthreadisstillprocessingBIDI
_ INIT _ PORTDRVortheinitialBIDI _ Q _ PORTforthegivenportname .Therequestshouldbetriedagainlater
.
0x403F ( PMERR _ SPL _ TYPE _ NOT _ AVAIL )
ThestoragetyperequestedforBIDI
_ Q _ FONTSorBIDI _ Q _ STORAGEisnotavailableintheprinter .
0x4041
( PMERR _ SPL _ SESSION _ TERM )
Thepassthrusessionhasbeenterminated
.
Others
IfpszComputerNameisspecified
,othernetworkerrorsmaybereturned .
Note : Currentlyyoucannotreceivemorethan64KBofdatafromaspoolercalloverthenetwork
.Therefore ,allreturnedstructuresshouldbelimitedtolessthan64KBfornow .
[Back: PrtQuery Return Value - rc]
[Next: PrtQuery - Remarks]