Compartilhar via


EVT_UFX_DEVICE_PORT_CHANGE função de retorno de chamada (ufxclient.h)

A implementação do driver cliente para atualizar o tipo da nova porta à qual o dispositivo USB está conectado.

Sintaxe

EVT_UFX_DEVICE_PORT_CHANGE EvtUfxDevicePortChange;

void EvtUfxDevicePortChange(
  [in] UFXDEVICE unnamedParam1,
  [in] USBFN_PORT_TYPE unnamedParam2
)
{...}

Parâmetros

[in] unnamedParam1

O identificador de um objeto de dispositivo USB que o driver cliente recebeu em uma chamada anterior para o UfxDeviceCreate.

[in] unnamedParam2

Um sinalizador tipo USBFN_PORT_STATE que indica o tipo da nova porta.

Valor de retorno

Nenhum

Observações

O driver cliente do controlador de host de função registra sua implementação de EVT_UFX_DEVICE_PORT_CHANGE com a extensão de classe de função USB (UFX) chamando o método UfxDeviceCreate.

A UFX invoca esse retorno de chamada de evento para informar o driver cliente sobre o novo estado do dispositivo.

O driver cliente indica a conclusão desse evento chamando o método UfxDeviceEventComplete.

Exemplos


EVT_UFX_DEVICE_PORT_CHANGE UfxDevice_EvtDevicePortChange;

VOID
UfxDevice_EvtDevicePortChange (
    _In_        UFXDEVICE UfxDevice,
    _In_        USBFN_PORT_TYPE NewPort
    )
/*++

Routine Description:

    EvtDevicePortChange handler for the UFXDEVICE object.
    Caches the new port type, and stops or resumes idle as needed.

Arguments:

    UfxDevice - UFXDEVICE object representing the device.

    NewPort - New port type

--*/
{
    NTSTATUS Status;
    PUFXDEVICE_CONTEXT Context;

    PAGED_CODE();

    TraceEntry();

    Context = UfxDeviceGetContext(UfxDevice);

    TraceInformation("New PORT: %d", NewPort);

    //
    //  #### TODO: Insert code to examine the device USB state and port type 
    //      and determine if it needs to stop or resume idle.


    UfxDeviceEventComplete(UfxDevice, STATUS_SUCCESS);
    TraceExit();
}

Requisitos

Requisito Valor
da Plataforma de Destino Windows
versão mínima do KMDF 1.0
versão mínima do UMDF 2.0
cabeçalho ufxclient.h
IRQL PASSIVE_LEVEL

Consulte também

UfxDeviceCreate

UfxDeviceEventComplete