Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

ISAPI Filter not working in IIS 6

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  IIS: FrontPage Server Extensions 2002 Error in Check FP Ext  
Author Message
ravi

External


Since: Jul 29, 2004
Posts: 8



(Msg. 1) Posted: Thu Jul 29, 2004 8:49 pm
Post subject: ISAPI Filter not working in IIS 6
Archived from groups: microsoft>public>inetserver>iis (more info?)

Did anything change from IIS5 - IIS 6 in the way these 2 events are processed. SF_NOTIFY_PREPROC_HEADERS and SF_NOTIFY_URL_MAP.

We have a filter for image delivery. Incoming are URL requests for specific image resolutions.
Response is a image that could be on our file system or for a low res image that we generate on the fly based on the original image. If we have the image, we respond with a UNC path. If image doesnt exist, but can be generated, we
REDIRECT with the right params to a executable.
This works perfectly on IIS5/Windows 2000.

However on IIS6/Win2003:
------------------------------
Filter loads fine with green arrow in IIS5 compatible mode. But in the case where it has to redirect, it fails with a 500 error.

In IIS 6 mode, IIS mgr doesnt seem to load the filter, but, behaviour is similar to the IIS5 comptabile mode, where the filter is able to display the image but cannot redirect in case of a low res request.

We are not using any RAW DATA events. So, i dont think we need to run in IIS5 compatible mode. Some sample code:

DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS *pHeaderInfo) {
  // Gets the URL that the user is requesting.
if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
   return SF_STATUS_REQ_ERROR;
  }

  // look for the trigger in the url request
  ParseTokenAndView(url, &tkstr, viewpath);
  PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC, sizeof(PhysMapStruct), 0);
  // if the mappath starts with REDIR:
  if (strncmp(mapPath, "REDIR:", 6) == 0) {
   mapPath += 6;
   pHeaderInfo->SetHeader(pFC, "url", mapPath);

   pmsInfo->physMap = false;

  }
 
  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Please help.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: ISAPI Filter not working in IIS 6 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 2) Posted: Thu Jul 29, 2004 9:42 pm
Post subject: Re: ISAPI Filter not working in IIS 6 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for the summary of your filter's expected behavior.

Please describe what you are doing in SF_NOTIFY_PREPROC_HEADERS and
SF_NOTIFY_URL_MAP events. Nothing in the code you showed seems related to
your current issue.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Ravi" <Ravi RemoveThis @discussions.microsoft.com> wrote in message
news:2F4FB54E-69B4-425D-8EB1-693DDDA8C728@microsoft.com...
Did anything change from IIS5 - IIS 6 in the way these 2 events are
processed. SF_NOTIFY_PREPROC_HEADERS and SF_NOTIFY_URL_MAP.

We have a filter for image delivery. Incoming are URL requests for specific
image resolutions.
Response is a image that could be on our file system or for a low res image
that we generate on the fly based on the original image. If we have the
image, we respond with a UNC path. If image doesnt exist, but can be
generated, we
REDIRECT with the right params to a executable.
This works perfectly on IIS5/Windows 2000.

However on IIS6/Win2003:
------------------------------
Filter loads fine with green arrow in IIS5 compatible mode. But in the case
where it has to redirect, it fails with a 500 error.

In IIS 6 mode, IIS mgr doesnt seem to load the filter, but, behaviour is
similar to the IIS5 comptabile mode, where the filter is able to display the
image but cannot redirect in case of a low res request.

We are not using any RAW DATA events. So, i dont think we need to run in
IIS5 compatible mode. Some sample code:

DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS
*pHeaderInfo) {
// Gets the URL that the user is requesting.
if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
return SF_STATUS_REQ_ERROR;
}

// look for the trigger in the url request
ParseTokenAndView(url, &tkstr, viewpath);
PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC,
sizeof(PhysMapStruct), 0);
// if the mappath starts with REDIR:
if (strncmp(mapPath, "REDIR:", 6) == 0) {
mapPath += 6;
pHeaderInfo->SetHeader(pFC, "url", mapPath);

pmsInfo->physMap = false;

}

return SF_STATUS_REQ_NEXT_NOTIFICATION;
}

Please help.

 >> Stay informed about: ISAPI Filter not working in IIS 6 
Back to top
Login to vote
ravi

