The ChangeClientDirectory method will change the
current working directory for the specified client session. This
method is called internally when the client sends the CWD or CDUP
commands, however it may be explicitly used by the application to
change the client's working directory in response to a server event.
This method cannot be used to change the current working
directory for a client to an arbitrary directory outside of the server
root directory. If the lpszDirectory parameter specifies a
relative path (i.e.: a path that does not begin with a drive letter
or leading path delimiter) then the new working directory will be
relative to the current working directory. If an absolute path is
specified, the absolute path must include the complete path to either
the server root directory or the user's home directory, based on the
permissions granted to the client session. If a path outside of the
server root directory is specified, this method will fail with an
access denied error.
Use caution when calling this method to override the directory
specified by the client when it sends the CWD or CDUP commands. If
your application changes the current working directory to one not specified by
the client, it may cause unpredictable behavior in the client
application because the actual path of the current working directory
will not match the directory that was requested.
If this method is used to change the current working directory in
response to the CWD command, you should not call the GetCommandParam
method and pass the command parameter as an argument to this method.
You must use the GetCommandFile method to obtain the directory
name provided by the client prior to calling this method.
The application should never call the SetCurrentDirectory
function in the Windows API to change the current directory for the process to the
working directory of a client session. Because the server is
multithreaded and each client session is managed in its own thread, an
application using this library should avoid using relative paths.