IAppHostPathMapper2::MapPath Method


Gets the details of the specific mapping decision and, optionally, can change the results in the return value.


HRESULT MapPath(  
   [in, string] BSTR bstrConfigPath,  
   [in, string] BSTR bstrMappedPhysicalPath,  
   [out, string, retval] BSTR * pbstrNewPhysicalPath,  
   [out] HANDLE * phImpersonationToken  


The hierarchy path being mapped.

The server-side physical path that the administration system has determined maps to the specified hierarchy path.

Set to the new or updated physical path to use for the mapping. If the mapping stays the same, the client implementer should return the identical physical path that was passed in as bstrMappedPhysicalPath.

Set to the impersonation token that was used to access the physical path.

Return Value

An HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK Indicates that the operation was successful.


To receive incoming remote calls for the IAppHostPathMapper2 Interface interface, the client must implement a UUID(0f80e901-8f4c-449a-bf90-13d5d082f187). It must then specify an object that implements the interface to the IAppHostAdminManager::SetMetadata Method method with the value of bstrMetadataName set to "pathMapper2".

As an administration system maps hierarchy paths to physical paths on the server, it optionally calls the client-supplied object that implements the IAppHostPathMapper2 interface. The implementer of this interface receives details of all mappings and can change the results of each mapping if required.


Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- 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 Technical Preview
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- IIS Express 7.5, IIS Express 8.0, IIS Express 10.0
Header Ahadmin.h

See Also

IAppHostPathMapper2 Interface
IAppHostPathMapper Interface