GetPackagesByPackageFamily function (appmodel.h)

Gets the packages with the specified family name for the current user.

Syntax

LONG GetPackagesByPackageFamily(
  PCWSTR packageFamilyName,
  UINT32 *count,
  PWSTR  *packageFullNames,
  UINT32 *bufferLength,
  WCHAR  *buffer
);

Parameters

packageFamilyName

Type: PCWSTR

The package family name.

count

Type: UINT32*

A pointer to a variable that holds the number of package full names.

First you pass NULL to packageFullNames to get the number of package full names. You use this number to allocate memory space for packageFullNames. Then you pass the address of this number to fill packageFullNames.

packageFullNames

Type: PWSTR*

A pointer to the strings of package full names.

bufferLength

Type: UINT32*

A pointer to a variable that holds the number of characters in the string of package full names.

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

buffer

Type: WCHAR*

The string of characters for all of the package full names.

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
One or more buffer is not large enough to hold the data. The required size is specified by either count or buffer.

Requirements

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

See also

PackageNameAndPublisherIdFromFamilyName