Condividi tramite


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 per un oggetto dispositivo USB ricevuto dal driver client in una chiamata precedente al 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 l'implementazione EVT_UFX_DEVICE_PORT_CHANGE con l'estensione della classe di funzione USB (UFX) chiamando il metodo UfxDeviceCreate.

UFX richiama questo callback di eventi per informare il driver client del nuovo stato del dispositivo.

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

Esempi


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

Fabbisogno

Requisito Valore
piattaforma di destinazione Finestre
versione minima di KMDF 1.0
versione minima di UMDF 2.0
intestazione ufxclient.h
IRQL PASSIVE_LEVEL

Vedere anche

UfxDeviceCreare

UfxDeviceEventComplete