Skip to main content

XStoreAcquireLicenseForPackageAsync

Acquires a license to an installed DLC package (Durable with a package product type) for the current game that the user is entitled to use. XStoreRegisterPackageLicenseLost can be used to monitor if the license obtained from this API is lost.
This API won’t work with durable add-ons without a package.
To get the license for a Durable without a package use XStoreAcquireLicenseForDurablesAsync.

Syntax

Parameters

storeContextHandle   _In_
Type: XStoreContextHandle
The store context handle for the user returned by XStoreCreateContext. packageIdentifier   _In_z_
Type: char*
A string that uniquely identifies a store package. The package identifier is typically returned as part of an XPackageEnumeratePackages operation. For more information about package identifiers, see Manage and license downloadable content (DLC). async   _Inout_
Type: XAsyncBlock*
An XAsyncBlock defining the asynchronous work being done. The XAsyncBlock can be used to poll for the call’s status and retrieve call results. For more information, see XAsyncBlock.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

To retrieve the package license and the execution result of this function call XStoreAcquireLicenseForPackageResult after calling this function. If you would like to check if a package can be licensed then call XStoreCanAcquireLicenseForPackageAsync. After acquiring a license, you must check if it’s valid by calling XStoreIsLicenseValid. XPackageMountWithUiAsync will automatically acquire a license when called. If a license can’t be acquired, the package fails to mount. This code snippet shows an example of using the following APIs:

Requirements

Header: XStore.h (included in XGameRuntime.h) Library: xgameruntime.lib Supported platforms: Windows, XBOX One family consoles, and XBOX Series consoles

Conceptual documentation

See also

XStore
XStoreAcquireLicenseForPackageAsync
XStoreAcquireLicenseForPackageResult
XStoreIsLicenseValid
XStoreCloseLicenseHandle
XStoreRegisterPackageLicenseLost
XStoreUnregisterPackageLicenseLost
XStoreCanAcquireLicenseForPackageAsync
XStoreCanAcquireLicenseForPackageResult
Manage and license downloadable content (DLC)
Last modified on August 20, 2026