Skip to content

Latest commit

 

History

History
141 lines (114 loc) · 3.77 KB

nf-userenv-createappcontainerprofile.md

File metadata and controls

141 lines (114 loc) · 3.77 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:userenv.CreateAppContainerProfile
CreateAppContainerProfile function (userenv.h)
Creates a per-user, per-app profile for an AppContainer.
CreateAppContainerProfile
CreateAppContainerProfile function [Windows Shell]
shell.createappcontainerprofile
userenv/CreateAppContainerProfile
shell\createappcontainerprofile.htm
shell
73F5F30F-4083-4D33-B181-31B782AD40D6
07/24/2023
CreateAppContainerProfile, CreateAppContainerProfile function [Windows Shell], shell.createappcontainerprofile, userenv/CreateAppContainerProfile
userenv.h
Windows
Windows 8 [desktop apps only]
Windows Server 2012 [desktop apps only]
Userenv.lib
Userenv.dll
Windows
19H1
CreateAppContainerProfile
userenv/CreateAppContainerProfile
c++
APIRef
kbSyntax
DllExport
Userenv.dll
CreateAppContainerProfile

-description

Creates a per-user, per-app profile for an AppContainer.

-parameters

-param pszAppContainerName [in]

The name of the app container. To ensure uniqueness, this string should ideally contain 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]+".

-param pszDisplayName [in]

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

-param pszDescription [in]

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

-param pCapabilities [in]

The SIDs that define the requested UWP capabilities (if applicable).

-param dwCapabilityCount [in]

The number of SIDs in pCapabilities.

-param ppSidAppContainerSid [out]

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

-returns

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

Return code Description
S_OK
The data store was created successfully.
E_ACCESSDENIED
The caller doesn't 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.

-see-also