Platform SDK: Quality of Service |
The TcEnumerateFlows function enumerates installed flows and their associated filters on an interface.
The process of returning flow enumeration often consists of multiple calls to the TcEnumerateFlows function. The process of receiving flow information from TcEnumerateFlows can be compared to reading through a book in multiple sittings—a certain number of pages are read at one time, a bookmark is placed where the reading stopped, and reading is resumed from the bookmark until the book is finished.
The TcEnumerateFlows function fills the Buffer parameter with as many flow enumerations as the buffer can hold, then returns a handle in the pEnumToken parameter that internally bookmarks where the enumeration stopped. Subsequent calls to TcEnumerateFlows must then pass the returned pEnumToken value to instruct traffic control where to resume flow enumeration information. When all flows have been enumerated, pEnumToken will be NULL.
DWORD TcEnumerateFlows( HANDLE IfcHandle, PHANDLE pEnumToken, PULONG pFlowCount, PULONG pBufSize, PENUMERATION_BUFFER Buffer );
For input of the initial call to TcEnumerateFlows, pEnumToken should be set to NULL. For input on subsequent calls, pEnumToken must be the value returned as the pEnumToken OUT parameter from the immediately preceding call to TcEnumerateFlows.
For output, pEnumToken is the refreshed enumeration token that must be used in the following call to TcEnumerateFlows.
Error codes | Description |
---|---|
NO_ERROR | The function executed without errors. |
ERROR_INVALID_HANDLE | Invalid interface handle. |
ERROR_INVALID_PARAMETER | One of the pointers is NULL, or pFlowCount or pBufSize are set to zero. |
ERROR_INSUFFICIENT_BUFFER | The buffer is too small to store even a single flow's information and attached filters. |
ERROR_NOT_ENOUGH_MEMORY | The system is out of memory. |
ERROR_INVALID_DATA | The enumeration token is no longer valid. |
Do not request zero flows, or pass a buffer with a size equal to zero or pointer to a NULL.
If an enumeration token pointer has been invalidated by traffic control (due to the deletion of a flow), continuing to enumerate flows is not allowed, and the call will return ERROR_INVALID_DATA. Under this circumstance, the process of enumeration must start over. This circumstance can occur when the next flow to be enumerated is deleted while enumeration is in progress.
To get the total number of flows for a given interface, call TcQueryInterface and specify GUID_QOS_FLOW_COUNT.
Note Use of the TcEnumerateFlows function requires administrative privilege.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Traffic.h.
Library: Use Traffic.lib.