GetCurrentPackageInfo2 function (appmodel.h)
Gets the package information for the calling process, with the option to specify the type of folder path to retrieve for the package.
LONG GetCurrentPackageInfo2( const UINT32 flags, PackagePathType packagePathType, UINT32 *bufferLength, BYTE *buffer, UINT32 *count );
Type: const UINT32
The package constants that specify how package information is retrieved. The PACKAGE_FILTER_* flags are supported.
Indicates the type of folder path to retrieve for the package (the original install folder or the mutable folder).
On input, the size of buffer, in bytes. On output, the size of the array of structures returned, in bytes.
The package information, represented as an array of PACKAGE_INFO structures.
The number of structures in the buffer.
If the function succeeds it returns ERROR_SUCCESS. Otherwise, the function returns an error code. The possible error codes include the following.
||The process has no package identity.|
||The buffer is not large enough to hold the data. The required size is specified by bufferLength.|
The packagePathType parameter is useful for applications that use the windows.mutablePackageDirectories extension in their package manifest. This extension specifies a folder under the %ProgramFiles%\ModifiableWindowsApps path where the contents of the application's install folder are projected so that users can modify the installation files. This feature is currently available only for certain types of desktop PC games that are published by Microsoft and our partners, and it enables these types of games to support mods.
|Minimum supported client||Windows 10 [desktop apps only]|
|Minimum supported server||Windows Server 2016 [desktop apps only]|