SAMPLE: Sharing Data Between ISAPI Filters and ISAPI Extensions (194706)
The information in this article applies to:
- Microsoft Internet Server Application Programming Interface (API)
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
Modification Type: | Minor | Last Reviewed: | 8/5/2004 |
---|
Keywords: | kbdownload kbfile kbinfo kbSample KB194706 |
---|
|