AcxObjectBagCreate function (acxmisc.h)

The AcxObjectBagCreate function creates a new AcxObjectBag.

Syntax

NTSTATUS AcxObjectBagCreate(
  PWDF_OBJECT_ATTRIBUTES Attributes,
  PACX_OBJECTBAG_CONFIG  Config,
  ACXOBJECTBAG           *ObjectBag
);

Parameters

Attributes

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

Config

A pointer to the initialized ACX_OBJECTBAG_CONFIG structure.

ObjectBag

An initialized ObjectBag ACX object. For more information, see ACX - 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

Example

This example shows the use of AcxObjectBagCreate.

    DECLARE_CONST_UNICODE_STRING(I1Str,    L"Value_I1");

    // Create a simple object.
    ACX_OBJECTBAG_CONFIG_INIT(&cfg1);
    WDF_OBJECT_ATTRIBUTES_INIT(&attr);
    attr.ParentObject = WdfGetDriver();
    
    status = AcxObjectBagCreate(&attr, &cfg1, &bag1);
    if (!NT_SUCCESS(status))
    {
        ASSERT(FALSE);
        goto exit;
    }

    // Add something to the object bag
    status = AcxObjectBagAddI1(bag1, &I1Str, cValue);

ACX requirements

Minimum ACX version: 1.0

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

Requirements

Requirement Value
Header acxmisc.h
IRQL PASSIVE_LEVEL

See also