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 |
ターゲット プラットフォーム の | ウィンドウズ |
ヘッダー | ufxclient.h |
ライブラリ | ufxstub.lib |
IRQL | DISPATCH_LEVEL |