KsAllocateObjectBag - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ks.h

KSDDKAPI NTSTATUS KsAllocateObjectBag(
  [in]  PKSDEVICE    Device,
  [out] KSOBJECT_BAG *ObjectBag
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-ks-ksallocateobjectbag)

KsAllocateObjectBag function

Description

The KsAllocateObjectBag function creates an object bag and associates it with a KSDEVICE.

Parameters

Device [in]

A pointer to a KSDEVICE representing the device object associated with the newly created object bag.

ObjectBag [out]

A pointer to a KSOBJECT_BAG (the KSOBJECT_BAG structure is equivalent to type PVOID) where the newly allocated object bag is deposited.

Return value

Returns STATUS_SUCCESS if a new object bag is created. If a new object bag is not allocated, it returns STATUS_INSUFFICIENT_RESOURCES.

Remarks

An allocated object bag is not deleted automatically. The minidriver calling KsAllocateObjectBag is responsible for deletion of the object bag. The easiest way to do this is by calling KsFreeObjectBag. Alternatively, if the minidriver has the addresses of the items in the bag, the minidriver can delete them individually by calling KsRemoveItemFromObjectBag.

For more information, see Object Bags.

See also

KsAddItemToObjectBag

KsCopyObjectBagItems

KsDiscard

KsFreeObjectBag

KsRemoveItemFromObjectBag