Partager via


ISAPI Extensions (Compact 2013)

3/26/2014

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.

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 Compact enables 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 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 Set 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 http://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 part 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 named scripts. The value of the PATH_INFO variable would be /a/b.

In This Section

  • ISAPI Extension Functions
    Provides information about the differences between the IIS version and the Windows Embedded Compact version of ISAPI extension functions.

See Also

Concepts

ISAPI Extensions, Filters, and Script Mapping

Other Resources

GetServerVariable (ISAPI Extensions)