Retrieves the path to the root of the directory that contains program data shared by all users.
USERENVAPI BOOL GetAllUsersProfileDirectoryA( LPSTR lpProfileDir, LPDWORD lpcchSize );
A pointer to a buffer that, when this function returns successfully, receives the path. Set this value to NULL to determine the required size of the buffer, including the terminating null character.
A pointer to the size of the lpProfileDir buffer, in TCHARs.
If the buffer specified by lpProfileDir is not large enough or lpProfileDir is NULL, the function fails and this parameter receives the necessary buffer size, including the terminating null character.
TRUE if successful; otherwise, FALSE. To get extended error information, call GetLastError.
The following is an example of the path returned by GetAllUsersProfileDirectory in Windows XP:
C:\Documents and Settings\All Users
The following is an example of the path returned by GetAllUsersProfileDirectory in Windows 7:
|Windows version||Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]|