// acxevents.h
NTSTATUS AcxPnpEventCreate(
WDFDEVICE Device,
ACXOBJECT Object,
PWDF_OBJECT_ATTRIBUTES Attributes,
PACX_PNPEVENT_CONFIG Config,
ACXPNPEVENT *Event
);
View the official Windows Driver Kit DDI referenceNo description available.
The AcxPnpEventCreate function creates an ACXPNPEVENT.
DeviceAn existing WDFDEVICE object (described in Summary of Framework Objects) that be associated with the new event.
ObjectAn existing ACXAUDIOMODULE object that is described in Summary of ACX Objects that will be associated with the event.
AttributesAdditional 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.
ConfigAn ACX_PNPEVENT_CONFIG structure that defines the configuration for an ACX PNP event.
EventThe ACXEVENT object (described in Summary of ACX Objects).
Returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.
An ACXPNPEVENT represents an asynchronous notification available at the driver level. PNP events can be added to any objects. Currently they are used with ACXAUDIOMODULE and ACXKEYWARDSPOTTER objects. Internally AcxPnpEvents are exposed as PNP asynchronous notification to upper layers.
This example code shows the use of AcxPnpEventCreate.
NTSTATUS status;
ACXAUDIOMODULE audioModuleElement;
WDF_OBJECT_ATTRIBUTES attributes;
ACX_PNPEVENT_CONFIG audioModuleEventCfg;
ACXPNPEVENT audioModuleEvent;
...
status = AcxAudioModuleCreate(Circuit, &attributes, &audioModuleCfg, &audioModuleElement);
audioModule0Ctx = GetCodecAudioModule0Context(audioModuleElement);
ACX_PNPEVENT_CONFIG_INIT(&audioModuleEventCfg);
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, CODEC_PNPEVENT_CONTEXT);
attributes.ParentObject = audioModuleElement;
status = AcxPnpEventCreate(Device, audioModuleElement, &attributes, &audioModuleEventCfg, &audioModuleEvent);
Minimum ACX version: 1.0
For more information about ACX versions, see ACX version overview.