// wdfcollection.h
ULONG WdfCollectionGetCount(
[in] WDFCOLLECTION Collection
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF and UMDF]
The WdfCollectionGetCount method returns the number of objects that are currently in an object collection.
Collection
[in]A handle to a collection object.
WdfCollectionGetCount returns the number of objects that are in the collection.
A system bug check occurs if the driver supplies an invalid object handle.
For more information about object collections, see Framework Object Collections.
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.
//
}