External


Since: Jul 29, 2004
Posts: 8



(Msg. 3) Posted: Fri Jul 30, 2004 2:25 pm
Post subject: Re: ISAPI Filter not working in IIS 6 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for quick response..Sorry for not being clear.. This is what we do..

DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pFC, DWORD NotificationType, VOID *pvData) {

  DWORD dwRet;
  long serverPort;
  // sending the notification to the right function
  switch (NotificationType) {
case SF_NOTIFY_PREPROC_HEADERS :
  dwRet = OnPreprocHeaders(pFC, (PHTTP_FILTER_PREPROC_HEADERS)pvData);
   break;
  case SF_NOTIFY_URL_MAP :
   dwRet = OnUrlMap(pFC, (PHTTP_FILTER_URL_MAP) pvData);
  break;
  default :
   dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION;
  }

  return dwRet;
}

DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS *pHeaderInfo) {

  CHAR url[1024];
  DWORD dwUrl = 1024;
  // Gets the URL that the user is requesting.
  if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
   return SF_STATUS_REQ_ERROR;
  }
  // look for the trigger in the url request
  if (strncmp(url, TRIGGER, strlen(TRIGGER)) != 0) {
   return SF_STATUS_REQ_NEXT_NOTIFICATION;
  }

  //should check length of token here to limit denial of service attack

  _bstr_t tkstr;
  CHAR viewpath[24];
  ParseTokenAndView(url, &tkstr, viewpath);
  char mapPathArray[1024];
  char *mapPath = mapPathArray;
  // do a LILookupToken here
  if (! LookupToken(mapPath, tkstr, viewpath) ) {
   return SF_STATUS_REQ_ERROR;
  }

  PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC, sizeof(PhysMapStruct), 0);
  // if the mappath starts with REDIR:
  if (strncmp(mapPath, "REDIR:", 6) == 0) {
   mapPath += 6;
   pHeaderInfo->SetHeader(pFC, "url", mapPath);
   pmsInfo->physMap = false;
  }
  else {
   pmsInfo->physUrl = (char *) pFC->AllocMem(pFC, strlen(mapPath) + 1, 0);
   strcpy(pmsInfo->physUrl, mapPath);
   pmsInfo->physMap = true;
  }
  pFC->pFilterContext = (VOID *) pmsInfo;

  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}


DWORD OnUrlMap(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_URL_MAP *pUrlMapInfo) {

  // check if the url has /rs/ in it
  if (strncmp(pUrlMapInfo->pszURL, TRIGGER, strlen(TRIGGER)) != 0) {
   return SF_STATUS_REQ_NEXT_NOTIFICATION;
  }

  if (pFC->pFilterContext != NULL) {
   PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->pFilterContext;

   if (pmsInfo->physMap) {
    strcpy(pUrlMapInfo->pszPhysicalPath, pmsInfo->physUrl);
    pFC->pFilterContext = NULL;
    return SF_STATUS_REQ_NEXT_NOTIFICATION;
   }
  
   pFC->pFilterContext = NULL;
  }


  _bstr_t tkstr;
  CHAR viewpath[24];
  ParseTokenAndView(pUrlMapInfo->pszURL, &tkstr, viewpath);
  char mapPathArray[1024];
  char *mapPath = mapPathArray;
  if (! LookupToken(mapPath, tkstr, viewpath) ) {
   return SF_STATUS_REQ_ERROR;
  }
  strcpy(pUrlMapInfo->pszPhysicalPath, mapPath);
  return SF_STATUS_REQ_NEXT_NOTIFICATION;
}



