|
INT GetClientVirtualPath( |
|
UINT nClientId, |
|
|
LPCTSTR lpszLocalPath, |
|
|
LPTSTR lpszVirtualPath, |
|
|
INT nMaxLength, |
|
); |
INT GetClientVirtualPath( |
|
UINT nClientId, |
|
|
LPCTSTR lpszLocalPath, |
|
|
CString& strVirtualPath |
|
); |
Return the virtual path for a local file on the server.
Parameters
- nClientId
- An unsigned integer which uniquely identifies the client
session.
- lpszLocalPath
- A null-terminated string that specifies an absolute
path on the local system. This parameter cannot be NULL.
- lpszVirtualPath
- A null-terminated string buffer that will contain the virtual path,
terminated with a null-character. This buffer should be at least
MAX_PATH characters to accommodate the complete path. This parameter
cannot be NULL. An alternate version of this method accepts a CString object if it is available.
- nMaxLength
- An integer value that specifies the maximum number of characters
that can be copied into the string buffer, including the terminating
null character. This value must be greater than zero.
Return Value
If the method succeeds, the return value is the number of
characters copied into the string buffer, not including the
terminating null character. If the
client ID does not specify a valid client session,
the method will return zero. If the string buffer is not large
enough to contain the complete path, this method will return zero
and the last error code will be set to ST_ERROR_BUFFER_TOO_SMALL.
Remarks
A virtual path for the
client is relative to the root directory for the specified client
session. These
virtual paths are what the client will see as an absolute path on the server.
For example, if the server was configured to
use "C:\ProgramData\MyServer" as the root directory, and
the lpszLocalPath parameter was specified as
"C:\ProgramData\MyServer\Documents\Research", this method
would return the virtual path to that directory as
"/Documents/Research".
If the lpszLocalPath parameter specifies a file or
directory outside of the server root directory, this method will
return zero and the last error code will be set to
ST_ERROR_INVALID_FILE_NAME. This method can only be used with
authenticated clients. If the nClientId parameter specifies a
client session that has not been authenticated, this method will
return zero and the last error code will be
ST_ERROR_AUTHENTICATION_REQUIRED.
Requirements
Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools11.h
Import Library: cshtsv11.lib
Unicode: Implemented as Unicode and ANSI versions
See Also
GetCommandFile,
GetClientLocalPath
|
|