On Sat, 29 May 2010 12:26:16 +1000, Alex Blekhman <***@yahoo.com> wrote:
|On 29-May-10 6:50, Vincent Fatica wrote:
|>
|> What access rights are needed for SetCurrentDirectory() to succeed? I'd like to
|> know id SetCurrentDirectory will succeed without actually calling it. Thanks.
|
|I think that SetCurrentDirectory should always succeed because it
|doesn't change the system, but only changes the process itself. MSDN
|says that SetCurrentDirectory changes global environment variable in a
|calling process. I am not aware of any access rights restriction that
|would prevent a process from setting its own env. variables.
|
|I don't know whether SetCurrentDirectory checks if requested directory
|actually exists. If yes, then reading a disk would be reasonable access
|right to expect from a calling process.
It fails on "System Volume Information" for example. And it fails when the
target doesn't exist. The current directory is rather important to other Win32
API functions. It's **the** place to look when CreateFile() is given a name
with no path.
--
- Vince