|
|
|
date: 17 May 2006 05:41:15 -0700,
group: microsoft.public.platformsdk.internet.server.isapi-dev
back
Re: Identify Static/Dynamic Pages
Hi Gilad,
You can do this on IIS 6 only. Earlier IIS versions do not support the
HTTP_FILTER_URL_MAP_EX structure below, which is necessary to get script
mapping information in a filter.
To do it, use SF_NOTIFY_URL_MAP. On the first, and only the first, URL_MAP
notification for a given request, you can use the HTTP_FILTER_URL_MAP_EX
structure to determin this.
You need to look at the following members:
dwFlags - If the MD_ACCESS_EXECUTE bit is set, then you look at
pszPhysicalPath and find the file extension. If the file extension is
".exe", ".com", or ".cgi", then the request is for a CGI. If the file
extension is ".dll" or ".isa", then the request is for an ISAPI extension.
pszScriptMapEntry - If this value is a non-empty string, then the request is
script mapped to either an ISAPI or CGI. You can use the file extension
rules above to know which.
Note that it's still possible for some filter to send a response to the
request. There is no practical way to tell if this will happen from with
any code other than the code that does this. This is something of a corner
case, since we explicitly tell people that they should not handle requests
with a filter.
I hope that this helps,
-Wade A. Hilmo,
-Microsoft
"gilad" wrote in message
news:1147933686.606096.56280@y43g2000cwc.googlegroups.com...
> Hi,
> Forgot to write that I'm hoping to get that information in the ISAPI
> filter that I'm using.
>
> Thanks,
> Gilad.
>
date: Sat, 20 May 2006 11:13:13 -0700
author: Wade A. Hilmo [MS]
Re: Identify Static/Dynamic Pages
Hi Gilad,
The rules that I listed in my last post account for all possibilities. Note
that I didn't list all the possible permutations that could be configured,
but they are all accounted for. The only thing that will get you with this
would be the case that I called out where another ISAPI filter sends out the
response in a way that we don't expect.
All dynamic content (except the filter case I mentioned) has to go through
either an ISAPI extension or a CGI. In the case of ASP, the ".asp"
extension is script mapped to an ISAPI extension called
"c:\windows\system32\inetsrv\asp.dll" (or whatever the path is on your
particular machine.)
For ASP pages, you will see the above path to asp.dll in the
pszScriptMapEntry member. Even in the case someone has set up their server
so that .htm files are handled by ASP, you would see the path to
"...\asp.dll". For ASP.NET, you will see some path to
"...\aspnet_isapi.dll". For Perl or Cold Fusion or whatever, you will see
the path to their ISAPI extension.
Thank you,
-Wade A. Hilmo,
-Microsoft
"gilad" wrote in message
news:1148218331.171147.267290@i40g2000cwc.googlegroups.com...
> Hi,
> I understand that pszScriptMapEntry can help identify CGI,ISAPI or
> something else. something else can be asp pages. I want to know if it
> is a static one, i.e. not running other components - simple html file.
>
> Maybe if dwFlags is not MD_ACCESS_EXECUTE its a static page ? or
> MD_ACCESS_EXECUTE is also for asp ?
>
> Thanks,
> Gilad.
>
date: Sun, 21 May 2006 10:58:06 -0700
author: Wade A. Hilmo [MS]
|
|