KsAddItemToObjectBag function

The KsAddItemToObjectBag function adds an object or block of memory to the given object bag.

Syntax


NTSTATUS KsAddItemToObjectBag(
  _In_     KSOBJECT_BAG ObjectBag,
  _In_     PVOID        Item,
  _In_opt_ PFNKSFREE    Free
);

Parameters

ObjectBag [in]

The KSOBJECT_BAG (equivalent to type PVOID) to which to add the requested item. Every AVStream object (for example, KSFILTER and KSPIN) contains a member called Bag. Pass that member in this parameter.

Item [in]

A pointer to the item to add to the object bag.

Free [in, optional]

A function that is called when the item is removed from the object bag or when the object bag is deleted. This function typically is used to free any dynamic memory associated with Item. The function should be prototyped as follows:


void Free (IN PVOID Data);

If the caller does not specify this optional parameter, Item is freed with ExFreePool when removed from the object bag or when the object bag is deleted.

Return value

Either returns STATUS_SUCCESS indicating that the addition went normally or STATUS_INSUFFICIENT_RESOURCES indicating that there are insufficient system resources for the operation to proceed.

Remarks

Before calling KsAddItemToObjectBag, the minidriver must acquire the mutex associated with the specific object bag. If ObjectBag is a member of a KSDEVICE or KSFILTERFACTORY, acquire the device mutex. If the bag is a member of a KSFILTER, acquire the filter control mutex. If the bag is a member of a KSPIN object, acquire the parent KSFILTER's filter control mutex.

For more information, see Object Bags and Mutexes in AVStream.

Requirements

Target platform

Universal

Version

Available in Microsoft Windows XP and later operating systems and DirectX 8.0 and later DirectX versions.

Header

Ks.h (include Ks.h)

Library

Ks.lib

IRQL

PASSIVE_LEVEL

See also

KsRemoveItemFromObjectBag
KsDiscard
KsAllocateObjectBag
KsFreeObjectBag
KsCopyObjectBagItems
_KsEdit
ExFreePool

 

 

Send comments about this topic to Microsoft

Show: