PPARALLEL_TRY_SELECT_ROUTINE callback function (parallel.h)
The PPARALLEL_TRY_SELECT_ROUTINE-typed callback routine selects an IEEE 1284.3 daisy chain device or an IEEE 1284 end-of-chain device that is attached to a parallel port. The system-supplied function driver for parallel ports supplies this routine.
Syntax
PPARALLEL_TRY_SELECT_ROUTINE PparallelTrySelectRoutine;
NTSTATUS PparallelTrySelectRoutine(
[in] PVOID TrySelectContext,
[in] PVOID TrySelectCommand
)
{...}
Parameters
[in] TrySelectContext
Pointer to the device extension of a parallel port's functional device object (FDO).
[in] TrySelectCommand
Pointer to a PARALLEL_1284_COMMAND structure. The caller specifies the following members:
ID
Specifies the 1284.3 device ID.
CommandFlags
Specifies a bitwise OR of zero or more of the following flags:
Value | Description |
---|---|
PAR_END_OF_CHAIN_DEVICE | Specifies an end-of-chain device. |
PAR_HAVE_PORT_KEEP_PORT | Specifies that the caller has the port allocated and to keep the port allocated. |
Return value
Return code | Description |
---|---|
|
The device was selected. |
|
The device ID is not valid. |
|
The caller did not specify PAR_HAVE_PORT_KEEP_PORT, and the parallel port is already allocated. |
|
The caller has allocated the parallel port, but the system-supplied function driver for parallel ports could not select the specified parallel device. |
Remarks
To obtain a pointer to the system-supplied PPARALLEL_TRY_SELECT_ROUTINE callback, a kernel-mode driver uses an IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO request, which returns a PARALLEL_PNP_INFORMATION structure. The TrySelectDevice member of the PARALLEL_PNP_INFORMATION structure is a pointer to this callback.
A kernel-mode driver can use an IOCTL_INTERNAL_SELECT_DEVICE request or the PPARALLEL_TRY_SELECT_ROUTINE callback to select a parallel device on a parallel port. The parallel port function driver queues a select request if the parallel port is already allocated. However, the PPARALLEL_TRY_SELECT_ROUTINE callback does not queue a select request, and the routine returns immediately if the port cannot be allocated.
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | parallel.h (include Parallel.h) |
IRQL | <=DISPATCH_LEVEL |
See also
IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO