Creating a Typical ISAPI Filter
Once you are familiar with the benefits of ISAPI filters and how to use them, you can create a filter project using the ISAPI Extension Wizard. For more information about starting a new project using wizards, see Creating a Project with a Visual C++ Application Wizard. After the project has been created, you add your custom notification handlers. The steps are described below.
To create your project using the ISAPI Extension Wizard, see Creating an ISAPI Extension Project.
To add your filter processing
- Specify the notifications you want in GetFilterVersion.
dwFlags will already contain the filters for events you specified in the ISAPI Extension Wizard.
- To add a new notification, add the filter flag to dwFlags in CHttpFilter::GetFilterVersion.
- Add the filter function declaration to the .h file.
- Add the filter definition to the .cpp file.
You can remove notification flags and functions as well.
- To implement your filter functions, open the .cpp file and add custom handling for your chosen filter notifications by replacing the
//TODOcomments in the wizard-generated code.
- To add your filter to the registry, specify the full path and the name of your DLL.
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W3SVC/Parameters/FilterDLLs is the registry key where filters are specified. Multiple entries are separated by commas and are loaded in the order specified.
To debug your filter, if running Microsoft Internet Information Services
- See Debugging ISAPI Applications for more information.
To load your filter, or to install a new version, if running Microsoft Internet Information Services
- Shut down the WWW service, copy the new version of your DLL over the old one, and restart the service.