IWDFIoRequest2::Requeue 方法 (wudfddi.h)
[警告: UMDF 2 是最新版本的 UMDF,取代了 UMDF 1。 所有新的 UMDF 驱动程序都应使用 UMDF 2 编写。 没有将新功能添加到 UMDF 1,并且对较新版本的 Windows 10 上的 UMDF 1 的支持有限。 通用 Windows 驱动程序必须使用 UMDF 2。 有关详细信息,请参阅 UMDF入门 。]
重新排队 方法将 I/O 请求返回到从中传递到驱动程序的 I/O 队列的头。
语法
HRESULT Requeue();
返回值
如果作成功,则 重新排队 返回S_OK。 否则,此方法可能会返回以下值之一:
返回代码 | 描述 |
---|---|
|
如果出现以下情况之一,则返回此值:
|
此方法可能会返回 Winerror.h 包含的其他值之一。
言论
仅当驱动程序对 I/O 队列使用 手动调度方法 时,才能调用 重新排队。
例子
下面的代码示例演示 IQueueCallbackStateChange::OnStateChange 回调函数的段。 该段从 I/O 获取 I/O 请求,然后将请求返回到队列。
void
CMyQueue::OnStateChange(
__in IWDFIoQueue* pWdfQueue,
__in WDF_IO_QUEUE_STATE
)
{
HRESULT hr;
IWDFIoRequest* Request;
...
//
// Get the IWDFIoRequest interface of the next request.
//
hr = pWdfQueue->RetrieveNextRequest(&Request);
...
//
// Declare an IWDFIoRequest2 interface pointer and obtain the
// IWDFIoRequest2 interface from the IWDFIoRequest interface.
//
CComQIPtr<IWDFIoRequest2> r2 = Request;
//
// Add code here to determine whether to process or requeue the request.
//
...
//
// Requeue the request.
//
hr = r2->Requeue();
if (FAILED(hr)) goto Error;
...
}
要求
要求 | 价值 |
---|---|
终止支持 | 在 UMDF 2.0 及更高版本中不可用。 |
目标平台 | 桌面 |
最低 UMDF 版本 | 1.9 |
标头 | wudfddi.h (包括 Wudfddi.h) |
DLL | WUDFx.dll |