Article ID: 281316 - View products that this article applies to.
This article was previously published under Q281316
This article has been archived. It is offered "as is" and will no longer be updated.
Some earlier versions of the Platform SDK documentation for the GetSystemWindowsDirectory() API contains an error indicating that the function is supported in Microsoft Windows NT 4.0 Terminal Server Edition for Service Pack 4 and later. This is not accurate. The GetSystemWindowsDirectory() API is only supported in Microsoft Windows 2000. An attempt to call the ANSI version of this function in Windows NT 4.0 will result in the following error:
Unicode-based applications will get a similar message for GetSystemWindowsDirectoryW.
Entry Point Not Found
The procedure entry point GetSystemWindowsDirectoryA could not be located in the dynamic link library KERNEL32.dll.
GetSystemWindowsDirectory() is used to retrieve the path of the shared Windows directory on a multi-user system. This has the same effect as calling the GetWindowsDirectory() API on a non-Terminal Server system.
On a system that is running Terminal Server, each user has a unique Windows directory. GetWindowsDirectory() returns this unique directory and therefore cannot be used to retrieve the shared Windows directory. To retrieve the shared Windows directory on Windows NT 4.0 Terminal Server Edition, an application can call GetSystemDirectory() and trim "System32" from the end of the returned path.
Sample CodeThe following sample code demonstrates how to retrieve the shared Windows directory for both Windows NT 4.0 and Windows 2000. If the operating system is Windows 2000 or later, this code makes a call to GetSystemWindowsDirectory(). Otherwise, it calls GetSystemDirectory() and then trims the last element from the returned path.