Export (0) Print
Expand All
Expand Minimize

GetAllUsersProfileDirectory function

Retrieves the path to the root of the directory that contains program data shared by all users.

Syntax


BOOL WINAPI GetAllUsersProfileDirectory(
  _Out_opt_  LPTSTR lpProfileDir,
  _Inout_    LPDWORD lpcchSize
);

Parameters

lpProfileDir [out, optional]

Type: LPTSTR

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.

lpcchSize [in, out]

Type: LPDWORD

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.

Return value

Type: BOOL

TRUE if successful; otherwise, FALSE. To get extended error information, call GetLastError.

Remarks

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:

C:\ProgramData

To obtain the paths of subdirectories of this directory, use the SHGetFolderPath (Windows XP and earlier) or SHGetKnownFolderPath (Windows Vista) function.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Userenv.h

Library

Userenv.lib

DLL

Userenv.dll

Unicode and ANSI names

GetAllUsersProfileDirectoryW (Unicode) and GetAllUsersProfileDirectoryA (ANSI)

See also

User Profiles Overview
User Profiles Reference
GetDefaultUserProfileDirectory
GetProfilesDirectory
GetUserProfileDirectory

 

 

Community Additions

ADD
Show:
© 2014 Microsoft