"David Wang [Msft]" wrote:

 > Thanks for the summary of your filter's expected behavior.
 >
 > Please describe what you are doing in SF_NOTIFY_PREPROC_HEADERS and
 > SF_NOTIFY_URL_MAP events. Nothing in the code you showed seems related to
 > your current issue.
 >
 > --
 > //David
 > IIS
 > This posting is provided "AS IS" with no warranties, and confers no rights.
 > //
 > "Ravi" <Ravi.TakeThisOut@discussions.microsoft.com> wrote in message
 > news:2F4FB54E-69B4-425D-8EB1-693DDDA8C728@microsoft.com...
 > Did anything change from IIS5 - IIS 6 in the way these 2 events are
 > processed. SF_NOTIFY_PREPROC_HEADERS and SF_NOTIFY_URL_MAP.
 >
 > We have a filter for image delivery. Incoming are URL requests for specific
 > image resolutions.
 > Response is a image that could be on our file system or for a low res image
 > that we generate on the fly based on the original image. If we have the
 > image, we respond with a UNC path. If image doesnt exist, but can be
 > generated, we
 > REDIRECT with the right params to a executable.
 > This works perfectly on IIS5/Windows 2000.
 >
 > However on IIS6/Win2003:
 > ------------------------------
 > Filter loads fine with green arrow in IIS5 compatible mode. But in the case
 > where it has to redirect, it fails with a 500 error.
 >
 > In IIS 6 mode, IIS mgr doesnt seem to load the filter, but, behaviour is
 > similar to the IIS5 comptabile mode, where the filter is able to display the
 > image but cannot redirect in case of a low res request.
 >
 > We are not using any RAW DATA events. So, i dont think we need to run in
 > IIS5 compatible mode. Some sample code:
 >
 > DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS
 > *pHeaderInfo) {
 > // Gets the URL that the user is requesting.
 > if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
 > return SF_STATUS_REQ_ERROR;
 > }
 >
 > // look for the trigger in the url request
 > ParseTokenAndView(url, &tkstr, viewpath);
 > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC,
 > sizeof(PhysMapStruct), 0);
 > // if the mappath starts with REDIR:
 > if (strncmp(mapPath, "REDIR:", 6) == 0) {
 > mapPath += 6;
 > pHeaderInfo->SetHeader(pFC, "url", mapPath);
 >
 > pmsInfo->physMap = false;
 >
 > }
 >
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 > Please help.
 >
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: ISAPI Filter not working in IIS 6 
Back to top
Login to vote
ravi

External


Since: Jul 29, 2004
Posts: 8



(Msg. 4) Posted: Mon Aug 02, 2004 7:19 pm
Post subject: Re: ISAPI Filter not working in IIS 6 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

We found the problem. We had wrong Mappings for the Application Extensions. Mappings were pointing to the .NET framework under C:\WinNT rather than C:\WIndows. Everything now works, but from IIS Manager, the status of the filter is shown as "unknown". If I change to IIS 5 compatible mode, filter loads with green arrow. But I dont want to take the performance hit for using IIS 6 with the IIS 5 compatible mode.

Looking at the code below, can u tell me if I should change anything to display the filter as loaded in the IIS 6.0 mode?

