AcxCircuitCreate function (acxcircuit.h)

The AcxCircuitCreate function is used to create an ACXCIRCUIT.

Syntax

NTSTATUS AcxCircuitCreate(
  WDFDEVICE              Device,
  PWDF_OBJECT_ATTRIBUTES Attributes,
  PACXCIRCUIT_INIT       *Config,
  ACXCIRCUIT             *Circuit
);

Parameters

Device

A WDFDEVICE object (described in Summary of Framework Objects) that will be associated with the circuit.

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 WDF object.

Config

The ACXCIRCUIT_INIT structure that defines the circuit factory initialization. ACXCIRCUIT_INIT is an opaque object used for circuit factory initialization. Use AcxCircuitInitAllocate to initialize the ACXCIRCUIT_INIT structure.

Circuit

A pointer to a location that receives a handle to the new ACXCIRCUIT Object. For more information, see 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 ACXCIRCUIT represents a full or partial (multi-circuit) audio path to a user perceived audio device (speakers, mic, etc.).

An ACXCIRCUIT has at least one input pin (ACXPIN) and one output pin (ACXPIN), and it may aggregate one or more ACXELEMENTS objects. By default, ACXELEMENTs are 'connected' in the same order of assembly.

Example

Example usage is shown below.

    status = AcxCircuitInitAssignName(circuitInit, &circuitName);
    //
    // Add circuit type.
    //
    AcxCircuitInitSetCircuitType(circuitInit, AcxCircuitTypeRender);

    //
    // Assign the circuit's pnp-power callbacks.
    //
    ACX_CIRCUIT_PNPPOWER_CALLBACKS_INIT(&powerCallbacks);
    powerCallbacks.EvtAcxCircuitPowerUp = SdcaR_EvtCircuitPowerUp;
    powerCallbacks.EvtAcxCircuitPowerDown = SdcaR_EvtCircuitPowerDown;
    
    AcxCircuitInitSetAcxCircuitPnpPowerCallbacks(circuitInit, &powerCallbacks);

    //
    // Set circuit-callbacks.
    //
    status = AcxCircuitInitAssignAcxCreateStreamCallback(
                                            circuitInit, 
                                            SdcaR_EvtCircuitCreateStream);
    
    //
    // Create the circuit.
    //
    WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, SDCA_RENDER_CIRCUIT_CONTEXT);   
    status = AcxCircuitCreate(Device, &attributes, &circuitInit, &circuit);

ACX requirements

Minimum ACX version: 1.0

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

Requirements

Requirement Value
Header acxcircuit.h
IRQL PASSIVE_LEVEL

See also