Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

ISAPI Filter Problem in IIS 6.0

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  Cannot browse localhost, but can through IP &..  
Author Message
user1539

External


Since: Mar 22, 2004
Posts: 1



(Msg. 1) Posted: Mon Mar 22, 2004 6:00 am
Post subject: ISAPI Filter Problem in IIS 6.0
Archived from groups: microsoft>public>inetserver>iis (more info?)

Hi, I have an ISAPI Filter DLL which worked just fine on IIS 5.0, and
fails to work on IIS 6.0 (unless I use the 5.0 isolation mode).
From all the documentation I've seen, this should happen only when
registering for the READ_RAW_DATA event, yet my DLL registers does not
register for that evet. The DLL is based on the CHttpFilter class, and
overrides GetFilterVersion & OnUrlMap.
Any ideas?

VL.

 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 2) Posted: Mon Mar 22, 2004 6:26 am
Post subject: Re: ISAPI Filter Problem in IIS 6.0 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Can you describe what is failing in your ISAPI Filter?

FYI: ISAPI questions are better askde in
microsoft.public.platformsdk.internet.server.isapi-dev

You are correct in saying that SF_NOTIFY_READ_RAW_DATA requires IIS5
Isolation Mode. However, I do not believe that it is the only cause of
Filter failure in IIS6 Native Process Mode (can you point me to the
documentation that you're looking at which makes such a statement? ). It
all depends on what the ISAPI Filter is doing. There are many other causes
of filter failure between modes, including:
1. Filter requries Local System.
2. Filter must be singleton
3. Filter assumes process name is "inetinfo.exe"
4. Filter makes incorrect assumptions about filter events
5. Bug in IIS5 or IIS6

Hence, you will either need to debug to figure out why it doesn't work, or
you can describe what you are doing in the filter and what do you think is
failing.

I can tell you that most people make incorrect assumptions about how
OnUrlMap event works, and the only resolution there is to fix your code.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"vlvl" <yariv.zur DeleteThis @eyeblaster.com> wrote in message
news:ed2acae7.0403220300.2a8476d6@posting.google.com...
Hi, I have an ISAPI Filter DLL which worked just fine on IIS 5.0, and
fails to work on IIS 6.0 (unless I use the 5.0 isolation mode).
From all the documentation I've seen, this should happen only when
registering for the READ_RAW_DATA event, yet my DLL registers does not
register for that evet. The DLL is based on the CHttpFilter class, and
overrides GetFilterVersion & OnUrlMap.
Any ideas?

VL.

 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
user1540

External


Since: Mar 22, 2004
Posts: 3



(Msg. 3) Posted: Mon Mar 22, 2004 7:18 am
Post subject: Re: ISAPI Filter Problem in IIS 6.0 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The ISAPI Filter isn't loaded at all when not working in IIS 5.0
Isolation mode. I don't even get into the GetFilterVersion() function
(according to debug printings). As for usage of the local system - the
only usage is reading data from the registry.

The code which executes in the OnUrlMap looks something like this:

DWORD CScriptFilter::OnUrlMap(CHttpFilterContext* pCtxt,
  PHTTP_FILTER_URL_MAP pMapInfo)
{
  //Loop on the list of filters and check if the url match one of the
element in list
  //Get head of list
  POSITION pos;
  pos = m_UrlPathFiltersList.GetHeadPosition();
  CHAR * szTempStringToSearch;
  CHAR * szTempPhysicalPath;
  CHAR szTempURL[DS_SCRIPT_FILTER_MAX_URL_LEN];

  strncpy(szTempURL, pMapInfo->pszURL, DS_SCRIPT_FILTER_MAX_URL_LEN-1);

  while (pos != NULL)
  {
   szTempStringToSearch = (CHAR *)
(m_UrlPathFiltersList.GetAt(pos).szStringToSearch);
   szTempPhysicalPath = (CHAR *)
(m_UrlPathFiltersList.GetNext(pos).szPhysicalPath);

   if (strstr (_strlwr(szTempURL), szTempStringToSearch))
   {
    strncpy(pMapInfo->pszPhysicalPath, szTempPhysicalPath,
pMapInfo->cbPathBuff-1);
   return SF_STATUS_REQ_HANDLED_NOTIFICATION;
   }
  }

  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Where m_UrlPathFiltersList is a CList<> containing strings read from the
registry.



*** Sent via Developersdex <a style='text-decoration: underline;' href="http://www.developersdex.com" target="_blank">http://www.developersdex.com</a> ***
Don't just participate in USENET...get rewarded for it!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
user1540

External


Since: Mar 22, 2004
Posts: 3



(Msg. 4) Posted: Mon Mar 22, 2004 7:48 am
Post subject: Re: ISAPI Filter Problem in IIS 6.0 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The DLL simply doesn't load (it doesn't even get to the
GetFilterVersion() function). The only local system usage is reading
from the registry. The OnURLMap function looks something like this:

DWORD CScriptFilter::OnUrlMap(CHttpFilterContext* pCtxt,
  PHTTP_FILTER_URL_MAP pMapInfo)
{
  //Loop on the list of filters and check if the url match one of the
element in list
  //Get head of list
  POSITION pos;
  pos = m_UrlPathFiltersList.GetHeadPosition();
  CHAR * szTempStringToSearch;
  CHAR * szTempPhysicalPath;
  CHAR szTempURL[DS_SCRIPT_FILTER_MAX_URL_LEN];

  strncpy(szTempURL, pMapInfo->pszURL, DS_SCRIPT_FILTER_MAX_URL_LEN-1);

  while (pos != NULL)
  {
  szTempStringToSearch = (CHAR *)
(m_UrlPathFiltersList.GetAt(pos).szStringToSearch);
  szTempPhysicalPath = (CHAR *)
(m_UrlPathFiltersList.GetNext(pos).szPhysicalPath);

  if (strstr (_strlwr(szTempURL), szTempStringToSearch))
  {
   strncpy(pMapInfo->pszPhysicalPath, szTempPhysicalPath,
pMapInfo->cbPathBuff-1);
   return SF_STATUS_REQ_HANDLED_NOTIFICATION;
  }
  }

  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Where m_UrlPathFiltersList is a CList<> containing strings read from the
registry. Other than that, the only function implemented is the
GetFilterVersion() which does:
[...]

// Clear the flags set by base class
  pVer->dwFlags &= ~SF_NOTIFY_ORDER_MASK;

  // Set the flags we are interested in
  pVer->dwFlags |= SF_NOTIFY_ORDER_LOW | SF_NOTIFY_NONSECURE_PORT |
SF_NOTIFY_URL_MAP;

[...]

Any ideas?

*** Sent via Developersdex <a style='text-decoration: underline;' href="http://www.developersdex.com" target="_blank">http://www.developersdex.com</a> ***
Don't just participate in USENET...get rewarded for it!<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 5) Posted: Tue Mar 23, 2004 2:32 am
Post subject: Re: ISAPI Filter Problem in IIS 6.0 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

If the ISAPI Filter is configured to load but failed to load, there will be
an event log entry saying why (including Win32 error code) and IIS6 will
fail to start (either site or global).

IIS6 loads ISAPI Filters on-demand, so unless you make a request to the
website that triggers the filter to act, the DLL will not be loaded into
memory and GetFilterVersion() will not be called. This is unlike prior IIS
version, where filters are loaded whenever, without needing a request.

Based on the above, I have to ask you:
1. Are you certain that the filter is configured to load in IIS. Basically,
is it in FilterLoadOrder and the filter node and FilterPath property are
configured.
2. Are you certain you made a request to the website that causes the filter
to act (if it's global, the filter loads on first request to any website; if
per-website, the filter loads on first request to that website).
3. If you make a request and the filter is configured to load BUT you do not
see its GetFilterVersion called, that is a contradiction. If you see
GetFilterVersion called but not HttpFilterProc, then the request must have
failed and event log entries made.
4. If you are judging filter state via the UI, depending on how you created
the website containing the filter, the UI may not tell you the right info.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Yariv Zur" <yariv.zur.TakeThisOut@eyeblaster.com> wrote in message
news:uq0nZfAEEHA.1452@TK2MSFTNGP09.phx.gbl...
The ISAPI Filter isn't loaded at all when not working in IIS 5.0
Isolation mode. I don't even get into the GetFilterVersion() function
(according to debug printings). As for usage of the local system - the
only usage is reading data from the registry.

The code which executes in the OnUrlMap looks something like this:

DWORD CScriptFilter::OnUrlMap(CHttpFilterContext* pCtxt,
PHTTP_FILTER_URL_MAP pMapInfo)
{
//Loop on the list of filters and check if the url match one of the
element in list
//Get head of list
POSITION pos;
pos = m_UrlPathFiltersList.GetHeadPosition();
CHAR * szTempStringToSearch;
CHAR * szTempPhysicalPath;
CHAR szTempURL[DS_SCRIPT_FILTER_MAX_URL_LEN];

strncpy(szTempURL, pMapInfo->pszURL, DS_SCRIPT_FILTER_MAX_URL_LEN-1);

while (pos != NULL)
{
szTempStringToSearch = (CHAR *)
(m_UrlPathFiltersList.GetAt(pos).szStringToSearch);
szTempPhysicalPath = (CHAR *)
(m_UrlPathFiltersList.GetNext(pos).szPhysicalPath);

if (strstr (_strlwr(szTempURL), szTempStringToSearch))
{
strncpy(pMapInfo->pszPhysicalPath, szTempPhysicalPath,
pMapInfo->cbPathBuff-1);
return SF_STATUS_REQ_HANDLED_NOTIFICATION;
}
}

return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Where m_UrlPathFiltersList is a CList<> containing strings read from the
registry.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
user1540

External


Since: Mar 22, 2004
Posts: 3



(Msg. 6) Posted: Wed Mar 24, 2004 12:19 pm
Post subject: Re: ISAPI Filter Problem in IIS 6.0 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ok, After going over you're post I retried some stuff and came to the
conclusion that the DLL DOES load, the only problem being that all the
stuff I counted on happening in the constructor just doesn't happen!
The class has three functions -
CScriptFilter::CScriptFilter
CScriptFilter::GetFilterVersion
CScriptFilter::OnUrlMap

It seems that on IIS6.0 only the OnUrlMap function is being called, and
the two former functions are'nt. Does this make any sense?

And, If I may, A follow-up question - I've set the IIS to compresss
static files. In IIS5.0 I could set the order of my ISAPI filter
relative to that of the compression, so that my filter will run BEFORE
the compression. However, in IIS 6.0, the compression doesn't appear as
an ISAPI filter, so I can't set the order. This causes the compression
to occur before the filter. Any ideas on how to change this behaviour?



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 >> Stay informed about: ISAPI Filter Problem in IIS 6.0 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]