ritwik
ritwik

Reputation: 51

How to debug an ISAPI Filter?

ISAPI Filters are dll's that get attached to the w3wp process of IIS web server. ISAPI Filters have to compulsorily export two functions viz. HttpFilterProc and GetFilterVersion. I have written one such filter but it is not working in the way that the switch case in HttpFilterProc is not getting activated. What can i do to check whats wrong here ?

Upvotes: 3

Views: 1092

Answers (1)

Paras Gera
Paras Gera

Reputation: 167

Add a call to DebugBreak in your HttpFilterProc and build your DLL in debug mode before adding it as ISAPI filter.

If your HttpFilterProc gets called, windows would popup a message to debug the process.

If it doesn't your DLL is not getting loaded. You need to check why it is not. Some reasons may be:

  1. The ISAPI filter is configured with different bitness as compared to the application pool bitness.
  2. You have not registered for any ISAPI events in your GetFilterVersion function. See list of ISAPI events here.

Upvotes: 2

Related Questions