Función AcxObjectBagAddGuid (acxmisc.h)
La función AcxObjectBagAddGuid agrega datos Guid a un AcxObjectBag existente inicializado.
Sintaxis
NTSTATUS AcxObjectBagAddGuid(
ACXOBJECTBAG ObjectBag,
PCUNICODE_STRING ValueName,
GUID Value
);
Parámetros
ObjectBag
Objeto ACX inicializado ObjectBag. Para obtener más información, vea ACX : resumen de objetos ACX.
ValueName
Nombre del valor que se usará para tener acceso al valor.
Value
Valor que se va a agregar a ObjectBag.
Valor devuelto
Devuelve STATUS_SUCCESS
si la llamada se realizó correctamente. De lo contrario, devuelve un código de error adecuado. Para obtener más información, vea Uso de valores NTSTATUS.
Comentarios
Ejemplo
El código siguiente muestra el uso de AcxObjectBagAddGuid.
// Object bag
//
// This obj-bag config setting is shared by all composite/circuit templates.
ACX_OBJECTBAG_CONFIG objBagCfg;
ACX_OBJECTBAG_CONFIG_INIT(&objBagCfg);
WDF_OBJECT_ATTRIBUTES attributes;
WDF_OBJECT_ATTRIBUTES_INIT(&attributes);
attributes.ParentObject = AcxGetManager(NULL);
ACXOBJECTBAG objBag = NULL;
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);
}
});
//
// Add a test unsigned int 4 bytes to the object bag
//
RETURN_NTSTATUS_IF_FAILED(ObjBagAddTestUI4(objBag, 0));
//
// Add unique circuit ID to the object bag
// This unique Id will be picked up by DSP circuit
//
DECLARE_CONST_ACXOBJECTBAG_SYSTEM_PROPERTY_NAME(UniqueID);
GUID uniqueID = { 0 };
RETURN_NTSTATUS_IF_FAILED(RtlGUIDFromString(&circuit_IDs[compositeType], &uniqueID));
RETURN_NTSTATUS_IF_FAILED(AcxObjectBagAddGuid(objBag, &UniqueID, uniqueID));
Requisitos de ACX
Versión mínima de ACX: 1.0
Para obtener más información sobre las versiones de ACX, consulte Introducción a la versión de ACX.
Requisitos
Requisito | Valor |
---|---|
Header | acxmisc.h |
IRQL | PASSIVE_LEVEL |