EVT_UFX_DEVICE_PORT_CHANGE コールバック関数 (ufxclient.h)

USB デバイスが接続されている新しいポートの種類を更新するクライアント ドライバーの実装。

構文

EVT_UFX_DEVICE_PORT_CHANGE EvtUfxDevicePortChange;

void EvtUfxDevicePortChange(
  [in] UFXDEVICE unnamedParam1,
  [in] USBFN_PORT_TYPE unnamedParam2
)
{...}

パラメーター

[in] unnamedParam1

クライアント ドライバーが UfxDeviceCreate の以前の呼び出しで受信した USB デバイス オブジェクトへのハンドル。

[in] unnamedParam2

新しいポートの種類を示すUSBFN_PORT_STATE型指定のフラグ。

戻り値

なし

解説

関数ホスト コントローラーのクライアント ドライバーは、UfxDeviceCreate メソッドを呼び出して、そのEVT_UFX_DEVICE_PORT_CHANGE実装を USB 関数クラス拡張機能 (UFX) に登録します。

UFX は、このイベント コールバックを呼び出して、デバイスの新しい状態についてクライアント ドライバーに通知します。

クライアント ドライバーは、 UfxDeviceEventComplete メソッドを呼び出すことによって、このイベントの完了を示します。


EVT_UFX_DEVICE_PORT_CHANGE UfxDevice_EvtDevicePortChange;

VOID
UfxDevice_EvtDevicePortChange (
    _In_        UFXDEVICE UfxDevice,
    _In_        USBFN_PORT_TYPE NewPort
    )
/*++

Routine Description:

    EvtDevicePortChange handler for the UFXDEVICE object.
    Caches the new port type, and stops or resumes idle as needed.

Arguments:

    UfxDevice - UFXDEVICE object representing the device.

    NewPort - New port type

--*/
{
    NTSTATUS Status;
    PUFXDEVICE_CONTEXT Context;

    PAGED_CODE();

    TraceEntry();

    Context = UfxDeviceGetContext(UfxDevice);

    TraceInformation("New PORT: %d", NewPort);

    //
    //  #### TODO: Insert code to examine the device USB state and port type 
    //      and determine if it needs to stop or resume idle.


    UfxDeviceEventComplete(UfxDevice, STATUS_SUCCESS);
    TraceExit();
}

要件

要件
対象プラットフォーム Windows
最小 KMDF バージョン 1.0
最小 UMDF バージョン 2.0
Header ufxclient.h
IRQL PASSIVE_LEVEL

こちらもご覧ください

UfxDeviceCreate

UfxDeviceEventComplete