Export (0) Print
Expand All
Expand Minimize

CreateAppContainerProfile function

Creates a per-user, per-app profile for Windows Store apps.

Syntax


HRESULT WINAPI CreateAppContainerProfile(
  _In_   PCWSTR pszAppContainerName,
  _In_   PCWSTR pszDisplayName,
  _In_   PCWSTR pszDescription,
  _In_   PSID_AND_ATTRIBUTES pCapabilities,
  _In_   DWORD dwCapabilityCount,
  _Out_  PSID *ppSidAppContainerSid
);

Parameters

pszAppContainerName [in]

The name of the app container. To ensure uniqueness, it is recommended that this string contains the app name as well as the publisher. This string can be up to 64 characters in length. Further, it must fit into the pattern described by the regular expression "[-_. A-Za-z0-9]+".

pszDisplayName [in]

The display name. This string can be up to 512 characters in length.

pszDescription [in]

A description for the app container. This string can be up to 2048 characters in length.

pCapabilities [in]

The SIDs that define the requested capabilities.

dwCapabilityCount [in]

The number of SIDs in pCapabilities.

ppSidAppContainerSid [out]

The SID for the profile. This buffer must be freed using the FreeSid function.

Return value

If this function succeeds, it returns a standard HRESULT code, including the following:

Return codeDescription
S_OK

The data store was created successfully.

E_ACCESSDENIED

The caller does not have permission to create the profile.

HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)

The application data store already exists.

E_INVALIDARG

The container name is NULL, or the container name, the display name, or the description strings exceed their specified respective limits for length.

 

Remarks

A profile contains folders and registry storage that are per-user and per-app. The folders have ACLs that prevent them from being accessed by other users and apps. These folders can be accessed by calling SHGetKnownFolderPath.

The function creates a profile for the current user. To create a profile on behalf of another user, you must impersonate that user. To create profiles for multiple users of the same app, you must call CreateAppContainerProfile for each user.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Userenv.h

Library

Userenv.lib

DLL

Userenv.dll

See also

DeleteAppContainerProfile

 

 

Community Additions

ADD
Show:
© 2014 Microsoft