GetPackagePath function (appmodel.h)

Gets the path for the specified package.

Syntax

LONG GetPackagePath(
  [in]            const PACKAGE_ID *packageId,
                  const UINT32     reserved,
  [in, out]       UINT32           *pathLength,
  [out, optional] PWSTR            path
);

Parameters

[in] packageId

Type: const PACKAGE_ID*

The package identifier.

reserved

Type: const UINT32

Reserved, do not use.

[in, out] pathLength

Type: UINT32*

On input, the size of the path buffer, in characters. On output, the size of the package path returned, in characters, including the null-terminator.

[out, optional] path

Type: PWSTR

The package path.

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

Requirements

Requirement Value
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

GetPackageInfo