Hi,
Sorry for the late response.
+bool
+win_wfp_uninit()
+{
+ dmsg (D_LOW, "Uninitializing WFP");
+ if (m_hEngineHandle) {
+ FwpmSubLayerDeleteByKey0(m_hEngineHandle, &m_subLayerGUID);
+ CLEAR(m_subLayerGUID);
+ FwpmEngineClose0(m_hEngineHandle);
+ m_hEngineHandle = NULL;
FwpmSubLayerDeleteByKey0 will likely fail if there is a filter
associated with sublayer. On the other side, FwpmEngineClose0 seems to
be enough to remove blocking.
I think the correct way would be to create GUID for filter same way as
you did for sublayer and copy it to filter.filterKey. In uninit method,
before deleting sublayer you call FwpmFilterDeleteByKey0 with that guid.
-Lev