Windows Filtering Platform error

1.2k views Asked by At

I am Very New to Windows Filtering Platform.. I am trying learn this.. I started with msdn website's code.. as here . I tried to compile the code and I got 13 errors which were in header file "fwptypes.h" . I dont know how to resolve this .. Any Suggestion.. Here is the error IMG

2

There are 2 answers

0
Aladdin On

For eliminating the first error (precompiled header), there are three ways:

  1. Change your project setting to be "Not Using Precompiled Headers" (Right click project->Select "Properties" in popup menu->Configuration Properties->C/C++->Precompiled Headers->Precompiled Header).

Or 2. Copying the demo code into a header file instead of cpp file.

Or 3. Add "stdafx.h" in front of demo code.

For other compile errors, try this (this solution comes from http://social.msdn.microsoft.com/Forums/en-US/wfp/thread/8fd93a3d-a794-4233-9ff7-09b89eed6b1f, I tested, it works):

There is a bug in the header files (extra line spaces). You can modify your copies directly:

FwpTypes.h @ line 275:

#define FWP_ACTION_BLOCK \
   (0x00000001 | FWP_ACTION_FLAG_TERMINATING)
 #define FWP_ACTION_PERMIT \
   (0x00000002 | FWP_ACTION_FLAG_TERMINATING)
#define FWP_ACTION_CALLOUT_TERMINATING \
   (0x00000003 | FWP_ACTION_FLAG_CALLOUT | FWP_ACTION_FLAG_TERMINATING)
#define FWP_ACTION_CALLOUT_INSPECTION \
   (0x00000004 | FWP_ACTION_FLAG_CALLOUT | FWP_ACTION_FLAG_NON_TERMINATING)
#define FWP_ACTION_CALLOUT_UNKNOWN \
   (0x00000005 | FWP_ACTION_FLAG_CALLOUT)
#define FWP_ACTION_CONTINUE \
   (0x00000006 | FWP_ACTION_FLAG_NON_TERMINATING)
#define FWP_ACTION_NONE \
   (0x00000007)
#define FWP_ACTION_NONE_NO_MATCH \
   (0x00000008)

FwpTypes.h @ line 343

#define FWP_FILTER_ENUM_VALID_FLAGS \
   (FWP_FILTER_ENUM_FLAG_BEST_TERMINATING_MATCH | \
    FWP_FILTER_ENUM_FLAG_SORTED)

IkeTypes.h @ line 367

#define IKEEXT_ERROR_CODE_COUNT  \
   (ERROR_IPSEC_IKE_NEG_STATUS_END - ERROR_IPSEC_IKE_NEG_STATUS_BEGIN)
0
Security Crazy On

You can use WinDivert open source WFP callout driver .

WinDivert essentially passes the packets to the underlying Windows Filtering Platform (WFP) packet injection functions.

check out this link for more information .. http://reqrypt.org/windivert.html