WdfDeviceConfigureRequestDispatching - NtDoc

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

NTSTATUS WdfDeviceConfigureRequestDispatching(
  [in] WDFDEVICE        Device,
  [in] WDFQUEUE         Queue,
  [in] WDF_REQUEST_TYPE RequestType
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfdevice-wdfdeviceconfigurerequestdispatching)

WdfDeviceConfigureRequestDispatching function

Description

[Applies to KMDF and UMDF]

The WdfDeviceConfigureRequestDispatching method causes the framework to queue a specified type of I/O requests to a specified I/O queue.

Parameters

Device [in]

Supplies a handle to a framework device object.

Queue [in]

Supplies a handle to a framework queue object.

RequestType [in]

Supplies a WDF_REQUEST_TYPE-typed enumerator that identifies the type of request to be queued. The only valid enumerators are:

WdfRequestTypeCreate

WdfRequestTypeRead

WdfRequestTypeWrite

WdfRequestTypeDeviceControl

WdfRequestTypeDeviceControlInternal

Return value

If the operation succeeds, the method returns STATUS_SUCCESS. Additional return values include:

Return code Description
STATUS_INVALID_PARAMETER An input parameter is invalid.
STATUS_INSUFFICIENT_RESOURCES The amount of available memory is too low.
STATUS_WDF_BUSY The driver has already assigned a queue to the specified request type.

The method might return other NTSTATUS values.

A bug check occurs if the driver supplies an invalid object handle.

Remarks

Each call to WdfDeviceConfigureRequestDispatching specifies one request type. If you want a single I/O queue to receive multiple types of requests (for example, read and write requests), your driver can call WdfDeviceConfigureRequestDispatching multiple times for a single I/O queue.

For more information about WdfDeviceConfigureRequestDispatching, see Creating I/O Queues and Managing I/O Queues.

Examples

The following code example initializes a WDF_IO_QUEUE_CONFIG structure, creates an I/O queue, and then configures the queue so that it receives write requests.

WDF_IO_QUEUE_CONFIG queueConfig;
WDFQUEUE WriteQueue;

WDF_IO_QUEUE_CONFIG_INIT(
                         &queueConfig,
                         WdfIoQueueDispatchSequential
                         );
queueConfig.EvtIoWrite = MyEvtIoWrite;
status = WdfIoQueueCreate(
                          Device,
                          &queueConfig,
                          WDF_NO_OBJECT_ATTRIBUTES,
                          &WriteQueue
                          );
if(!NT_SUCCESS(status)) {
    return status;
}
status = WdfDeviceConfigureRequestDispatching(
                                              Device,
                                              WriteQueue,
                                              WdfRequestTypeWrite
                                              );
if(!NT_SUCCESS(status)) {
    return status;
}

See also

WDF_IO_QUEUE_CONFIG_INIT

WdfIoQueueCreate