The GetSystemWindowsDirectory function retrieves the path of the shared Windows directory on a multi-user system.
If the function succeeds, the return value is the length of the string copied to the buffer, in TCHARs, 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 GetLastWin32Error.
On a system that is running Terminal Server, each user has a unique Windows directory. The system Windows directory is shared by all users, so it is the directory where an application should store initialization and help files that apply to all users.
With Terminal Services, the GetSystemWindowsDirectory function retrieves the path of the system Windows directory, while the GetWindowsDirectory function retrieves the path of a Windows directory that is private for each user. On a single-user system, GetSystemWindowsDirectory is the same as GetWindowsDirectory.
Windows NT 4.0 Terminal Server Edition: To retrieve the shared Windows directory, call GetSystemDirectory and trim the "System32" element from the end of the returned path.
Kernel Class | Tao.Platform.Windows Namespace | GetWindowsDirectory