WdfCollectionGetCount - NtDoc

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

ULONG WdfCollectionGetCount(
  [in] WDFCOLLECTION Collection
);

View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdfcollection-wdfcollectiongetcount)

WdfCollectionGetCount function

Description

[Applies to KMDF and UMDF]

The WdfCollectionGetCount method returns the number of objects that are currently in an object collection.

Parameters

Collection [in]

A handle to a collection object.

Return value

WdfCollectionGetCount returns the number of objects that are in the collection.

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

Remarks

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

Examples

The following code example obtains the number of objects in a specified collection and uses the number to examine all objects in the collection.

ULONG count;

count = WdfCollectionGetCount(CollectionHandle);
for (i = 0; i < count; i++) {
    ObjectHandle = WdfCollectionGetItem(
                                        CollectionHandle,
                                        i
                                        );
    //
    // Perform object-specific operations.
    //
}

See also

WdfCollectionGetItem