"Ravi" wrote:

 > Thanks for quick response..Sorry for not being clear.. This is what we do..
 >
 > DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pFC, DWORD NotificationType, VOID *pvData) {
 >
  > DWORD dwRet;
  > long serverPort;
  > // sending the notification to the right function
  > switch (NotificationType) {
 > case SF_NOTIFY_PREPROC_HEADERS :
  > dwRet = OnPreprocHeaders(pFC, (PHTTP_FILTER_PREPROC_HEADERS)pvData);
   > break;
  > case SF_NOTIFY_URL_MAP :
   > dwRet = OnUrlMap(pFC, (PHTTP_FILTER_URL_MAP) pvData);
  > break;
  > default :
   > dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION;
  > }
 >
  > return dwRet;
 > }
 >
 > DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS *pHeaderInfo) {
 >
  > CHAR url[1024];
  > DWORD dwUrl = 1024;
  > // Gets the URL that the user is requesting.
  > if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
   > return SF_STATUS_REQ_ERROR;
  > }
  > // look for the trigger in the url request
  > if (strncmp(url, TRIGGER, strlen(TRIGGER)) != 0) {
   > return SF_STATUS_REQ_NEXT_NOTIFICATION;
  > }
 >
  > //should check length of token here to limit denial of service attack
 >
  > _bstr_t tkstr;
  > CHAR viewpath[24];
  > ParseTokenAndView(url, &tkstr, viewpath);
  > char mapPathArray[1024];
  > char *mapPath = mapPathArray;
  > // do a LILookupToken here
  > if (! LookupToken(mapPath, tkstr, viewpath) ) {
   > return SF_STATUS_REQ_ERROR;
  > }
 >
  > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC, sizeof(PhysMapStruct), 0);
  > // if the mappath starts with REDIR:
  > if (strncmp(mapPath, "REDIR:", 6) == 0) {
   > mapPath += 6;
   > pHeaderInfo->SetHeader(pFC, "url", mapPath);
   > pmsInfo->physMap = false;
  > }
  > else {
   > pmsInfo->physUrl = (char *) pFC->AllocMem(pFC, strlen(mapPath) + 1, 0);
   > strcpy(pmsInfo->physUrl, mapPath);
   > pmsInfo->physMap = true;
  > }
  > pFC->pFilterContext = (VOID *) pmsInfo;
 >
  > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 >
 > DWORD OnUrlMap(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_URL_MAP *pUrlMapInfo) {
 >
  > // check if the url has /rs/ in it
  > if (strncmp(pUrlMapInfo->pszURL, TRIGGER, strlen(TRIGGER)) != 0) {
   > return SF_STATUS_REQ_NEXT_NOTIFICATION;
  > }
 >
  > if (pFC->pFilterContext != NULL) {
   > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->pFilterContext;
 >
   > if (pmsInfo->physMap) {
   > strcpy(pUrlMapInfo->pszPhysicalPath, pmsInfo->physUrl);
   > pFC->pFilterContext = NULL;
   > return SF_STATUS_REQ_NEXT_NOTIFICATION;
   > }
   >
   > pFC->pFilterContext = NULL;
  > }
 >
 >
  > _bstr_t tkstr;
  > CHAR viewpath[24];
  > ParseTokenAndView(pUrlMapInfo->pszURL, &tkstr, viewpath);
  > char mapPathArray[1024];
  > char *mapPath = mapPathArray;
  > if (! LookupToken(mapPath, tkstr, viewpath) ) {
   > return SF_STATUS_REQ_ERROR;
  > }
  > strcpy(pUrlMapInfo->pszPhysicalPath, mapPath);
  > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 >
 >
 > "David Wang [Msft]" wrote:
 >
  > > Thanks for the summary of your filter's expected behavior.
  > >
  > > Please describe what you are doing in SF_NOTIFY_PREPROC_HEADERS and
  > > SF_NOTIFY_URL_MAP events. Nothing in the code you showed seems related to
  > > your current issue.
  > >
  > > --
  > > //David
  > > IIS
  > > This posting is provided "AS IS" with no warranties, and confers no rights.
  > > //
  > > "Ravi" <Ravi.DeleteThis@discussions.microsoft.com> wrote in message
  > > news:2F4FB54E-69B4-425D-8EB1-693DDDA8C728@microsoft.com...
  > > Did anything change from IIS5 - IIS 6 in the way these 2 events are
  > > processed. SF_NOTIFY_PREPROC_HEADERS and SF_NOTIFY_URL_MAP.
  > >
  > > We have a filter for image delivery. Incoming are URL requests for specific
  > > image resolutions.
  > > Response is a image that could be on our file system or for a low res image
  > > that we generate on the fly based on the original image. If we have the
  > > image, we respond with a UNC path. If image doesnt exist, but can be
  > > generated, we
  > > REDIRECT with the right params to a executable.
  > > This works perfectly on IIS5/Windows 2000.
  > >
  > > However on IIS6/Win2003:
  > > ------------------------------
  > > Filter loads fine with green arrow in IIS5 compatible mode. But in the case
  > > where it has to redirect, it fails with a 500 error.
  > >
  > > In IIS 6 mode, IIS mgr doesnt seem to load the filter, but, behaviour is
  > > similar to the IIS5 comptabile mode, where the filter is able to display the
  > > image but cannot redirect in case of a low res request.
  > >
  > > We are not using any RAW DATA events. So, i dont think we need to run in
  > > IIS5 compatible mode. Some sample code:
  > >
  > > DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_PREPROC_HEADERS
  > > *pHeaderInfo) {
  > > // Gets the URL that the user is requesting.
  > > if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
  > > return SF_STATUS_REQ_ERROR;
  > > }
  > >
  > > // look for the trigger in the url request
  > > ParseTokenAndView(url, &tkstr, viewpath);
  > > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC,
  > > sizeof(PhysMapStruct), 0);
  > > // if the mappath starts with REDIR:
  > > if (strncmp(mapPath, "REDIR:", 6) == 0) {
  > > mapPath += 6;
  > > pHeaderInfo->SetHeader(pFC, "url", mapPath);
  > >
  > > pmsInfo->physMap = false;
  > >
  > > }
  > >
  > > return SF_STATUS_REQ_NEXT_NOTIFICATION;
  > > }
  > >
  > > Please help.
  > >
  > >
  > ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: ISAPI Filter not working in IIS 6 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 5) Posted: Tue Aug 03, 2004 3:03 am
