template <class character>
unsigned get_windows_directory(character* buffer,
                               unsigned size)

This function obtains the windows directory.


character* buffer

A pointer to a buffer to hold the windows directory.

unsigned size

The size of the buffer pointed to by the previous parameter. The value path_length::maximum is usually sufficient to hold the full path name.



When the specified buffer is sufficiently large, the value returned is the length (in bytes) of the data placed into the buffer (not including the null-terminator).

If the value returned exceeds the specified buffer length, it is the size required to hold the complete path name of the windows directory.

Zero is returned when the call fails.


The windows directory is the directory in which application help and initialization files are stored. Unlike the system directory, the windows directory is guaranteed to be unique for each user.