While reading on what the working directory and what the script directory (or the directory that contains the image of the executable file) directories are, I started wondering, how does Windows know, what directory to pass to the process as the working directory, when I actually don't specify the working directory when I launch a given program:
- Through the command line, I only pass the location of the script directory (~as the zeroth parameter). Note that the script directory is not the working directory.
I know that I can use GetCurrentDir() to retrieve the working directory inside of the program, but I'm wondering, does Windows have any 'internal' structure that stores the working directory of a given process? (and if yes, is there any documentation on that structure).
I've found out the following process related structures, but it appears none of them contains the working directory property.