Post subject: Re: ISAPI Filter not working in IIS 6 [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Can you clarify what exactly is not working now?

To debug filters not loading -- if the filter never loaded, IIS will make
event log entries saying what filter DLL failed to load and why. Please
check that first.

If the filter loaded following a request but the UI doesn't display it, then
it is possible that you custom-created websites manually, which would lack
the metabase ACL such that the green arrow won't show (but filter is still
working).

Unlike IIS5, ISAPI Filters load on-demand on IIS6, so filter will not show
up with a green arrow until you've made a request to the server/website to
trigger the filter to load.

In other words the green arrow of the filter UI on IIS6 cannot correctly
indicate whether a filter is "loaded and working".

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Ravi" <Ravi.RemoveThis@discussions.microsoft.com> wrote in message
news:D09C903C-C879-453F-A0FA-DDA2AFE22A76@microsoft.com...
We found the problem. We had wrong Mappings for the Application Extensions.
Mappings were pointing to the .NET framework under C:\WinNT rather than
C:\WIndows. Everything now works, but from IIS Manager, the status of the
filter is shown as "unknown". If I change to IIS 5 compatible mode, filter
loads with green arrow. But I dont want to take the performance hit for
using IIS 6 with the IIS 5 compatible mode.

Looking at the code below, can u tell me if I should change anything to
display the filter as loaded in the IIS 6.0 mode?

"Ravi" wrote:

 > Thanks for quick response..Sorry for not being clear.. This is what we
