Microsoft Windows CE 3.0  

ISAPI Extensions

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

ISAPI extensions provide a means of scripting for the Web server. ISAPI extensions are implemented as DLLs that are loaded into the same process as the Web server.

If the Web server receives a request that maps to an ISAPI extension, such as http://www.mysite.com/MyISAPI.dll, it searches for the DLL in a cache of recently used extensions. If it is not in the cache, the Web server loads the DLL. After the DLL is loaded, the entire request is handled by the extension, with the Web server acting as an intermediary and helper.

The basic use and operation of ISAPI extensions on the Windows CE Web server are very similar to their use and operation on Microsoft Internet Information Server (IIS).

If a file that is requested has the .dll extension, the Web server attempts to load it as an ISAPI extension if it is in a directory that has the HSE_FLAGS_URL_EXECUTEflag set. If the load attempt fails, the Web server returns the "500 – Internal Server Error" status code.

Windows CE allows virtual paths to specify an ISAPI extension or ASP page instead of a directory. For instance, the http://www.computername.com/inventory URL could map to the \windows\scripts\inventory.dll file. To set up this specification, name the physical path "\windows\scripts\inventory.dll" under the inventorysubkey in the registry. There should be no characters trailing the file name in this registry value.

By calling the GetServerVariablefunction with the lpszVariableNameparameter set to PATH_INFO, the trailing part of the URL (that is, the part of the URL that comes after the ISAPI DLL name or that mapped to the ISAPI DLL path in the Vrootmapping, but that comes before the query string, if any) is placed in lpvBuffer.

Using the example above, the http://www.computername.com/inventory/a/b URL still would match the Inventory.dll file, and a call to the GetServerVariablefunction with the lpszVariableNameparameter set to PATH_INFOwould set the lpvBufferparameter to /a/b.

The PATH_TRANSLATEDvariable specifies the value of the PATH_INFOvariable, but with any virtual path expanded into a directory specification.

ISAPI extension names may be embedded in a URL. Once again, the PATH_INFOportion of the URL comes after the ISAPI DLL name, but before the query string, if any. For the http://www.yourcomputer.com/scripts/inventory.dll/a/b request, the Web server would look for the Inventory.dll file in the directory that is specified by the virtual directory "scripts." The value of the PATH_INFOvariable would be /a/b.



 Last updated on Friday, April 02, 2004

© 2004 Microsoft Corporation. All rights reserved.