# pragma endregionid;
}
// Додавання допоміжного фільтра на подуровеньAddFilter (GUID subLayerGUID, HANDLE engineHandle, GUID guid)
{result = NULL;
# pragma region Створення фільтра_FILTER0_ myFilter = {0}; (& myFilter, sizeof (myFilter));. action.type = FWP_ACTION_BLOCK;. subLayerKey = subLayerGUID;. weight.type = FWP_EMPTY;. layerKey = FWPM_LAYER_ALE_AUTH_CONNECT_V4;. displayData.description = L "Secondary filter";. displayData.name = L "Secondary filter";. filterKey = guid;. numFilterConditions = 0;
# pragma endregion
# pragma region Додавання фільтра = FwpmFilterAdd0 (engineHandle, & myFilter, NULL, NULL); (result! = ERROR_SUCCESS) ("Secondary filter added failed with error:% d n n" , result); ("Secondary filter added successfully! n");
# pragma endregion
}
// Видалення фільтрів за збереженим IDDelFilter (HANDLE engineHandle)
{
# pragma region Видалення фільтрів за збереженим ID
FILE * filterFile = fopen ("C: Program Files Filter FilterList.iff", "r"); (! filterFile)
{("File " FilterList.iff "dosen't exist! n");;
} id = NULL; result = NULL; (! feof (filterFile))
{(filterFile, "% d", & id) ;//cчітиваем i-ий адресу
// Якщо останній рядок, то виходимо з циклу
if (feof (filterFile)); (id == 0); = FwpmFilterDeleteById0 (engineHandle, id); (result! = ERROR_SUCCESS) ("Filter (ID =% d) close failed with error:% s n ", id, result);
} (filterFile); ("Filters closed successfully! n");
# pragma endregion
}
// Видалення фільтра по GUID
void DelFilter (HANDLE engineHandle, GUID ID)
{
# pragma region Видалення фільтра по GUID
DWORD result = FwpmFilterDeleteByKey0 (engineHandle, & ID); (result! = ERROR_SUCCESS)
{(result == FWP_E_FILTER_NOT_FOUND) ("Secondary filter doesn't exist. n"); ("Secondary filter closed failed with error:% d n", result);;
} ("Secondary filter closed successfully! n");
# pragma endregion
}
// Видалення подуровняDelSubLayer (HANDLE engineHandle, GUID _idSubLayer)
{
# pragma region Видалення подуровняresult = FwpmSubLayerDeleteByKey0 (engineHandle, & _idSubLayer); (result! = ERROR_SUCCESS) ("SubLayer closed failed with error:% d n", result); (" SubLayer closed successfully! n ");
...