IQueueCallbackRead::OnRead method (wudfddi.h)

[Warning: UMDF 2 is the latest version of UMDF and supersedes UMDF 1. All new UMDF drivers should be written using UMDF 2. No new features are being added to UMDF 1 and there is limited support for UMDF 1 on newer versions of Windows 10. Universal Windows drivers must use UMDF 2. For more info, see Getting Started with UMDF.]

The OnRead method is called to handle a read request when an application reads information from a device through the Microsoft Win32 ReadFile or ReadFileEx function.

Syntax

void OnRead(
  [in] IWDFIoQueue   *pWdfQueue,
  [in] IWDFIoRequest *pWdfRequest,
  [in] SIZE_T        NumOfBytesToRead
);

Parameters

[in] pWdfQueue

A pointer to the IWDFIoQueue interface for the I/O queue object that the request arrives from.

[in] pWdfRequest

A pointer to the IWDFIoRequest interface that represents the framework request object.

[in] NumOfBytesToRead

The size, in bytes, of the read buffer for the request.

Return value

None

Remarks

A driver registers the IQueueCallbackRead interface when the driver calls the IWDFDevice::CreateIoQueue method to create an I/O queue or to configure the default I/O queue.

A driver can implement a single OnRead method for all I/O queues or separate OnRead methods for each I/O queue.

The OnRead method receives every read request type from the queue. (The read request type is identified by the WdfRequestRead value of the WDF_REQUEST_TYPE enumeration type for the request.) The OnRead method must process each received read request. For more information about how UMDF drivers process I/O requests, see Processing I/O Requests.

The driver can call the IWDFIoRequest::GetReadParameters and IWDFIoRequest::GetOutputMemory methods to retrieve information about the request and the read buffer.

Requirements

Requirement Value
Target Platform Windows
Header wudfddi.h (include Wudfddi.h)

See also

IQueueCallbackRead

IWDFDevice::CreateIoQueue

IWDFIoQueue

IWDFIoRequest

WDF_REQUEST_TYPE