do..
 >
 > DWORD WINAPI HttpFilterProc(HTTP_FILTER_CONTEXT *pFC, DWORD
NotificationType, VOID *pvData) {
 >
 > DWORD dwRet;
 > long serverPort;
 > // sending the notification to the right function
 > switch (NotificationType) {
 > case SF_NOTIFY_PREPROC_HEADERS :
 > dwRet = OnPreprocHeaders(pFC, (PHTTP_FILTER_PREPROC_HEADERS)pvData);
 > break;
 > case SF_NOTIFY_URL_MAP :
 > dwRet = OnUrlMap(pFC, (PHTTP_FILTER_URL_MAP) pvData);
 > break;
 > default :
 > dwRet = SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 > return dwRet;
 > }
 >
 > DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC,
HTTP_FILTER_PREPROC_HEADERS *pHeaderInfo) {
 >
 > CHAR url[1024];
 > DWORD dwUrl = 1024;
 > // Gets the URL that the user is requesting.
 > if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
 > return SF_STATUS_REQ_ERROR;
 > }
 > // look for the trigger in the url request
 > if (strncmp(url, TRIGGER, strlen(TRIGGER)) != 0) {
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 > //should check length of token here to limit denial of service attack
 >
 > _bstr_t tkstr;
 > CHAR viewpath[24];
 > ParseTokenAndView(url, &tkstr, viewpath);
 > char mapPathArray[1024];
 > char *mapPath = mapPathArray;
 > // do a LILookupToken here
 > if (! LookupToken(mapPath, tkstr, viewpath) ) {
 > return SF_STATUS_REQ_ERROR;
 > }
 >
 > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC,
sizeof(PhysMapStruct), 0);
 > // if the mappath starts with REDIR:
 > if (strncmp(mapPath, "REDIR:", 6) == 0) {
 > mapPath += 6;
 > pHeaderInfo->SetHeader(pFC, "url", mapPath);
 > pmsInfo->physMap = false;
 > }
 > else {
 > pmsInfo->physUrl = (char *) pFC->AllocMem(pFC, strlen(mapPath) + 1, 0);
 > strcpy(pmsInfo->physUrl, mapPath);
 > pmsInfo->physMap = true;
 > }
 > pFC->pFilterContext = (VOID *) pmsInfo;
 >
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 >
 > DWORD OnUrlMap(HTTP_FILTER_CONTEXT *pFC, HTTP_FILTER_URL_MAP *pUrlMapInfo)
{
 >
 > // check if the url has /rs/ in it
 > if (strncmp(pUrlMapInfo->pszURL, TRIGGER, strlen(TRIGGER)) != 0) {
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 > if (pFC->pFilterContext != NULL) {
 > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->pFilterContext;
 >
 > if (pmsInfo->physMap) {
 > strcpy(pUrlMapInfo->pszPhysicalPath, pmsInfo->physUrl);
 > pFC->pFilterContext = NULL;
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 > pFC->pFilterContext = NULL;
 > }
 >
 >
 > _bstr_t tkstr;
 > CHAR viewpath[24];
 > ParseTokenAndView(pUrlMapInfo->pszURL, &tkstr, viewpath);
 > char mapPathArray[1024];
 > char *mapPath = mapPathArray;
 > if (! LookupToken(mapPath, tkstr, viewpath) ) {
 > return SF_STATUS_REQ_ERROR;
 > }
 > strcpy(pUrlMapInfo->pszPhysicalPath, mapPath);
 > return SF_STATUS_REQ_NEXT_NOTIFICATION;
 > }
 >
 >
 >
 > "David Wang [Msft]" wrote:
 >
  > > Thanks for the summary of your filter's expected behavior.
  > >
  > > Please describe what you are doing in SF_NOTIFY_PREPROC_HEADERS and
  > > SF_NOTIFY_URL_MAP events. Nothing in the code you showed seems related
to
  > > your current issue.
  > >
  > > --
  > > //David
  > > IIS
  > > This posting is provided "AS IS" with no warranties, and confers no
rights.
  > > //
  > > "Ravi" <Ravi.RemoveThis@discussions.microsoft.com> wrote in message
  > > news:2F4FB54E-69B4-425D-8EB1-693DDDA8C728@microsoft.com...
  > > Did anything change from IIS5 - IIS 6 in the way these 2 events are
  > > processed. SF_NOTIFY_PREPROC_HEADERS and SF_NOTIFY_URL_MAP.
  > >
  > > We have a filter for image delivery. Incoming are URL requests for
specific
  > > image resolutions.
  > > Response is a image that could be on our file system or for a low res
image
  > > that we generate on the fly based on the original image. If we have the
  > > image, we respond with a UNC path. If image doesnt exist, but can be
  > > generated, we
  > > REDIRECT with the right params to a executable.
  > > This works perfectly on IIS5/Windows 2000.
  > >
  > > However on IIS6/Win2003:
  > > ------------------------------
  > > Filter loads fine with green arrow in IIS5 compatible mode. But in the
case
  > > where it has to redirect, it fails with a 500 error.
  > >
  > > In IIS 6 mode, IIS mgr doesnt seem to load the filter, but, behaviour is
  > > similar to the IIS5 comptabile mode, where the filter is able to display
the
  > > image but cannot redirect in case of a low res request.
  > >
  > > We are not using any RAW DATA events. So, i dont think we need to run in
  > > IIS5 compatible mode. Some sample code:
  > >
  > > DWORD OnPreprocHeaders(HTTP_FILTER_CONTEXT *pFC,
HTTP_FILTER_PREPROC_HEADERS
  > > *pHeaderInfo) {
  > > // Gets the URL that the user is requesting.
  > > if (!pHeaderInfo->GetHeader(pFC, "url", url, &dwUrl)) {
  > > return SF_STATUS_REQ_ERROR;
  > > }
  > >
  > > // look for the trigger in the url request
  > > ParseTokenAndView(url, &tkstr, viewpath);
  > > PhysMapStruct *pmsInfo = (PhysMapStruct *) pFC->AllocMem(pFC,
  > > sizeof(PhysMapStruct), 0);
  > > // if the mappath starts with REDIR:
  > > if (strncmp(mapPath, "REDIR:", 6) == 0) {
  > > mapPath += 6;
  > > pHeaderInfo->SetHeader(pFC, "url", mapPath);
  > >
  > > pmsInfo->physMap = false;
  > >
  > > }
  > >
  > > return SF_STATUS_REQ_NEXT_NOTIFICATION;
  > > }
  > >
  > > Please help.
  > >
  > >
  > ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: ISAPI Filter not working in IIS 6 
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 ]