Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have written a demo ISAPI filter :

C++
# include <windows.h> 
# include "httpfilt.h"

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{
	switch (ul_reason_for_call)
	{
	case DLL_PROCESS_ATTACH:
	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
	case DLL_PROCESS_DETACH:
		break;
	}
	return TRUE;

	
}


/*
	GetFilterVersion - An ISAPI/Win32 API method
	This method is required by IIS.  It is called 
	following the process load to ensure that the 
	filter is compatable with the server.
*/

BOOL WINAPI GetFilterVersion ( HTTP_FILTER_VERSION *pVer )
{
	pVer->dwFilterVersion = HTTP_FILTER_REVISION;
	strncpy( pVer->lpszFilterDesc, "D3 Filter", SF_MAX_FILTER_DESC_LEN );
	pVer->dwFlags = SF_NOTIFY_PREPROC_HEADERS| SF_NOTIFY_SECURE_PORT| SF_NOTIFY_NONSECURE_PORT;
	return TRUE;
}


/*
	HttpFilterProc - ISAPI / Win32 API method
	This method is a required by IIS.  It is called
	for each notification event requested.  This is
	where the filter accomplishes its purpose in life.
*/
DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pfc, DWORD NotificationType, VOID * pvData)
{
    DWORD dwRet;
    /*
		Direct the notification to the appropriate
		routine for processing.
    */
    switch ( NotificationType )
    {
    case SF_NOTIFY_LOG:
       // dwRet = OnLog(pfc, (PHTTP_FILTER_LOG) pvData );
        break;
    default:

        break;
    }
    return dwRet;
}</windows.h>


there is also a .def file associated with it :

C++
LIBRARY	    T1
DESCRIPTION  'D3 Filter'

EXPORTS
    HttpFilterProc
    GetFilterVersion



Then, to install this filter i went to inetmgr and followed the relevant steps. But I when i click 'Apply' I get a msgbox saying "RPC Server Unavailable". So I started the RPC and RPC locator from services.msc ... but still i am getting the same message. Why is this happening ? How to fix this ?
Posted
Updated 30-Aug-11 17:40pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900