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

This function obtains the system directory.


character* buffer

A pointer to a buffer to hold the system 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 system directory.

A return value of zero indicates that the call failed.


Applications should place files in the windows directory rather than the system directory.