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 구현을 UFX(USB 함수 클래스 확장)에 등록합니다.

엔드포인트를 만들려면 클라이언트 드라이버가 엔드포인트 전송 및 명령 큐의 특성을 초기화한 다음 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
머리글 ufxclient.h
IRQL PASSIVE_LEVEL

추가 정보

UfxDeviceCreate

UfxDeviceEventComplete