Expand Minimize

WdfDeviceConfigureRequestDispatching method

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

Syntax


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

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 codeDescription
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;
}

Requirements

Minimum KMDF version

1.0

Minimum UMDF version

2.0

Header

Wdfdevice.h (include Wdf.h)

Library

Wdf01000.sys (KMDF);
WUDFx02000.dll (UMDF)

IRQL

<= DISPATCH_LEVEL

DDI compliance rules

DriverCreate, KmdfIrql, KmdfIrql2

See also

WDF_IO_QUEUE_CONFIG_INIT
WdfIoQueueCreate

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft