情報
要求されたトピックは次のとおりです。しかし、このトピックはこのライブラリには含まれていません。

WdfIoTargetCloseForQueryRemove メソッド

The WdfIoTargetCloseForQueryRemove method temporarily closes a specified remote I/O target because the target device might soon be removed.

構文

VOID WdfIoTargetCloseForQueryRemove(
  [in]  WDFIOTARGET IoTarget
);

パラメーター

IoTarget [in]

A handle to a remote I/O target object that was obtained from a previous call to WdfIoTargetCreate.

戻り値

None.

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

解説

Drivers that supply an EvtIoTargetQueryRemove callback function must call WdfIoTargetCloseForQueryRemove from within that callback function, if the driver determines that the target device can be safely removed.

For more information about WdfIoTargetCloseForQueryRemove, see Controlling a General I/O Target's State.

For more information about I/O targets, see Using I/O Targets.

The following code example is the EvtIoTargetQueryRemove callback function from the Toaster sample driver. The function stops a timer, ensures that a previously submitted work item has been serviced, and then calls WdfIoTargetCloseForQueryRemove.

NTSTATUS
ToastMon_EvtIoTargetQueryRemove(
    WDFIOTARGET IoTarget
)
{
    PTARGET_DEVICE_INFO  targetDeviceInfo = NULL;

    //
    // Get I/O target object's context space.
    //
    targetDeviceInfo = GetTargetDeviceInfo(IoTarget);

    //
    // Stop the timer and wait for any outstanding work items
    // to finish before closing the target.
    //
    WdfTimerStop(targetDeviceInfo->TimerForPostingRequests, TRUE);
    WdfWorkItemFlush(targetDeviceInfo->WorkItemForPostingRequests);

    WdfIoTargetCloseForQueryRemove(IoTarget);

    return STATUS_SUCCESS;
}

要件

バージョン

Available in version 1.0 and later versions of KMDF.

ヘッダー

Wdfiotarget.h (includeWdf.h)

ライブラリ

Wdf<MajorVersionNumber>000.sys (see Framework Library Versions.)

IRQL

PASSIVE_LEVEL

参照

EvtIoTargetQueryRemove
WdfIoTargetCreate

 

 

コミュニティの追加

表示:
© 2014 Microsoft