Type
of set and options.
Values are as follows:
TYPE_SHORT_WAIT(1)
Sends this 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 sent using this type of channel (for instance, if a PJL command is required
in order to set this information), ERROR_INFO_NOT_AVAIL is returned.
TYPE_LONG_WAIT(2)
Sends 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_WITHOUT_WRAPPER(4)
The information being sent does not have any packet
wrapper around it.
This is useful for BIDI_SEND_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 sending
a Postscript query to the printer and the NPAP protocol converter adds the
necessary NPAP wrapper before transmitting the data to the printer.
If BIDI_SEND_PASSTHRU is used without this value, the calling application
must have already wrapped the passthru data.
Note: If this value is used with any command other than BIDI_SEND_PASSTHRU,
ERROR_INVALID_PARAMETER is returned.
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_SEND_PASSTHRU(1h)
BIDI_STARTJOB(2h)
BIDI_ENDJOB(3h)
BIDI_HOLDJOB(4h)
BIDI_RELEASEJOB(5h)
BIDI_CANCELJOB(6h)
BIDI_INIT_PORTDRV(8h)
BIDI_RESET(9h)
BIDI_SHUTDOWN(Ah)
Releases
all threads waiting for this port. See BIDI_SHUTDOWN(Ah)
for input parameters.
BIDI_INIT(Bh)
Sets
printer in bidirectional mode. See BIDI_INIT(Bh)
for input parameters.
BIDI_TERM(Ch)
Sets
printer in unidirectional mode. See BIDI_TERM(Ch)
for input parameters.
BIDI_RESPONSE_FMT(Dh)
BIDI_PACKET_SIZE(Eh)
BIDI_INIT_PROTCNV(Fh)
BIDI_SET_SW(10h)
Tells
port driver the BIDI software capabilities of the printer. See BIDI_SET_SW(10h)
for input parameters.
BIDI_SET_PORTDRV(19h)
BIDI_START_PASSTHRU(1Ah
)
BIDI
_ END _ PASSTHRU ( 1Bh )
BIDI _ NOTIFY _ ENDJOBCONNECT
( 20h )
BIDI
_ NOTIFY _ PORT _ SELECTED ( 21h )
BIDI _ NOTIFY _ PORT
_ RELEASED ( 22h )
BIDI _ SET _ DEVICE
_ ID ( 23h )
BIDI _ ENABLE _ ALERT
( 24h )
BIDI
_ DISABLE _ ALERT ( 25h )
BIDI _ ADD _ VIRTUAL
_ PORT ( 26h )
BIDI
_ DEL _ VIRTUAL _ PORT ( 27h )
BIDI _ DEL _ PORT
( 28h )
0x00009000-0x00009FFF
Protocol
- converter - specificcommands .
0x0000B000-0x0000BFFF
Port
- driver - specificcommands .
pInData (PVOID) - input
Contains
either a command sequence to pass to, or information required by, the printer.
If ulCommand is set to BIDI_SEND_PASSTHRU, pInData contains
the command sequence to pass to the printer. The field will not be altered
by the port driver or protocol converter unless ulType is set to
TYPE_WITHOUT_WRAPPER.
If ulCommand is not set to BIDI_SEND_PASSTHRU, pInData
may contain information required by the command (see BIDI
Command Structures and Command Flow for more information).
cbInData (ULONG) - input
Length
of pInData, in bytes.
rc (ULONG) - returns
Return
codes.
- Success
- ERROR_INVALID_FUNCTION
The command code
is not supported. This 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)
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 a 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 set 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.
117(ERROR_INVALID_CATEGORY)
The protocol converter does not handle the category
given with command BIDI_ENABLE_ALERT.
186(ERROR_INVALID_FLAG_NUMBER)
The protocol converter does not understand one
of the core alert types set with command BIDI_ENABLE_ALERT.
211(ERROR_INFO_NOT_AVAIL)
The request cannot be sent with the given ulType
value. The request should be reissued with a different ulType value.
640(ERROR_TIMEOUT)
The
set command was not able to be sent to the printer within the time allotted.
683(ERROR_BIDI_NO_SUPPORT)
The
printer is not in bidirectional mode, therefore query requests are not honored.
The port may also be in the process of being shut down.
0x1403(PMERR_ALREADY_INITIALIZED)
The port driver has already been initialized for
the port.
0x4005(PMERR_SPL_INV_HSPL)
Not currently in a passthru session.
0x4009(PMERR_SPL_SPOOLER_NOT_INSTALLED)
The spooler is not enabled, therefore bidirectional
set requests are not supported.
0x4011(PMERR_SPL_INV_JOB_ID)
The job ID specified is not known.
0x403D(PMERR_SPL_CNV_NOT_INIT)
The protocol converter or port driver has not been
initialized for this port.
0x403E(PMERR_SPL_INIT_IN_PROGRESS)
Another thread is still processing BIDI_INIT_PORTDRV
or the initial BIDI_Q_PORT for the given portname. The request should be
tried again later.
Others
If
pszComputerName is specified, other network errors may be returned.
Note: Currently, you cannot send more than
64KB of data from a spooler call over the network. Therefore, all data used
in this API should be limited to less than 64KB for now.
[Back: PrtSet Return Value - rc]
[Next: PrtSet - Remarks]