HrCreatePersonalStore

The HrCreatePersonalStore function creates a personal folder (PST) with properties determined by the input parameters in a temporary profile.

Quick Info

Header file: NEWPST.H
Library: NEWPST.LIB

HRESULT HrCreatePersonalStore(
  LPSTR lpszPSTPath,         
  DWORD dwEncryption,        
  LPSTR lpszPSTDisplayName,  
  LPSTR lpszPSTPassword,     
  LPSTR * lppszProfileName,  
  LPSTR * lppszProfilePassword  
);
 

Parameters

lpszPSTPath
Input parameter. Points to the full distinguished name (DN) of the PST. This value is assigned to the PR_PST_PATH property.
dwEncryption
Input parameter. Specifies the encryption method. This value is assigned to the PR_PST_ENCRYPTION property.
lpszPSTDisplayName
Input parameter. Points to the value of the MAPI PR_DISPLAY_NAME property for the new PST.
lpszPSTPassword
Input parameter. Points to the PST password. This value is assigned to the PR_PST_PW_SZ_NEW property. This value cannot be NULL.
lppszProfileName
Output parameter. Points to a pointer to the temporary profile name. This value may be used to establish a MAPI session.
lppszProfilePassword
Output parameter. Points to a pointer the temporary profile password. This may be used to establish a MAPI session.

Return Values

See Return Values.

Remarks

The name and password of the temporary PST are returned to the user in lppszProfileName and lppszProfilePassword, respectively.

Do not make successive calls to HrCreatePersonalStore without intervening calls to HrCleanupPSTGlobals. Since Microsoft Exchange Server uses internal static storage for objects and profile strings, you should only create and use one new PST at a time.

See Also

HrCleanupPSTGlobals