GetProfileType function

Retrieves the type of profile loaded for the current user.

Syntax

USERENVAPI BOOL GetProfileType(
  DWORD *dwFlags
);

Parameters

dwFlags

Type: DWORD*

Pointer to a variable that receives the profile type. If the function succeeds, it sets one or more of the following values:

PT_MANDATORY

The user has a Mandatory User Profiles.

PT_ROAMING

The user has a Roaming User Profiles.

PT_ROAMING_PREEXISTING

The user has a Roaming User Profile that was created on another PC and is being downloaded. This profile type implies PT_ROAMING.

PT_TEMPORARY

The user has a Temporary User Profiles; it will be deleted at logoff.

Return Value

Type: BOOL

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

Remarks

If the user profile is not already loaded, the function fails.

Note that the caller must have KEY_READ access to HKEY_LOCAL_MACHINE. This access right is granted by default. For more information, see Registry Key Security and Access Rights.

If the profile type is PT_ROAMING_PREEXISTING, Explorer will not reinitialize default programs associations when a profile is loaded on a machine for the first time.

Requirements

   
Windows version Windows 2000 Professional [desktop apps only] Windows 2000 Server [desktop apps only]
Target Platform Windows
Header userenv.h
Library Userenv.lib
DLL Userenv.dll

See Also

LoadUserProfile

User Profiles Overview

User Profiles Reference