How many of you are familiar with the following scenario of ISAPI Filters on IIS:
And... the filter does not appear to be loaded nor working. Now:
When you see the above situation when you are trying to install an ISAPI Filter, the best way to troubleshoot is to look in the Windows Event Log for error event entries from either W3SVC or W3SVC-WP regarding a failure to load the HTTP Filter DLL. The "data" of the error is the most important piece of information used to diagnose the failure to load/run an ISAPI Filter.
Here are some of the common error codes and resolutions (one big caveat mentioned at the end...):
Win32 error 2 - NET HELPMSG 2 returns "The system cannot find the file specified."
Win32 error 5 - NET HELPMSG 5 returns "Access is denied."
Win32 error 126 - NET HELPMSG 126 returns "The specified module could not be found."
Win32 error 127 - NET HELPMSG 127 returns "The specified procedure could not be found."
LIBRARY MyFilterNameEXPORTS GetFilterVersion HttpFilterProc
For example, suppose your ISAPI uses the RegGetValue() API call introduced in Windows Server SP1 (all platforms) and XP Pro x64. You download and use the latest Microsoft Platform SDK, which contains the advapi32.lib and include files for you to link and use RegGetValue(). Now, you try to run this ISAPI DLL on XP Pro 32bit, which has an older version of advapi32.dll that as documented, does not support RegGetValue(). The end result is error 127 since your ISAPI DLL will be looking for advapi32.dll to provide the RegGetValue() that it needs... which does not exist on XP Pro 32bit.The only way to resolve this is to use an API call that actually exists on the target OS. This is one reason why just because a piece of code compiles does NOT mean it actually works... ;-)
While using the data value to diagnose ISAPI Filter install failures usually works, there is one big caveat you need to know. The ISAPI Filter DLL itself can trigger the exact same event log entry with ANY data value, even for reasons unrelated to what I mention above.