EVT_UFX_DEVICE_DEFAULT_ENDPOINT_ADD funzione di callback (ufxclient.h)

Implementazione del driver client per creare un endpoint di controllo predefinito.

Sintassi

EVT_UFX_DEVICE_DEFAULT_ENDPOINT_ADD EvtUfxDeviceDefaultEndpointAdd;

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

Parametri

[in] unnamedParam1

Handle a un oggetto dispositivo USB ricevuto dal driver client in una chiamata precedente a UfxDeviceCreate.

[in] unnamedParam2

Dimensioni massime predefinite dei pacchetti che possono essere inviate da o a questo endpoint.

[in, out] unnamedParam3

Puntatore a una struttura UFXENDPOINT_INIT opaca che contiene il descrittore dell'endpoint necessario per creare un oggetto endpoint.

Valore restituito

nessuno

Osservazioni

Il driver client per il controller host della funzione registra l'implementazione EVT_UFX_DEVICE_DEFAULT_ENDPOINT_ADD con l'estensione della classe di funzione USB (UFX) chiamando il metodo UfxDeviceCreate .

Per creare l'endpoint, è previsto che il driver client inizializzi gli attributi delle code di trasferimento e comando dell'endpoint e quindi chiami UfxEndpointCreate per creare l'endpoint. Dopo aver creato l'endpoint di controllo predefinito, UFX è pronto per elaborare i pacchetti di installazione e altri pacchetti di trasferimento dei controlli dall'host.

Il driver client indica il completamento di questo evento chiamando il metodo UfxDeviceEventComplete .

Esempio


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();
}

Requisiti

Requisito Valore
Piattaforma di destinazione Windows
Versione KMDF minima 1,0
Versione UMDF minima 2,0
Intestazione ufxclient.h
IRQL PASSIVE_LEVEL

Vedi anche

UfxDeviceCreate

UfxDeviceEventComplete