GetPackageApplicationIds function (appmodel.h)

Gets the IDs of apps in the specified package.

Syntax

LONG GetPackageApplicationIds(
  [in]            PACKAGE_INFO_REFERENCE packageInfoReference,
  [in, out]       UINT32                 *bufferLength,
  [out, optional] BYTE                   *buffer,
  [out, optional] UINT32                 *count
);

Parameters

[in] packageInfoReference

Type: PACKAGE_INFO_REFERENCE

A reference to package information.

[in, out] bufferLength

Type: UINT32*

A pointer to a variable that holds the size of buffer, in bytes.

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

[out, optional] buffer

Type: BYTE*

A pointer to memory space that receives the app IDs.

[out, optional] count

Type: UINT32*

A pointer to a variable that receives the number of app IDs in buffer.

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_INSUFFICIENT_BUFFER
The buffer is not large enough to hold the data. The required size is specified by bufferLength.

Requirements

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