WdfCollectionGetItem function (wdfcollection.h)

[Applies to KMDF and UMDF]

The WdfCollectionGetItem method returns a handle to the object that is contained in a specified object collection and associated with a specified index value.

Syntax

WDFOBJECT WdfCollectionGetItem(
  [in] WDFCOLLECTION Collection,
  [in] ULONG         Index
);

Parameters

[in] Collection

A handle to a collection object.

[in] Index

A zero-based index value that identifies an object in the collection.

Return value

WdfCollectionGetItem returns a framework object handle, or NULL if the Index value is invalid.

A system bug check occurs if the driver supplies an invalid object handle.

Remarks

Index values represent the order in which objects are added to a collection. An index value of zero represents the first object in the collection, an index value of one represents the second object, and so on, like a linked list. When the driver removes item i from a collection, item i+1 becomes item i.

For more information about object collections, see Framework Object Collections.

Examples

For a code example that uses WdfCollectionGetItem, see WdfCollectionGetCount.


Requirements

Requirement Value
Target Platform Universal
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfcollection.h (include Wdf.h)
Library Wdf01000.sys (KMDF); WUDFx02000.dll (UMDF)
IRQL <= DISPATCH_LEVEL
DDI compliance rules DriverCreate(kmdf), KmdfIrql(kmdf), KmdfIrql2(kmdf), KmdfIrqlExplicit(kmdf)

See also

WdfCollectionGetFirstItem

WdfCollectionGetLastItem