ParseApplicationUserModelId function (appmodel.h)

Deconstructs an application user model ID to its package family name and package relative application ID (PRAID).

Syntax

LONG ParseApplicationUserModelId(
  [in]            PCWSTR applicationUserModelId,
  [in, out]       UINT32 *packageFamilyNameLength,
  [out, optional] PWSTR  packageFamilyName,
  [in, out]       UINT32 *packageRelativeApplicationIdLength,
  [out, optional] PWSTR  packageRelativeApplicationId
);

Parameters

[in] applicationUserModelId

Type: PCWSTR

The app user model ID.

[in, out] packageFamilyNameLength

Type: UINT32*

A pointer to a variable that holds the number of characters (WCHARs) in the package family name string, which includes the null-terminator.

First you pass NULL to packageFamilyName to get the number of characters. You use this number to allocate memory space for packageFamilyName. Then you pass the address of this memory space to fill packageFamilyName.

[out, optional] packageFamilyName

Type: PWSTR

A pointer to memory space that receives the package family name string, which includes the null-terminator.

[in, out] packageRelativeApplicationIdLength

Type: UINT32*

A pointer to a variable that holds the number of characters (WCHARs) in the package-relative app ID string, which includes the null-terminator.

First you pass NULL to packageRelativeApplicationId to get the number of characters. You use this number to allocate memory space for packageRelativeApplicationId. Then you pass the address of this memory space to fill packageRelativeApplicationId.

[out, optional] packageRelativeApplicationId

Type: PWSTR

A pointer to memory space that receives the package-relative app ID (PRAID) string, which includes the null-terminator.

Return value

Type: LONG

If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes include the following.

Return code Description
ERROR_INVALID_PARAMETER
The applicationUserModelId parameter isn't valid.
ERROR_INSUFFICIENT_BUFFER
The buffer specified by packageFamilyName or packageRelativeApplicationId is not large enough to hold the data; the required buffer size, in WCHARs, is stored in the variable pointed to by packageFamilyNameLength or packageRelativeApplicationIdLength.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header appmodel.h
Library Kernel32.lib
DLL Kernel32.dll