Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 7 Sep 2007 12:31:18 +0100,    group: microsoft.public.platformsdk.internet.server.isapi-dev        back       


first isapi filter   
Hello, I followed the instructions on the link below to create an isapi 
filter.
http://www.codeproject.com/isapi/isapiredirector.asp

I changed the code so that a default gif is served for all gif requests.
/==========================================================
DWORD CGetgifFilter::OnPreprocHeaders(CHttpFilterContext* pCtxt,
 PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
{
 // TODO: React to this notification accordingly
     char buffer[256];
    DWORD buffSize = sizeof(buffer);
    BOOL bHeader = pHeaderInfo->GetHeader(pCtxt->m_pFC, "url", buffer, 
&buffSize);
    CString urlString(buffer);
    urlString.MakeLower(); // for this exercise
    if (urlString.Find(".gif") != -1) //we want to redirect this file
    {
        urlString.Replace(urlString,"/getgif.gif");
        char *newUrlString= urlString.GetBuffer(urlString.GetLength());
        pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", newUrlString);
        return SF_STATUS_REQ_HANDLED_NOTIFICATION;
    }
 // return the appropriate status code
 return SF_STATUS_REQ_NEXT_NOTIFICATION;
}
==========================================================/

Do I need to register this? It fails when I try to with regsvr32, saying 
"DllRegisterServer entry point was not found."

I added the isapi in iis, but it's not working.
Thanks Soc.
date: Fri, 7 Sep 2007 12:31:18 +0100   author:   SOC

Re: first isapi filter   
Moving this dll to C:\WINDOWS\system32\inetsrv from C:\WINDOWS\system32 
appears to have solved this problem.

Thanks Soc.


"SOC"  wrote in message 
news:%23HlzhKU8HHA.464@TK2MSFTNGP02.phx.gbl...
> Hello, I followed the instructions on the link below to create an isapi 
> filter.
> http://www.codeproject.com/isapi/isapiredirector.asp
>
> I changed the code so that a default gif is served for all gif requests.
> /==========================================================
> DWORD CGetgifFilter::OnPreprocHeaders(CHttpFilterContext* pCtxt,
> PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
> {
> // TODO: React to this notification accordingly
>     char buffer[256];
>    DWORD buffSize = sizeof(buffer);
>    BOOL bHeader = pHeaderInfo->GetHeader(pCtxt->m_pFC, "url", buffer, 
> &buffSize);
>    CString urlString(buffer);
>    urlString.MakeLower(); // for this exercise
>    if (urlString.Find(".gif") != -1) //we want to redirect this file
>    {
>        urlString.Replace(urlString,"/getgif.gif");
>        char *newUrlString= urlString.GetBuffer(urlString.GetLength());
>        pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", newUrlString);
>        return SF_STATUS_REQ_HANDLED_NOTIFICATION;
>    }
> // return the appropriate status code
> return SF_STATUS_REQ_NEXT_NOTIFICATION;
> }
> ==========================================================/
>
> Do I need to register this? It fails when I try to with regsvr32, saying 
> "DllRegisterServer entry point was not found."
>
> I added the isapi in iis, but it's not working.
> Thanks Soc.
>
>
>
>
>
date: Fri, 7 Sep 2007 12:42:12 +0100   author:   SOC

Re: first isapi filter   
Hello,
The log files do not show the initial request, but the default gif instead. 
Can this be changed?
Thanks Soc.
"SOC"  wrote in message 
news:eA5RoQU8HHA.2004@TK2MSFTNGP06.phx.gbl...
> Moving this dll to C:\WINDOWS\system32\inetsrv from C:\WINDOWS\system32 
> appears to have solved this problem.
>
> Thanks Soc.
>
>
> "SOC"  wrote in message 
> news:%23HlzhKU8HHA.464@TK2MSFTNGP02.phx.gbl...
>> Hello, I followed the instructions on the link below to create an isapi 
>> filter.
>> http://www.codeproject.com/isapi/isapiredirector.asp
>>
>> I changed the code so that a default gif is served for all gif requests.
>> /==========================================================
>> DWORD CGetgifFilter::OnPreprocHeaders(CHttpFilterContext* pCtxt,
>> PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
>> {
>> // TODO: React to this notification accordingly
>>     char buffer[256];
>>    DWORD buffSize = sizeof(buffer);
>>    BOOL bHeader = pHeaderInfo->GetHeader(pCtxt->m_pFC, "url", buffer, 
>> &buffSize);
>>    CString urlString(buffer);
>>    urlString.MakeLower(); // for this exercise
>>    if (urlString.Find(".gif") != -1) //we want to redirect this file
>>    {
>>        urlString.Replace(urlString,"/getgif.gif");
>>        char *newUrlString= urlString.GetBuffer(urlString.GetLength());
>>        pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", newUrlString);
>>        return SF_STATUS_REQ_HANDLED_NOTIFICATION;
>>    }
>> // return the appropriate status code
>> return SF_STATUS_REQ_NEXT_NOTIFICATION;
>> }
>> ==========================================================/
>>
>> Do I need to register this? It fails when I try to with regsvr32, saying 
>> "DllRegisterServer entry point was not found."
>>
>> I added the isapi in iis, but it's not working.
>> Thanks Soc.
>>
>>
>>
>>
>>
>
>
date: Fri, 7 Sep 2007 14:31:41 +0100   author:   SOC

Re: first isapi filter   
SOC,

If you're new to ISAPI Filters for IIS 5.x and IIS 6.0 and C/C++ but
well acquainted with .NET 2.0 then I would advise you to explore the
new open source Filter.NET framework to build managed filters. With
managed filters you take advantage of .NET and you are still able to
extend IIS.

The framework is available at:
http://www.codeplex.com/filterdotnet

As for the answer to your question, as soon as you change the URL
received by IIS in the PreProcHeaders event, that URL will be the one
processed throught the IIS pipeline and therefore written in the log
file. There is no "original" url here, because the ISAPI Filter
changed the URL.

Tiago Halm
date: Fri, 07 Sep 2007 07:13:08 -0700   author:   unknown

Re: first isapi filter   
Thanks Tiago,
I've got it doing what I want now using the line

urlString="/getgif.gif?"+urlString;

Soc.

 wrote in message 
news:1189174388.991492.86240@o80g2000hse.googlegroups.com...
> SOC,
>
> If you're new to ISAPI Filters for IIS 5.x and IIS 6.0 and C/C++ but
> well acquainted with .NET 2.0 then I would advise you to explore the
> new open source Filter.NET framework to build managed filters. With
> managed filters you take advantage of .NET and you are still able to
> extend IIS.
>
> The framework is available at:
> http://www.codeplex.com/filterdotnet
>
> As for the answer to your question, as soon as you change the URL
> received by IIS in the PreProcHeaders event, that URL will be the one
> processed throught the IIS pipeline and therefore written in the log
> file. There is no "original" url here, because the ISAPI Filter
> changed the URL.
>
> Tiago Halm
>
date: Fri, 7 Sep 2007 15:57:36 +0100   author:   SOC

Re: first isapi filter   
You subscribe to the SF_NOTIFY_LOG event to control what gets logged.
You hardly want to use: urlString="/getgif.gif?"+urlString;   - there
are better ways to preserve that information by using pFilterContext
off of the HTTP_FILTER_CONTEXT object.

FYI: that sample code you found is not very illustrative nor secure.
It's pretty bad, actually.


//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//



On Sep 7, 6:31 am, "SOC"  wrote:
> Hello,
> The log files do not show the initial request, but the default gif instead.
> Can this be changed?
> Thanks Soc."SOC"  wrote in message
>
> news:eA5RoQU8HHA.2004@TK2MSFTNGP06.phx.gbl...
>
>
>
> > Moving this dll to C:\WINDOWS\system32\inetsrv from C:\WINDOWS\system32
> > appears to have solved this problem.
>
> > Thanks Soc.
>
> > "SOC"  wrote in message
> >news:%23HlzhKU8HHA.464@TK2MSFTNGP02.phx.gbl...
> >> Hello, I followed the instructions on the link below to create an isapi
> >> filter.
> >>http://www.codeproject.com/isapi/isapiredirector.asp
>
> >> I changed the code so that a default gif is served for all gif requests.
> >> /==========================================================
> >> DWORD CGetgifFilter::OnPreprocHeaders(CHttpFilterContext* pCtxt,
> >> PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
> >> {
> >> // TODO: React to this notification accordingly
> >>     char buffer[256];
> >>    DWORD buffSize = sizeof(buffer);
> >>    BOOL bHeader = pHeaderInfo->GetHeader(pCtxt->m_pFC, "url", buffer,
> >> &buffSize);
> >>    CString urlString(buffer);
> >>    urlString.MakeLower(); // for this exercise
> >>    if (urlString.Find(".gif") != -1) //we want to redirect this file
> >>    {
> >>        urlString.Replace(urlString,"/getgif.gif");
> >>        char *newUrlString= urlString.GetBuffer(urlString.GetLength());
> >>        pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", newUrlString);
> >>        return SF_STATUS_REQ_HANDLED_NOTIFICATION;
> >>    }
> >> // return the appropriate status code
> >> return SF_STATUS_REQ_NEXT_NOTIFICATION;
> >> }
> >> ==========================================================/
>
> >> Do I need to register this? It fails when I try to with regsvr32, saying
> >> "DllRegisterServer entry point was not found."
>
> >> I added the isapi in iis, but it's not working.
> >> Thanks Soc.- Hide quoted text -
>
> - Show quoted text -
date: Sat, 08 Sep 2007 06:50:49 -0000   author:   David Wang

Re: first isapi filter   
Thanks David.
I'm not really a programmer so I was just pleased to get it working.
However it's worrying that you say it's not secure.

Soc


"David Wang"  wrote in message 
news:1189234249.924372.278110@r29g2000hsg.googlegroups.com...
> You subscribe to the SF_NOTIFY_LOG event to control what gets logged.
> You hardly want to use: urlString="/getgif.gif?"+urlString;   - there
> are better ways to preserve that information by using pFilterContext
> off of the HTTP_FILTER_CONTEXT object.
>
> FYI: that sample code you found is not very illustrative nor secure.
> It's pretty bad, actually.
>
>
> //David
> http://w3-4u.blogspot.com
> http://blogs.msdn.com/David.Wang
> //
>
>
>
> On Sep 7, 6:31 am, "SOC"  wrote:
>> Hello,
>> The log files do not show the initial request, but the default gif 
>> instead.
>> Can this be changed?
>> Thanks Soc."SOC"  wrote in message
>>
>> news:eA5RoQU8HHA.2004@TK2MSFTNGP06.phx.gbl...
>>
>>
>>
>> > Moving this dll to C:\WINDOWS\system32\inetsrv from C:\WINDOWS\system32
>> > appears to have solved this problem.
>>
>> > Thanks Soc.
>>
>> > "SOC"  wrote in message
>> >news:%23HlzhKU8HHA.464@TK2MSFTNGP02.phx.gbl...
>> >> Hello, I followed the instructions on the link below to create an 
>> >> isapi
>> >> filter.
>> >>http://www.codeproject.com/isapi/isapiredirector.asp
>>
>> >> I changed the code so that a default gif is served for all gif 
>> >> requests.
>> >> /==========================================================
>> >> DWORD CGetgifFilter::OnPreprocHeaders(CHttpFilterContext* pCtxt,
>> >> PHTTP_FILTER_PREPROC_HEADERS pHeaderInfo)
>> >> {
>> >> // TODO: React to this notification accordingly
>> >>     char buffer[256];
>> >>    DWORD buffSize = sizeof(buffer);
>> >>    BOOL bHeader = pHeaderInfo->GetHeader(pCtxt->m_pFC, "url", buffer,
>> >> &buffSize);
>> >>    CString urlString(buffer);
>> >>    urlString.MakeLower(); // for this exercise
>> >>    if (urlString.Find(".gif") != -1) //we want to redirect this file
>> >>    {
>> >>        urlString.Replace(urlString,"/getgif.gif");
>> >>        char *newUrlString= urlString.GetBuffer(urlString.GetLength());
>> >>        pHeaderInfo->SetHeader(pCtxt->m_pFC, "url", newUrlString);
>> >>        return SF_STATUS_REQ_HANDLED_NOTIFICATION;
>> >>    }
>> >> // return the appropriate status code
>> >> return SF_STATUS_REQ_NEXT_NOTIFICATION;
>> >> }
>> >> ==========================================================/
>>
>> >> Do I need to register this? It fails when I try to with regsvr32, 
>> >> saying
>> >> "DllRegisterServer entry point was not found."
>>
>> >> I added the isapi in iis, but it's not working.
>> >> Thanks Soc.- Hide quoted text -
>>
>> - Show quoted text -
>
>
date: Tue, 18 Sep 2007 09:34:05 +0100   author:   SOC

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us