AcxObjectBagRetrieveUI8, fonction (acxmisc.h)

La fonction AcxObjectBagRetrieveUI8 récupère une valeur UI8 non signée int huit octets (ULONG64) à partir d’un AcxObjectBag initialisé existant qui contient des valeurs.

Syntaxe

NTSTATUS AcxObjectBagRetrieveUI8(
  ACXOBJECTBAG     ObjectBag,
  PCUNICODE_STRING ValueName,
  ULONG64          *Value
);

Paramètres

ObjectBag

Objet ACX ObjectBag initialisé. Pour plus d’informations, consultez ACX - Résumé des objets ACX.

ValueName

Nom de la valeur qui sera utilisée pour accéder à la valeur.

Value

Valeur à récupérer à partir du ObjectBag.

Valeur retournée

Retourne STATUS_SUCCESS si l’appel a réussi. Sinon, elle retourne un code d’erreur approprié. Pour plus d’informations, consultez Utilisation de valeurs NTSTATUS.

Remarques

Exemple

Cet exemple montre l’utilisation d’AcxObjectBagRetrieveUI8.

    ACXOBJECTBAG objBag     = NULL;
    ULONG64      ui8Value   = 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, TestUI8);

    ui8Value = 0x9876543210;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagAddUI8(objBag, &TestUI8, ui8Value));

    // Retrieve the value from the object bag
    ui8Value = 0;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagRetrieveUI8(objBag, &TestUI8, &ui8Value));

Configuration requise pour ACX

Version ACX minimale : 1.0

Pour plus d’informations sur les versions d’ACX, consultez Vue d’ensemble des versions d’ACX.

Configuration requise

Condition requise Valeur
En-tête acxmisc.h
IRQL PASSIVE_LEVEL

Voir aussi