3.1.4.16.4 MapPath (Opnum 6)

The MapPath method is received by the server in an RPC_REQUEST packet. In response, the server returns how the administration system maps the specific site name and virtual path into an optionally returned implementation-specific operating system physical path, and the server optionally returns the IAppHostElement objects that contain the definition of the mapping hierarchy that applies.

The "mapping hierarchy that applies" means describing the matching rules that the administration system uses to map a specific hierarchy path. Because there are two returned IAppHostElement objects, this allows the server protocol implementation to provide a two-level mapping system where a path is first matched to an application and then mapped to a virtual directory. Regardless of what these two concepts (application and virtual directory) represent, their mapping details are contained in the optionally returned parameters.

 HRESULT MapPath(
   [in] BSTR bstrSiteName,
   [in] BSTR bstrVirtualPath,
   [out] BSTR* pbstrPhysicalPath,
   [out] IAppHostElement** ppVirtualDirectoryElement,
   [out] IAppHostElement** ppApplicationElement
 );

bstrSiteName: The unique site name string.

bstrVirtualPath: A hierarchy path to map.

pbstrPhysicalPath: Returns an implementation-specific physical path in the file system to where the virtual path maps. Optional.

ppVirtualDirectoryElement: Returns the second-level mapped virtual directory that is matched in the mapping. Optional.

ppApplicationElement:  Returns the first-level mapped application that is matched in the mapping. Optional.

Return Values: The server MUST return zero if it successfully processes the message that is received from the client. For each of the output parameters, in this case, they will not be NULL. If processing fails, the server MUST return a nonzero HRESULT code as defined in [MS-ERREF]. The following table describes the error conditions that MUST be handled and the corresponding error codes. A server MAY return additional implementation-specific error codes.

Return value/code

Description

0X00000000

NO_ERROR

The operation completed successfully.

0X80070013 

ERROR_INVALID_DATA

Configuration data or schema on the server are malformed or corrupted.

0X80070057 

ERROR_INVALID_PARAMETER

One or more parameters are incorrect or null.

0X00000008 

ERROR_NOT_ENOUGH_MEMORY

Not enough memory is available to process this command.