PPARALLEL_TRY_ALLOCATE_ROUTINE - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// parallel.h

PPARALLEL_TRY_ALLOCATE_ROUTINE PparallelTryAllocateRoutine;

BOOLEAN PparallelTryAllocateRoutine(
  [in] PVOID TryAllocateContext
)
{...}
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nc-parallel-pparallel_try_allocate_routine)

PPARALLEL_TRY_ALLOCATE_ROUTINE callback

Description

The PPARALLEL_TRY_ALLOCATE_ROUTINE-typed (ISR) callback routine attempts to allocate a parallel port at IRQL = DIRQL. The system-supplied function driver for parallel ports supplies this routine.

Parameters

TryAllocateContext [in]

Pointer to the device extension of a functional device object that represents a parallel port.

Return value

Return code Description
TRUE The parallel port was allocated.
FALSE The parallel port was not allocated.

Prototype

typedef BOOLEAN ParallelTryAllocateRoutine(
  _In_ PVOID TryAllocateContext
);

Remarks

A kernel-mode driver connects an interrupt service routine by using an IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT, which returns a PARALLEL_INTERRUPT_INFORMATION structure. This structure includes the TryAllocatePortAtInterruptLevel member, which is a pointer to the system-supplied PPARALLEL_TRY_ALLOCATE_ROUTINE (ISR) callback.

The PPARALLEL_TRY_ALLOCATE_ROUTINE (ISR) callback is nonblocking, does not queue an allocate request, and returns immediately.

A driver uses the PPARALLEL_TRY_ALLOCATE_ROUTINE (ISR) callback in conjunction with a driver-supplied ISR. If the driver does not have a parallel port allocated when the driver's ISR is called, the driver can use this callback.

For more information about allocating a parallel port in an ISR, see Connecting an Interrupt Service Routine to a ParallelPort.

Note The PPARALLEL_TRY_ALLOCATE_ROUTINE (ISR) callback is untested. Microsoft does not recommend using a client-supplied interrupt routine. The use of interrupts might cause system instability. By default, the IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT request is disabled.

See also

IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT

IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO

IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE

IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT

IOCTL_INTERNAL_PARALLEL_PORT_FREE

PPARALLEL_FREE_ROUTINE (ISR)

PARALLEL_INTERRUPT_INFORMATION