PROFILEINFOW structure (profinfo.h)

Contains information used when loading or unloading a user profile.

Syntax

typedef struct _PROFILEINFOW {
  DWORD              dwSize;
  DWORD              dwFlags;
  MIDL_STRING LPWSTR lpUserName;
  MIDL_STRING LPWSTR lpProfilePath;
  MIDL_STRING LPWSTR lpDefaultPath;
  MIDL_STRING LPWSTR lpServerName;
  MIDL_STRING LPWSTR lpPolicyPath;
#if ...
  ULONG_PTR          hProfile;
#else
  HANDLE             hProfile;
#endif
} PROFILEINFOW, *LPPROFILEINFOW;

Members

dwSize

Type: DWORD

The size of this structure, in bytes.

dwFlags

Type: DWORD

This member can be one of the following flags:

PI_NOUI

Prevents the display of profile error messages.

PI_APPLYPOLICY

Not supported.

lpUserName

Type: LPTSTR

A pointer to the name of the user. This member is used as the base name of the directory in which to store a new profile.

lpProfilePath

Type: LPTSTR

A pointer to the roaming user profile path. If the user does not have a roaming profile, this member can be NULL. To retrieve the user's roaming profile path, call the NetUserGetInfo function, specifying information level 3 or 4. For more information, see Remarks.

lpDefaultPath

Type: LPTSTR

A pointer to the default user profile path. This member can be NULL.

lpServerName

Type: LPTSTR

A pointer to the name of the validating domain controller, in NetBIOS format.

lpPolicyPath

Type: LPTSTR

Not used, set to NULL.

hProfile

Type: HANDLE

A handle to the HKEY_CURRENT_USER registry subtree. For more information, see Remarks.

Remarks

Do not use environment variables when specifying a path. The LoadUserProfile function does not expand environment variables, such as %username%, in a path.

When the LoadUserProfile call returns successfully, the hProfile member receives a registry key handle opened to the root of the user's subtree, opened with full access (KEY_ALL_ACCESS). For more information see the Remarks sections in LoadUserProfile, Registry Key Security and Access Rights, and Registry Hives.

Services and applications that call LoadUserProfile should check to see if the user has a roaming profile. If the user has a roaming profile, specify its path as the lpProfilePath member of this structure.

Note

The profinfo.h header defines PROFILEINFO as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header profinfo.h (include Userenv.h)

See also

LoadUserProfile

UnloadUserProfile

User Profiles Overview