Bewerken

Delen via


WdfIoQueueRetrieveRequestByFileObject function (wdfio.h)

[Applies to KMDF and UMDF]

The WdfIoQueueRetrieveRequestByFileObject method retrieves the next available I/O request, from a specified I/O queue, that is associated with a specified file object.

Syntax

NTSTATUS WdfIoQueueRetrieveRequestByFileObject(
  [in]  WDFQUEUE      Queue,
  [in]  WDFFILEOBJECT FileObject,
  [out] WDFREQUEST    *OutRequest
);

Parameters

[in] Queue

A handle to a framework queue object.

[in] FileObject

A handle to a framework file object.

[out] OutRequest

A pointer to a location that receives a handle to a framework request object. If WdfIoQueueRetrieveRequestByFileObject does not return STATUS_SUCCESS, it does not set the location's value.

Return value

WdfIoQueueRetrieveRequestByFileObject returns STATUS_SUCCESS if the operation succeeds. Otherwise, this method might return one of the following values:

Return code Description
STATUS_INVALID_PARAMETER
The driver supplied an invalid handle.
STATUS_NO_MORE_ENTRIES
The framework reached the end of the I/O queue.
STATUS_INVALID_DEVICE_STATE
The specified I/O queue is configured for the parallel dispatching method.
STATUS_WDF_PAUSED
The specified I/O queue is power-managed and its device is in a low-power state.
 

This method also might return other NTSTATUS values.

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

Remarks

A driver that has configured an I/O queue for manual or sequential dispatching might call WdfIoQueueRetrieveRequestByFileObject. For more information about using WdfIoQueueRetrieveRequestByFileObject with the manual or sequential dispatching methods, see Dispatching Methods for I/O Requests.

After calling WdfIoQueueRetrieveRequestByFileObject to obtain an I/O request, the driver owns the request and must process the I/O request in some manner.

For more information about the WdfIoQueueRetrieveRequestByFileObject method, see Managing I/O Queues.

Examples

The following code example obtains, from a specified I/O queue, a handle to the next framework request object that is associated with a specified framework file object.

WDFREQUEST  request;

status = WdfIoQueueRetrieveRequestByFileObject(
                                               queue,
                                               fileObject,
                                               &request
                                               );

Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfio.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <= DISPATCH_LEVEL
DDI compliance rules DoubleCompletion(kmdf), DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf)

See also

WdfIoQueueRetrieveFoundRequest

WdfIoQueueRetrieveNextRequest