AcxPnpEventCreate function (acxevents.h)
The AcxPnpEventCreate function creates an ACXPNPEVENT.
Syntax
NTSTATUS AcxPnpEventCreate(
WDFDEVICE Device,
ACXOBJECT Object,
PWDF_OBJECT_ATTRIBUTES Attributes,
PACX_PNPEVENT_CONFIG Config,
ACXPNPEVENT *Event
);
Parameters
Device
An existing WDFDEVICE object (described in Summary of Framework Objects) that be associated with the new event.
Object
An existing ACXAUDIOMODULE object that is described in Summary of ACX Objects that will be associated with the event.
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.
Config
An ACX_PNPEVENT_CONFIG structure that defines the configuration for an ACX PNP event.
Event
The ACXEVENT object (described in Summary of ACX Objects).
Return value
Returns STATUS_SUCCESS
if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.
Remarks
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.
Example
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);
ACX requirements
Minimum ACX version: 1.0
For more information about ACX versions, see ACX version overview.
Requirements
Requirement | Value |
---|---|
Header | acxevents.h |
IRQL | PASSIVE_LEVEL |