Funzione AcxEventCreate (acxevents.h)
La funzione AcxEventCreate crea un evento ACX.
Sintassi
NTSTATUS AcxEventCreate(
ACXOBJECT Object,
PWDF_OBJECT_ATTRIBUTES Attributes,
PACX_EVENT_CONFIG Config,
ACXEVENT *Event
);
Parametri
Object
ACXOBJECT descritto in Riepilogo degli oggetti ACX.
Attributes
Attributi aggiuntivi definiti usando un WDF_OBJECT_ATTRIBUTES utilizzati per impostare i valori dei vari oggetti: pulizia ed eliminazione dei callback, tipo di contesto e per specificare il relativo oggetto padre.
Config
Struttura ACX_EVENT_CONFIG che definisce la configurazione dell'evento ACX.
Event
Oggetto ACXEVENT appena creato (descritto in Riepilogo degli oggetti ACX).
Valore restituito
Restituisce STATUS_SUCCESS
se la chiamata ha avuto esito positivo. In caso contrario, restituisce un codice di errore appropriato. Per altre informazioni, vedere Uso di valori NTSTATUS.
Osservazioni
Un ACXEVENT rappresenta una notifica asincrona disponibile a livello di driver. Gli eventi possono essere aggiunti a ACXCIRCUITs, ACXSTREAMs, ACXELEMENTs e ACXPINs. Internamente vengono esposti come eventi KS ai livelli superiori. Per altre informazioni sugli eventi KS, vedere KS Events.
Esempio
Questo esempio di snip del codice mostra come ACX usa AcxEventCreate per creare un evento di modifica del jack audio.
NTSTATUS status = STATUS_SUCCESS;
PAGED_CODE();
ACX_EVENT_CALLBACKS eventCallbacks;
ACX_EVENT_CONFIG eventCfg;
AFX_PIN_EVENT_CONTEXT *eventCtx;
ACXEVENT jackEvent;
WDF_OBJECT_ATTRIBUTES attributes;
//
// Add jack info change event to this jack object
//
ACX_EVENT_CALLBACKS_INIT(&eventCallbacks);
eventCallbacks.EvtAcxEventEnable = &AfxPin::EvtJackEventEnableCallback;
eventCallbacks.EvtAcxEventDisable = &AfxPin::EvtJackEventDisableCallback;
ACX_EVENT_CONFIG_INIT(&eventCfg);
eventCfg.Set = &KSEVENTSETID_PinCapsChange;
eventCfg.Id = KSEVENT_PINCAPS_JACKINFOCHANGE;
eventCfg.Callbacks = &eventCallbacks;
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, AFX_PIN_EVENT_CONTEXT);
attributes.ParentObject = GetObjectHandle();
status = AcxEventCreate(GetObjectHandle(), &attributes, &eventCfg, &jackEvent);
Requisiti ACX
versione minima di ACX: 1.0
Per altre informazioni sulle versioni di ACX, vedere panoramica della versione ACX.
Fabbisogno
Requisito | Valore |
---|---|
intestazione | acxevents.h |
IRQL | PASSIVE_LEVEL |