This article shows how you can use the
SF_NOTIFY_SEND_RESPONSE notification that is not available if you use the MFC ISAPI Filter App-Wizard. With this sample, you are able to use the function
OnSendResponse to modify the header and data of each HTTP response before the IIS sends it back to the client's browser.
GetFilterVersion, we register the
SF_NOTIFY_SEND_RESPONSE flag. Then, we wait in the overwritten
HttpFilterProc for the
SF_NOTIFY_SEND_RESPONSE notification and call our own
OnSendResponse routine. In all other cases, we call the standard
Using the code
What we can do with the
OnSendResponse routine is to modify the realm.
Keep it simple. There are two GUI front-ends to configure this filter. The first is called regedit.exe and the second is called regedt32.exe, you will found it on your server ;o). Create two subkeys under HKEY_LOCAL_MACHINE\SOFTWARE\ called "LEAN Software Production\IISModifyRealm", and under this, a String value Realm; the Value data will be the realm.
- Copy the IISModifyRealm.dll file to the %WINDIR%\System32\inetsrv directory.
- Make sure the System account has execute rights on the filter DLL file.
- Start "Internet Information Services" from the Control Panel\Administrative Tools, and open the Properties of your Default Web Site.
- Click the ISAPI Filter Tab and Add the Filter by typing a name and the full path to the Filter DLL (%WINDIR%\System32\inetsrv\IISModifyRealm.dll).
- Restart the WWW service.
if((this == "nice") || (this == "great"))
pReponse->SetHeader(pfc, (char*) _T("great-stuff:"), (char*) _T("true"));
Please rate this article for me! You found the rating down right.
Version: 184.108.40.206 - prepared for uploading.