QOSEnumerateFlows function

The QOSEnumerateFlows function enumerates all existing flows.


BOOL WINAPI QOSEnumerateFlows(
  _In_    HANDLE QOSHandle,
  _Inout_ PULONG Size,
  _Out_   PVOID  Buffer


QOSHandle [in]

Handle to the QOS subsystem returned by QOSCreateHandle.

Size [in, out]

Indicates the size of the Buffer parameter, in bytes.

On function return, if successful, this parameter will specify the number of bytes copied into Buffer.

If this call fails with ERROR_INSUFFICIENT_BUFFER, this parameter will indicate the minimum required Buffer size in order to successfully complete this operation.

Buffer [out]

Pointer to an array of QOS_FlowId flow identifiers. A QOS_FlowId is an unsigned 32-bit integer.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is 0. To get extended error information, call GetLastError. Some possible error codes follow.

Return codeDescription

The QOSHandle parameter is invalid.


Buffer is too small. On output, Size will contain the minimum required buffer size. This function should then be called again with a buffer of the indicated size.


The DestAddr parameter is invalid.


Indicates that a memory allocation failed.


There are insufficient resources to carry out the operation.


The request could not be performed because of an I/O device error.


The indicated device requires reinitialization due to hardware errors. The application should clean up and call QOSCreateHandle again.



Successfully calling this function requires administrative privileges

Calling the QOSEnumerateFlows function retrieves a list of QOS_FlowIds currently active on the QOS subsystem. These QOS_FlowIds could then be used to call the QOSQueryFlow function in order to gain more information on individual flows.

This function has call-twice semantics. First call to get the Buffer size, then call again (with an appropriately sized Buffer if the first call failed with ERROR_INSUFFICIENT_BUFFER) to retrieve the list of flows. The second call may fail again with ERROR_INSUFFICIENT_BUFFER if new flows ere added since the first call.

Flows from another process cannot be modified.


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]


Qos2.h (include Qos2.h)





See also

Quality Windows Audio/Video Experience (qWAVE)