Internet Server Sample: CGI Wrapper for ISAPI DLLs

This sample shows how to wrap an ISAPI DLL in a CGI executable, on systems that cannot use the DLL for some reason. To use this sample, simply build it by running nmake on the makefile provided. This will create cgiwrap.exe which can be renamed to match the name of the DLL. For example, to call foo.dll from this wrapper, rename cgiwrap.exe to foo.exe

This sample can also be used to aid in debugging. If you have a text file that contains a full http query (for POSTed forms; GET forms are all on the command line) then you can run this program under a debugger to analyze your sample. Please keep in mind that this is not the same environment as running as a service under IIS. Also, this sample, unlike IIS, is single threaded. Another sample to look at is ISmoke - this is a dialog based MFC app to help "smoke" out simple problems in ISAPI DLLs.

To illustrate the usage, here is an example of calling the ISrvMon sample from a CGI exe. cgiwrap.exe was renamed to ISrvMon.exe for this purpose. The following form is identical to the ISrvMon sample, but calls ISrvMon.exe instead. ISrvMon.DLL should, of course, be available for loading.

Note that the process information returned by ISrvMon.Dll is now for the ISrvMon.Exe (CGIWrap) process and not for the INetInfo.Exe (IIS) process.


This is a GET operation

System Information

Memory Status

Process Information


This is a POST operation

System Information

Memory Status

Process Information


View Source code