Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 3.25 KB

File metadata and controls

48 lines (35 loc) · 3.25 KB
title IMapPathProvider::GetPhysicalPath Method
description Learn how the IMapPathProvider::GetPhysicalPath method retrieves the physical path for the current request.
ms.date 10/07/2016
ms.assetid 57fd7bef-bc47-7fac-286d-f1dec29f8732

IMapPathProvider::GetPhysicalPath Method

Retrieves the physical path for the current request.

Syntax

virtual PCWSTR GetPhysicalPath(  
) const = 0;  

Parameters

This method takes no parameters.

Return Value

A pointer to a string that contains the physical path.

Remarks

The GetPhysicalPath method retrieves the path for the current request when an HTTP module is processing the CHttpModule::OnMapPath event.

Note

The path that is returned by the GetPhysicalPath method is not translated to the physical path that provides the actual response. For example, if the default home page for a Web site is Default.asp, a request to http://example.com/ will return C:\Inetpub\Wwwroot, and not C:\Inetpub\Wwwroot\Default.asp.

Example

The following code example demonstrates how to use the GetPhysicalPath method to create an HTTP module that retrieves the physical path for the current request and returns the path to a Web client.

[!code-cppIMapPathProviderGetPhysicalPath#1]

Your module must export the RegisterModule function. You can export this function by creating a module definition (.def) file for your project, or you can compile the module by using the /EXPORT:RegisterModule switch. For more information, see Walkthrough: Creating a Request-Level HTTP Module By Using Native Code.

You can optionally compile the code by using the __stdcall (/Gz) calling convention instead of explicitly declaring the calling convention for each function.

Requirements

Type Description
Client - IIS 7.0 on [!INCLUDEwinvista]
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on [!INCLUDEwinsrv2008]
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- [!INCLUDEiisexp75], [!INCLUDEiisexp80], [!INCLUDEiisexp100]
Header Httpserv.h

See Also

IMapPathProvider Interface