Skip to content

Latest commit

 

History

History
199 lines (143 loc) · 5.89 KB

nc-parallel-pparallel_try_select_routine.md

File metadata and controls

199 lines (143 loc) · 5.89 KB
UID title description old-location tech.root ms.date keywords ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames f1_keywords topic_type api_type api_location api_name
NC:parallel.PPARALLEL_TRY_SELECT_ROUTINE
PPARALLEL_TRY_SELECT_ROUTINE (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.
parports\pparallel_try_select_routine.htm
parports
02/15/2018
PPARALLEL_TRY_SELECT_ROUTINE callback
(*PPARALLEL_TRY_SELECT_ROUTINE), (*PPARALLEL_TRY_SELECT_ROUTINE) callback function [Parallel Ports], cisspd_ec7d6b68-7fbd-493e-9787-3e2f78327bdd.xml, parallel/(*PPARALLEL_TRY_SELECT_ROUTINE), parports.pparallel_try_select_routine
parallel.h
Parallel.h
Desktop
<=DISPATCH_LEVEL
Windows
RILGBATOKEN, *LPRILGBATOKEN
PPARALLEL_TRY_SELECT_ROUTINE
parallel/PPARALLEL_TRY_SELECT_ROUTINE
APIRef
kbSyntax
UserDefined
parallel.h
PPARALLEL_TRY_SELECT_ROUTINE

PPARALLEL_TRY_SELECT_ROUTINE callback

-description

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.

-parameters

-param TrySelectContext [in]

Pointer to the device extension of a parallel port's functional device object (FDO).

-param TrySelectCommand [in]

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.

-returns

Return code Description
STATUS_SUCCESS
The device was selected.
STATUS_INVALID_PARAMETER
The device ID is not valid.
STATUS_PENDING
The caller did not specify PAR_HAVE_PORT_KEEP_PORT, and the parallel port is already allocated.
STATUS_UNSUCCESSFUL
The caller has allocated the parallel port, but the system-supplied function driver for parallel ports could not select the specified parallel device.

-prototype

typedef NTSTATUS (*PPARALLEL_TRY_SELECT_ROUTINE)(
  _In_ PVOID TrySelectContext,
  _In_ PVOID TrySelectCommand
);

-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.

Note   If a client uses only the PPARALLEL_TRY_SELECT_ROUTINE callback to attempt to select a parallel device, and other clients are contending for the parallel port, the system-supplied function driver for parallel ports might never allocate the port to the client. To ensure success, a client must use an IOCTL_INTERNAL_SELECT_DEVICE request. (The parallel port function driver queues, and subsequently processes, port allocate requests and device select requests in the order in which select device requests are received.)
 
For more information, see Selecting and Deselecting an IEEE 1284 Device Attached to a ParallelPort.

-see-also

PARALLEL_1284_COMMAND

IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO

IOCTL_INTERNAL_SELECT_DEVICE

IOCTL_INTERNAL_DESELECT_DEVICE

PARALLEL_PNP_INFORMATION

PPARALLEL_DESELECT_ROUTINE