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

既定のコントロール エンドポイントを作成するためのクライアント ドライバーの実装。

構文

EVT_UFX_DEVICE_DEFAULT_ENDPOINT_ADD EvtUfxDeviceDefaultEndpointAdd;

void EvtUfxDeviceDefaultEndpointAdd(
  [in]      UFXDEVICE unnamedParam1,
  [in]      USHORT unnamedParam2,
  [in, out] PUFXENDPOINT_INIT unnamedParam3
)
{...}

パラメーター

[in] unnamedParam1

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

[in] unnamedParam2

このエンドポイントとの間で送信できる既定の最大パケット サイズ。

[in, out] unnamedParam3

エンドポイント オブジェクトの作成に必要なエンドポイント記述子を含む、UFXENDPOINT_INIT不透明な構造体へのポインター。

戻り値

なし

解説

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

エンドポイントを作成するには、クライアント ドライバーがエンドポイントの転送キューとコマンド キューの属性を初期化し、 UfxEndpointCreate を呼び出してエンドポイントを作成することが想定されています。 既定の制御エンドポイントが作成されると、UFX はセットアップ パケットやその他の制御転送パケットをホストから処理する準備が整います。

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


EVT_UFX_DEVICE_DEFAULT_ENDPOINT_ADD UfxDevice_EvtDeviceDefaultEndpointAdd;

VOID
UfxDevice_EvtDeviceDefaultEndpointAdd (
    _In_ UFXDEVICE UfxDevice,
    _In_ USHORT MaxPacketSize,
    _Inout_ PUFXENDPOINT_INIT EndpointInit
    )
/*++

Routine Description:

    EvtDeviceDefaultEndpointAdd handler for the UFXDEVICE object.
    Creates UFXENDPOINT object corresponding to the default endpoint of the
    device.

Arguments:

    UfxDevice - UFXDEVICE object representing the device.

    MaxPacketSize - Max packet size of the device's default endpoint.

    EndpointInit - Pointer to the Opaque UFXENDPOINT_INIT object

--*/
{
    NTSTATUS Status;
    USB_ENDPOINT_DESCRIPTOR Descriptor;

    PAGED_CODE();

    TraceEntry();

    Descriptor.bDescriptorType = USB_ENDPOINT_DESCRIPTOR_TYPE;
    Descriptor.bEndpointAddress = 0;
    Descriptor.bInterval = 0;
    Descriptor.bLength = sizeof(USB_ENDPOINT_DESCRIPTOR);
    Descriptor.bmAttributes = USB_ENDPOINT_TYPE_CONTROL;
    Descriptor.wMaxPacketSize = MaxPacketSize;

    // #### TODO: Insert code to add the endpoint. 
    // See code example for EVT_UFX_DEVICE_ENDPOINT_ADD ####

End:
    UfxDeviceEventComplete(UfxDevice, Status);
    TraceExit();
}

要件

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

こちらもご覧ください

UfxDeviceCreate

UfxDeviceEventComplete