Compartilhar via


ISAPI Extensions

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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 https://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.

ISAPI extensions with the Web Server are very similar to those used with the Microsoft Internet Information Server (IIS) in their basic function and operation.

If a requested file 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_URL_FLAGS_EXECUTE flag set. If the load attempt fails, the Web Server returns the 500 – Internal Server Error status code.

Windows Embedded CE allows virtual paths to specify an ISAPI extension or ASP page instead of a directory. For instance, the https://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 inventory subkey in the registry. There should be no characters trailing the file name in this registry value.

To configure this mapping on the server, use the following registry values:

[HKEY_LOCAL_MACHINE\Comm\HTTPD\VROOTS\/Inventory]
    "(default)"="\windows\scripts\inventory.dll"

For more information see Setting Virtual Paths.

By calling the GetServerVariable function with the lpszVariableName parameter 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 Vroot mapping, but that comes before the query string, if any) is placed in lpvBuffer.

Using the previous example, the https://www.computername.com/inventory/a/b URL still would match the Inventory.dll file and a call to the GetServerVariable function with the lpszVariableName parameter set to PATH_INFO would set the lpvBuffer parameter to /a/b.

The PATH_TRANSLATED variable specifies the value of the PATH_INFO variable, but with any virtual path expanded into a directory specification.

ISAPI extension names may be embedded in a URL. Once again, the PATH_INFO portion of the URL comes after the ISAPI DLL name, but before the query string, if any. For the https://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 called scripts. The value of the PATH_INFO variable would be /a/b.

See Also

Reference

GetServerVariable (ISAPI Extensions)

Concepts

ISAPI Extensions, Filters, and Script Mapping
Setting Virtual Paths