Skip to content

Latest commit

 

History

History
113 lines (85 loc) · 3.28 KB

nf-acxevents-acxeventcreate.md

File metadata and controls

113 lines (85 loc) · 3.28 KB
UID tech.root title ms.date targetos description prerelease req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_type api_location api_name f1_keywords dev_langs
NF:acxevents.AcxEventCreate
audio
AcxEventCreate
12/16/2022
Windows
The AcxEventCreate function creates an event.
false
function
acxevents.h
PASSIVE_LEVEL
apiref
LibDef
acxevents.h
AcxEventCreate
AcxEventCreate
acxevents/AcxEventCreate
c++

-description

The AcxEventCreate function creates an ACX event.

-parameters

-param Object

An ACXOBJECT that is described in Summary of ACX Objects.

-param Attributes

Additional Attributes defined using a WDF_OBJECT_ATTRIBUTES that are used to set the various object's values: cleanup and destroy callbacks, context type, and to specify its parent object.

-param Config

An ACX_EVENT_CONFIG structure that defines the ACX event configuration.

-param Event

The newly created ACXEVENT object (described in Summary of ACX Objects).

-returns

Returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.

-remarks

An ACXEVENT represents an asynchronous notification available at the driver level. Events can be added to ACXCIRCUITs, ACXSTREAMs, ACXELEMENTs and ACXPINs. Internally they are exposed as KS Events to upper layers. For more information about KS Events, see KS Events.

Example

This example code snip, shows how ACX uses AcxEventCreate to create an audio jack change event.

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

ACX requirements

Minimum ACX version: 1.0

For more information about ACX versions, see ACX version overview.

-see-also