| 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 |
Sets the physical path mapping for the current request.
virtual HRESULT SetPhysicalPath(
PCWSTR pszPhysicalPath,
DWORD cchPhysicalPath
) = 0; 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.
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. |
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.
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.
| 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 |