// acxmisc.h
NTSTATUS AcxObjectBagRetrieveString(
ACXOBJECTBAG ObjectBag,
PCUNICODE_STRING ValueName,
WDFSTRING Value
);
View the official Windows Driver Kit DDI referenceNo description available.
The AcxObjectBagRetrieveString function retrieves a WDFSTRING object from an existing, initialized AcxObjectBag.
ObjectBagAn initialized ObjectBag ACX object. For more information, see ACX - Summary of ACX Objects.
ValueNameA ValueName that will be associated with the added string and will be used to retrieve the stored string.
ValueThe WDFSTRING object value to be retrieved from the ObjectBag.
Returns STATUS_SUCCESS if the call was successful. Otherwise, it returns an appropriate error code. For more information, see Using NTSTATUS Values.
This example shows the use of AcxObjectBagRetrieveString.
status = RtlUnicodeStringInit(&usName, inParams->ValueName);
if (!NT_SUCCESS(status))
{
DrvLogError(g_RecorderLog, FLAG_DDI,
"WDFDEVICE %p, RtlUnicodeStringInit(%S) failed, %!STATUS!",
m_Device, inParams->ValueName, status);
goto exit;
}
//
// Set the specified property.
//
switch(inParams->ValueType)
{
case REG_SZ:
//
// Create an empty WDF string to get the value.
//
status = WdfStringCreate(nullptr, nullptr, &wsValue);
if (!NT_SUCCESS(status))
{
DrvLogError(g_RecorderLog, FLAG_DDI,
"WDFDEVICE %p, WdfStringCreate failed, %!STATUS!",
m_Device, status);
goto exit;
}
//
// Get the string value from bag.
//
status = AcxObjectBagRetrieveString(objBag, &usName, wsValue);
Minimum ACX version: 1.0
For more information about ACX versions, see ACX version overview.