I'm new in IIS7 and web. Recently, I write an ISAPI wildcard, and when I test them(extention and filter) with Inputing into the file, all the NOTIFY of the filter are executed, while the extension's entry function HttpExtensionProc() can not capture the interrupt when I debugging them.
This is my testing code:
BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
{
pVer->dwExtensionVersion=MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
lstrcpy((LPWSTR)pVer->lpszExtensionDesc, (LPCWSTR)"ExecUrl Test Sample");
return TRUE;
}
DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pecb)
{
fstream file("D:\\Output.txt", ios::app);
file <<lpszFilterDesc, "ISAPIWildcardFilter");
pVer->dwFlags |= SF_NOTIFY_ORDER_HIGH | SF_NOTIFY_SEND_RESPONSE
| SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_AUTHENTICATION | SF_NOTIFY_ACCESS_DENIED
| SF_NOTIFY_URL_MAP | SF_NOTIFY_SEND_RAW_DATA | SF_NOTIFY_LOG | SF_NOTIFY_END_OF_NET_SESSION;
return TRUE;
}
DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pfc,DWORD dwNotificationType,VOID *pvNotification)
{
switch ( dwNotificationType )
{
case SF_NOTIFY_PREPROC_HEADERS:
return OnPreprocHeaders(pfc, (PHTTP_FILTER_PREPROC_HEADERS)pvNotification);
break;
...
...
case SF_NOTIFY_LOG:
return OnLog(pfc, (PHTTP_FILTER_LOG)pvNotification);
break;
}
return TRUE;
}
At the first request, as the page's main URL, there was no "ISAPIEx" but all the NOTIFY. And when those .js or .css or .img came, I could see "ISAPIEx" in the file.
Is that mean my ISAPI extension does not run? because all the data I want is in the first request from client.
How should I do?
↧