The GetSystemDirectory function retrieves the path of the Windows system directory. The system directory contains such files as Windows libraries, drivers, and font files.
UINT GetSystemDirectory(
LPTSTR lpBuffer, |
// address of buffer for system directory |
UINT uSize |
// size of directory buffer |
); |
If the function succeeds, the return value is the length, in characters, of the string copied to the buffer, not including the terminating null character. If the length is greater than the size of the buffer, the return value is the size of the buffer required to hold the path.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Applications should not create files in the system directory. If the user is running a shared version of Windows, the application does not have write access to the system directory. Applications should create files only in the directory returned by the GetWindowsDirectory function.
GetCurrentDirectory, GetWindowsDirectory, SetCurrentDirectory
See: