AcxObjectBagAddI2, fonction (acxmisc.h)
La fonction AcxObjectBagAddI2 ajoute une valeur I2 d’octet (SHORT) int à une valeur AcxObjectBag initialisée existante.
Syntaxe
NTSTATUS AcxObjectBagAddI2(
ACXOBJECTBAG ObjectBag,
PCUNICODE_STRING ValueName,
SHORT 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 à ajouter à ObjectBag.
Valeur de retour
Retourne STATUS_SUCCESS
si l’appel a réussi. Sinon, elle retourne un code d’erreur approprié. Pour plus d’informations, consultez Using NTSTATUS Values.
Remarques
Exemple
Cet exemple montre l’utilisation d’AcxObjectBagAddI2.
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));
Configuration requise pour ACX
version minimale d’ACX : 1.0
Pour plus d’informations sur les versions ACX, consultez vue d’ensemble de la version ACX.
Exigences
Exigence | Valeur |
---|---|
d’en-tête | acxmisc.h |
IRQL | PASSIVE_LEVEL |