次の方法で共有


Steps to Create a Typical ISAPI Filter

OverviewHow Do I

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 Visual C++ Wizards that Help You Begin Your Program. 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

  1. In the development environment, choose New from the File menu, and click the Projects tab.

  2. On the Projects tab, click ISAPI Extension Wizard and name your project.

  3. In Step 1 of the ISAPI Extension Wizard, check the option to Generate a Filter object.

  4. Name your CHttpFilter object, and choose whether to link to the MFC DLLs statically or dynamically, then choose the Next button.

    Feature Only in Professional and Enterprise Edition   Static linking to MFC is supported only in Visual C++ Professional and Enterprise Editions. For more information, see .

  5. In Step 2 of the ISAPI Extension Wizard, select a filter notification priority.

    The default notification priority, which is recommended, is Low. Other priority notifications can affect performance and scalability.

  6. Choose which type of connections cause notifications for the filter.

    The filter can receive notifications from a secured port, a nonsecured port, or both. The ISAPI Extension Wizard sets both as the default.

  7. Choose what notifications your filter will process.

    See for a description of the notification flags and for a list of functions you can override.

    The notification filters you choose in the ISAPI Extension Wizard will appear with the default implementation in your project. Choose only the notifications you want your filter to handle. Adding unnecessary notifications will affect the efficiency of your filter.

    You can add or delete notification functions manually in the project source files later.

  8. Click Finish to create the ISAPI extension.

To add your filter processing

  1. Specify the notifications you want in GetFilterVersion.

    dwFlags will already contain the filters for events you specified in the Extension Wizard.

  2. To add a new notification, add the filter flag to dwFlags in .

    • 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.

  3. To Implement your filter functions, open the .cpp file and add custom handling for your chosen filter notifications by replacing the //TODOs in the wizard-generated code.

  4. 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 Server

  • Run INETINFO.EXE with local or remote debugging as described in ISAPI: Debugging

To load your filter, or to install a new version, if running Microsoft Internet Information Server

  • Shut down the WWW service, copy the new version of your DLL over the old one, and restart the service.

See Also   , , Internet: Where Is...