UfxDeviceNotifyReset 関数 (ufxclient.h)

USB バス リセット イベントについて UFX に通知します。

構文

void UfxDeviceNotifyReset(
  [in] UFXDEVICE        UfxDevice,
  [in] USB_DEVICE_SPEED DeviceSpeed
);

パラメーター

[in] UfxDevice

ドライバーが UfxDeviceCreate を呼び出して作成した UFX デバイス オブジェクトへのハンドル。

[in] DeviceSpeed

デバイスの速度を示す USB_DEVICE_SPEED 型の値を格納します。

戻り値

なし

解説

クライアント ドライバーは、バス リセット イベントを受信したときに UfxDeviceNotifyReset を呼び出します。 既定以外のすべてのエンドポイントを無効にし、既定のエンドポイントをリセットする必要があります。 デバイスは既定の状態に移動します。

クライアント ドライバーは通常、その EvtInterruptDpc コールバック関数から UfxDeviceNotifyReset を呼び出します。 次の例は、リセット イベントを処理する方法を示しています。


VOID
HandleUsbConnect (
    WDFDEVICE WdfDevice
    )
/*++

Routine Description:

    Handles a connect event from the controller.

Arguments:

    WDfDevice - WDFDEVICE object representing the controller.

--*/
{
    PCONTROLLER_CONTEXT ControllerContext;
    USB_DEVICE_SPEED DeviceSpeed;

    TraceEntry();

    ControllerContext = DeviceGetControllerContext(WdfDevice);

    //
    // Read the device speed.
    //

    //
    // #### TODO: Add code to read device speed from the controller ####
    //
    
    // Sample will assume SuperSpeed operation for illustration purposes
    DeviceSpeed = UsbSuperSpeed;
    
    //
    // #### TODO: Add any code needed to configure the controller after connect has occurred ####
    //


    ControllerContext->Speed = DeviceSpeed;
    TraceInformation("Connected Speed is %d!", DeviceSpeed);

    //
    // Notify UFX about reset, which will take care of updating 
    // Max Packet Size for EP0 by calling descriptor update.
    //
    UfxDeviceNotifyReset(ControllerContext->UfxDevice, DeviceSpeed);

    ControllerContext->Connect = TRUE;

    TraceExit();
}

要件

要件
サポートされている最小のクライアント Windows 10
対象プラットフォーム Windows
ヘッダー ufxclient.h
Library ufxstub.lib
IRQL DISPATCH_LEVEL