Skip to content

Latest commit

 

History

History
111 lines (85 loc) · 2.89 KB

nf-acxmisc-acxobjectbagretrieveui4.md

File metadata and controls

111 lines (85 loc) · 2.89 KB
UID tech.root title ms.date targetos description prerelease req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi topic_type api_type api_location api_name f1_keywords dev_langs
NF:acxmisc.AcxObjectBagRetrieveUI4
audio
AcxObjectBagRetrieveUI4
12/16/2022
Windows
The AcxObjectBagRetrieveUI4 function retrieves an unsigned int four byte UI4 (ULONG) value from an existing, initialized AcxObjectBag that contains values.
false
function
acxmisc.h
PASSIVE_LEVEL
apiref
LibDef
acxmisc.h
AcxObjectBagRetrieveUI4
AcxObjectBagRetrieveUI4
acxmisc/AcxObjectBagRetrieveUI4
c++

-description

The AcxObjectBagRetrieveUI4 function retrieves an unsigned int four byte UI4 (ULONG) value from an existing, initialized AcxObjectBag that contains values.

-parameters

-param ObjectBag

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

-param ValueName

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

-param Value

The Value to be retrieved from the ObjectBag.

-returns

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

    ACXOBJECTBAG objBag     = NULL;
    ULONG        ui4Value   = 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, TestUI4);

    ui4Value = 1;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagAddUI4(objBag, &TestUI4, ui4Value));

    // Retrieve the value from the object bag
    ui4Value = 0;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagRetrieveUI4(objBag, &TestUI4, &ui4Value));

ACX requirements

Minimum ACX version: 1.0

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

-see-also