Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 3.4 KB

File metadata and controls

56 lines (42 loc) · 3.4 KB
title IMapPathProvider::SetPhysicalPath Method
description IMapPathProvider::SetPhysicalPath Method sets the physical path mapping for the current request.
ms.date 10/07/2016
ms.assetid 0c3ecda8-d86b-f299-d3c5-cee8b9b761c2

IMapPathProvider::SetPhysicalPath Method

Sets the physical path mapping for the current request.

Syntax

virtual HRESULT SetPhysicalPath(  
   PCWSTR pszPhysicalPath,  
   DWORD cchPhysicalPath  
) = 0;  

Parameters

pszPhysicalPath
[IN] A pointer to a string that contains the physical path to set.

cchPhysicalPath
[IN] A DWORD that contains the length of the pszPhysicalPath string.

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.
ERROR_INVALID_PARAMETER Indicates that an invalid value was passed in one of the parameters.

Remarks

The SetPhysicalPath method modifies the mapped path for requests. For example, an HTTP module can use the SetPhysicalPath method to change the default content location for requests to a path that is different than the path that is configured in the ApplicationHost.config file.

Example

The following code example demonstrates how to use the SetPhysicalPath method to create an HTTP module that modifies the default physical path for the current request to C:\Temp.

[!code-cppIMapPathProviderSetPhysicalPath#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