KsDiscard function

The KsDiscard macro removes a given item from an object bag.

Syntax


ULONG KsDiscard(
  _In_ KSxxx Object,
  _In_ PVOID Pointer
);

Parameters

Object [in]

The item pointed to by Pointer is removed from the object bag associated with this object. Can be of type KSDEVICE, KSFILTERFACTORY, KSFILTER, or KSPIN.

Pointer [in]

A pointer to the item to be removed from the requested object's bag.

Return value

Returns the number of references on Item. A return value of zero indicates that the item pointed to by Pointer was not in the object bag of Object at call-time.

A return value of one indicates that the item was successfully removed from the object bag and that it was not in any other object bag. AVStream frees the item using either ExFreePool or the Free method specified at KsAddItemToObjectBag call-time.

A return value greater than one indicates that the item is present in another object bag and that there are still references on it. In this case, AVStream removed the item from the object bag but did not free it.

Remarks

This function is implemented as a C-style preprocessing macro in the Ks.h header.

KsDiscard calls KsRemoveItemFromObjectBag, passing the object bag associated with Object (Object -> Bag), the item specified by Pointer, and TRUE for the Free parameter.

Requirements

Target platform

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
KSDEVICE
KSFILTERFACTORY
KSFILTER
KSPIN

 

 

Send comments about this topic to Microsoft

Show: