Introduction to http://doc.wendoc.com Development
To overcome the performance and scalability problems that CGI brings, Microsoft developed a new way for developers to build scalable applications. This high performance alternative is called the Internet Server Application Programming Interface(ISAPI). Instead of housing functionality in executable files, ISAPI uses DLLs. Using DLLs instead of executable programs has some definite performance and scalability advantages
The ISAPI extension could also be called with arguments that will allow a single ISAPI extension to perform multiple tasks. Just as in the CGI example, the directory must have execute permissions enabled, or the DLL will be downloaded to the client rather than run on the server. ISAPI extensions are typically used to process client requests and output a response as HTML, which is very similar to the way CGI programs are used.
ISAPI filters perform a function that can’t be directly duplicated with CGI applications. ISAPI filters are never explicitly called; instead, they are called by IIS in response to certain events in the life of a request. The developer can request that an ISAPI filter be called whenever any of the following events occur:
1.When the server has preprocessed the client headers
2.When the server authenticates the client
3.When the server is mapping a logical URL to a physical URL
4.Before raw data is sent from the client to the server
5.After raw data is sent from the client to the server but before the server processes it
6.When the server logs information
7.When the session is ending
As with any filter, ISAPI filters should request only the notifications it requires and process them as quickly as possible. One of the more common uses of ISAPI filters is to provide custom authentication. Another use is to modify the HTML that will be sent to the client. For example, an ISAPI filter could be used to change the background color of each page. Because ISAPI filters aren’t nearly as common as ISAPI extensions, I won’t cover them any further in this book. If you want to learn more about ISAPI extensions, you can check out my book Inside Server-Based Applications (Microsoft Press, 1999).ISAPI specifies several entry-point functions that must be exported from the DLL. Using these entry points, IIS can load the DLL; call the functions that it implements, passing in parameters as required; and receive the data to write back to the browser. ISAPI requires only two entry-point functions to be implemented these entry points, IIS can load the DLL;