RemoveStaticFilter

Since 3.6.1

Available since: Windows Packet Filter 3.6.1

The RemoveStaticFilter function deletes a static filter rule from the active static filter table by its zero-based index. Remaining filters following the deleted rule are shifted down to fill the vacancy.

Syntax

BOOL WINAPI RemoveStaticFilter(
    _In_ HANDLE hOpen,
    _In_ DWORD  dwFilterId
);

Parameters

hOpen
[in] Filter device driver handle returned by OpenFilterDriver.

dwFilterId
[in] Zero-based index of the filter to remove from the driver’s active static filter table.

Return Value

Returns TRUE if the filter was successfully removed; returns FALSE if the index was out of range or if the operation failed.

Remarks

This function sends IOCTL_NDISRD_REMOVE_FILTER_BY_INDEX with the target filter index. When removing rules dynamically, applications should be aware that the index of all subsequent rules in the table shifts by -1.

See Also

ResetPacketFilterTable, InsertStaticFilter, AddStaticFilterFront