Article ID: 194706
Article Last Modified on 8/5/2004
APPLIES TO
- Microsoft Internet Server Application Programming Interface 4.0
This article was previously published under Q194706
SUMMARY
There are situations where maintaining state information (or sharing data)
between an ISAPI Filter and an ISAPI Extension is desirable. One example
is capturing the Username and Password during the authentication
notification of an ISAPI Filter to generate application-specific
information, which will then later be used within an ISAPI Extension.
The simplest mechanism to handle this sort is adding a new header into the
request headers within the filter before invoking the extension is invoked
(you can do this during the pre-proc header notification). However, this
technique is limited by both size considerations (it wouldn't advisable to
add a 100KB header entry--the result would be significant performance hit)
and the fact that only ASCII-based information can be exchanged.
There are many other techniques that can be used to pass information from
a filter to an extension. This sample will use the Win32 Shared Memory
mechanism to pass information from a filter to an extension.
Smemfilt.exe is a sample that contains the necessary files for a Visual
C++ 6.0 project for an ISAPI filter. Smemext.exe contains the files for a
Visual C++ 6.0 project for an ISAPI extension. Both use the same SMemBlock
class (SMemBlock.h/.cpp), which is included in each self-extracting
executable.
This sample assumes the reader is familiar with C++ classes and use of both
Win32 File Mapping object and named synchronization object (Mutex). For
more information on these objects, please refer to the Visual C++ Online
documentation.
REFERENCES
Windows NT Option Pack ISAPI Documentation
Visual C++ Online Documentation
Additional query words: Smemext Smemfilt
Keywords: kbinfo kbdownload kbfile kbsample KB194706