AcxObjectBagAddI8 function (acxmisc.h)

The AcxObjectBagAddI8 function adds an int eight byte I8 (LONG64) value to an existing, initialized AcxObjectBag.

Syntax

NTSTATUS AcxObjectBagAddI8(
  ACXOBJECTBAG     ObjectBag,
  PCUNICODE_STRING ValueName,
  LONG64           Value
);

Parameters

ObjectBag

An initialized ObjectBag ACX object. For more information, see ACX - Summary of ACX Objects.

ValueName

The name of the value that will be used to access the value.

Value

The Value to be added to the ObjectBag.

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 AcxObjectBagAddI8.

    ACXOBJECTBAG objBag    = NULL;
    LONG64       i8Value   = 0;

    //Initialize an object bag configuration
    ACX_OBJECTBAG_CONFIG objBagCfg;
    ACX_OBJECTBAG_CONFIG_INIT(&objBagCfg);
    
    // Set the WDF attributes, and create an object bag 
    WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
    attributes.ParentObject = Circuit;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagCreate(&attributes, &objBagCfg, &objBag));

    // Enable deletion of the object bag when the function completes and goes out of scope
    auto objBag_scope = scope_exit([&objBag]() {
        if (objBag != NULL)
        {
            WdfObjectDelete(objBag);
        }
    });

    //Create Properties and add them to an object bag
    DECLARE_CONST_ACXOBJECTBAG_DRIVER_PROPERTY_NAME(VendorX, TestI8);

    i8Value = 0x9876543210;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagAddI8(objBag, &TestI8, i8Value));

    // Retrieve the value from the object bag
    i8Value = 0;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagRetrieveI8(objBag, &TestI8, &i8Value));

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