The information in this article applies to:
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.
MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: Smemext.exe Smemfilt.exeFor more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. The idea behind this sample is that the filter will create a shared memory pool, which contains a pre-determined number of memory "blocks." These blocks will then be checked out and checked in to the pool. The filter will check out a block (if one is available) and write some data into the block. It will then tell the extension which block was checked out by passing the block's index value via the AddHeader() method in the pre-proc header notification. The extension will then check out the same block, quickly make a copy of it, and check the block back into the pool as being "available." In this sample, the filter writes a quick message into the block and the extension will simply send back to the browser this message. The SMemBlock class contains one or more MemBlock objects. These MemBlock objects contain a header and body. The header will indicate the size of the data in the body (for speed reasons, the body size maximum is set to 4092 bytes--this is 4KB minus the entry for the 4-byte header). The SMemLock class is a simple Mutex wrapper that is contained by the SMemBlock class. Its name is based on the name of the SMemBlock and will be used to synchronize access between threads to the shared memory pool. REFERENCES
Windows NT Option Pack ISAPI Documentation
Additional query words:
Keywords : kbfile kbnokeyword |
Last Reviewed: December 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |