FwpmFilterAdd occasionally fails with return code 31
Pankaj Mehta
0
Reputation points
I am creating Ipsec tunnel using Windows Filtering Platform API in the process. Code is on the line of example provided at https://learn.microsoft.com/en-us/windows/win32/fwp/using-transport-mode
- Code works 95% percent of the times
- But for some random 5%, it fails with return code 31(ERROR_GEN_FAILURE) when API FwpmFilterAdd0 is called
- General failure doesn't provide any useful info on what has happened or how I can make the code more robust.
- My platform in Windows Server 2019
- I have checked the System event logs and cannot find any useful trace there.
My questions is how to get better diagnostic information to debug this error? Any other tips would be useful.
Sign in to answer