Enumerating Filters on a VMQ
To obtain a list of all the filters that are set on a receive queue, overlying drivers and applications can use the OID_RECEIVE_FILTER_ENUM_FILTERS method object identifier (OID) request.
The InformationBuffer member of the NDIS_OID_REQUEST structure initially contains a pointer to an NDIS_RECEIVE_FILTER_INFO_ARRAY structure. When it formats the NDIS_RECEIVE_FILTER_INFO_ARRAY structure, the overlying driver or application must set the QueueId member to the identifier (ID) of the receive queue. The receive queue ID is obtained in the following ways:
The overlying driver obtained the receive queue ID value from earlier OID method requests of OID_RECEIVE_FILTER_ALLOCATE_QUEUE or OID_RECEIVE_FILTER_ENUM_QUEUES. The driver can also specify NDIS_DEFAULT_RECEIVE_QUEUE_ID for the default receive queue.
An application obtained the receive queue ID value from an earlier OID method request of OID_RECEIVE_FILTER_ENUM_QUEUES. The application can also specify NDIS_DEFAULT_RECEIVE_QUEUE_ID for the default receive queue.
After a successful return from the OID method request of OID_RECEIVE_FILTER_ENUM_FILTERS, the InformationBuffer member of the NDIS_OID_REQUEST structure contains a pointer to an updated NDIS_RECEIVE_FILTER_INFO_ARRAY structure that is followed by one or more NDIS_RECEIVE_FILTER_INFO structures. Each NDIS_RECEIVE_FILTER_INFO structure specifies the ID for a filter that is set on the specified receive queue.
Overlying drivers or applications can use the OID_RECEIVE_FILTER_PARAMETERS OID method request to obtain the parameters of a specific filter on a receive queue.
The InformationBuffer member of the NDIS_OID_REQUEST structure initially contains a pointer to an NDIS_RECEIVE_FILTER_PARAMETERS structure. The overlying driver or application formats the NDIS_RECEIVE_FILTER_PARAMETERS structure by setting the FilterId member to the nonzero ID value of the filter whose parameters are to be returned.
Note The overlying driver obtained the filter ID from an earlier OID method request of OID_RECEIVE_FILTER_SET_FILTER or OID_RECEIVE_FILTER_ENUM_FILTERS. The application can obtain the filter ID only from an earlier OID method request of OID_RECEIVE_FILTER_ENUM_FILTERS.
NDIS handles the OID_RECEIVE_FILTER_ENUM_FILTERS and OID_RECEIVE_FILTER_PARAMETERS method OID requests for miniport drivers. NDIS obtained the information from an internal cache of the data that it received from the OID_RECEIVE_FILTER_SET_FILTER OID request.