TdiBuildSetEventHandler

VOID
TdiBuildSetEventHandler (
IN PIRP Irp,
IN PDEVICE_OBJECT DeviceObject,
IN PFILE_OBJECT FileObject,
IN PVOID CompletionRoutine,
IN PVOID Context,
IN INT EventType,
IN PVOID EventHandler,
IN PVOID EventContext
);

TdiBuildSetEventHandler builds an IRP containing a TDI_SET_EVENT_HANDLER request message. It sets up the request message in the minor function code member of the I/O stack location and sets IRP_MJ_INTERNAL_DEVICE_CONTROL as a major function code.

Parameters

Irp

Points to the I/O stack location for the kernel-mode client IRP. The current stack location must point to the location in which TdiBuildSetEventHandler places the parameter list. IRP members related to the set event handler request are:

IRP Component Meaning
IoStatus.Status Specifies the final status of the set event handler request.
IrpSp->MajorFunction Specifies IRP_MJ_INTERNAL_DEVICE_CONTROL.
IrpSp->MinorFunction Specifies TDI_SET_EVENT_HANDLER.
IrpSp->FileObject Points to an address file object.
IrpSp->Parameters Points to a TDI_REQUEST_KERNEL_SET_EVENT structure.

DeviceObject

Points to the device object that describes the TDI driver.

FileObject

Points to an address file object.

CompletionRoutine

Points to the client completion function the I/O subsystem can call when I/O is complete. This parameter must be NULL if the I/O subsystem calls no completion function.

Context

Points to the context the client associates with its completion function.

EventType

Indicates the event handler type the client registers. For a list of the types, see TDI_SET_EVENT_HANDLER.

EventHandler

Points to the event handler function the client is registering.

EventContext

Points to the context the TDI driver will pass in a call to the client event handler.

See Also

TDI_SET_EVENT_HANDLER, TDI_REQUEST_KERNEL_SET_EVENT