FwpmFilterAdd0添加规则永久性对象FWPM_FILTER_FLAG_PERSISTENT 报错0x80320016解决方法

Objects can have one of four possible lifetimes:

Dynamic — An object is dynamic only if it is added using a dynamic session handle. Dynamic objects live until they are deleted or the owning session terminates.
Static — Objects are static by default. Static objects live until they are deleted, BFE stops, or the system is shutdown.
Persistent — Persistent objects are created by passing the appropriate FWPM__FLAG_PERSISTENT flag to an FwpmAdd0 function. Persistent objects live until they are deleted.
Built-in — Built-in objects are predefined by BFE and cannot be added or deleted. They live forever.
Filters in kernel-mode layers can be marked as boot-time filters by passing the appropriate flag to FwpmFilterAdd0. Boot-time filters are added to the system when the TCP/IP driver starts, and removed when BFE finishes initialization. Persistent objects are added when BFE starts.

In many cases, a policy provider may not want its persistent policy enforced if the provider has been disabled. When adding a provider, the caller can specify an optional Windows service name. When adding persistent objects, the caller can optionally specify the provider that “owns” that object. At service start, BFE only adds persistent objects to the system if they are not associated with a provider, or the associated provider has no Windows service name, or the associated Windows service is set to auto-start.
解决方法非动态session
而且provider和sublayer都要PERSISTENT

你可能感兴趣的:(windows,windows)