Filter Weight Assignment
Every filter in the Windows Filtering Platform (WFP) has an associated weight, which is used during filter arbitration.
The filter weight used by the Base Filtering Engine (BFE) is of type FWP_UINT64. Callers have three options when adding filters.
Set the weight to an FWP_UINT64. BFE uses the supplied weight as is.
Set the weight to FWP_EMPTY. BFE automatically generates a weight in the range [0, 2⁶⁰).
Set the weight to an FWP_UINT8 in the range [0, 15]. BFE uses the supplied weight as a weight range identifier.
BFE automatically generates the low-order 60 bits (exactly as if the weight had been set to FWP_EMPTY), and then uses the supplied value to set the 4 high-order bits. This allows callers to manually divide the weight space into 16 ranges, while still using automatic weighting within a range.
When two or more callouts are registered at the same sublayer, problems may occur when the same weight is assigned to the filters. This issue can be prevented by having callouts create their own sublayer by using FwpmSubLayerAdd0.