EVT_UFX_DEVICE_PORT_CHANGE funzione di callback (ufxclient.h)

Implementazione del driver client per aggiornare il tipo della nuova porta a cui è connesso il dispositivo USB.

Sintassi

EVT_UFX_DEVICE_PORT_CHANGE EvtUfxDevicePortChange;

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

Parametri

[in] unnamedParam1

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

[in] unnamedParam2

Flag USBFN_PORT_STATE tipizzato che indica il tipo della nuova porta.

Valore restituito

nessuno

Osservazioni

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

UFX richiama il callback dell'evento per informare il driver client sullo stato nuovo del dispositivo.

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

Esempio


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

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