Condividi tramite


Funzione AcxObjectBagRetrieveI2 (acxmisc.h)

La funzione AcxObjectBagRetrieveI2 recupera un valore I2 di byte (SHORT) da un valore AcxObjectBag esistente inizializzato AcxObjectBag che contiene valori.

Sintassi

NTSTATUS AcxObjectBagRetrieveI2(
  ACXOBJECTBAG     ObjectBag,
  PCUNICODE_STRING ValueName,
  SHORT            *Value
);

Parametri

ObjectBag

Oggetto ObjectBag ACX inizializzato. Per altre informazioni, vedere ACX - Riepilogo degli oggetti ACX.

ValueName

Nome del valore che verrà usato per accedere al valore.

Value

Valore da recuperare da ObjectBag.

Valore restituito

Restituisce STATUS_SUCCESS se la chiamata ha avuto esito positivo. In caso contrario, restituisce un codice di errore appropriato. Per altre informazioni, vedere Uso dei valori NTSTATUS.

Commenti

Esempio

In questo esempio viene illustrato l'uso di AcxObjectBagRetrieveI2.

    ACXOBJECTBAG objBag     = NULL;
    SHORT        i2Value    = 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, TestI2);

    i2Value = 1;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagAddI2(objBag, &TestI2, i2Value));

    // Retrieve the value from the object bag
    i2Value = 0;
    RETURN_NTSTATUS_IF_FAILED(AcxObjectBagRetrieveI2(objBag, &TestI2, &i2Value));

Requisiti ACX

Versione minima DI ACX: 1.0

Per altre informazioni sulle versioni ACX, vedere Panoramica della versione di ACX.

Requisiti

Requisito Valore
Intestazione acxmisc.h
IRQL PASSIVE_LEVEL

Vedi anche