XStoreAcquireLicenseForDurablesAsync

Acquires a license for a Durable without a package or Durable add-on product.

Note

This API will not work for the Durables with a package product type. If you are attempting to call this API for a Durable with a package, XStoreAcquireLicenseForDurablesResult will return an error. To get the license of a Durable with a package use XStoreAcquireLicenseForPackageAsync.

Syntax

HRESULT XStoreAcquireLicenseForDurablesAsync(
         const XStoreContextHandle storeContextHandle,
         const char* storeId,
         XAsyncBlock* async
)

Parameters

storeContextHandle   _In_
Type: XStoreContextHandle

The store context handle for the user, returned by XStoreCreateContext.

storeId   _In_z_
Type: char*

The store ID for the durable to acquire a license for.

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. See XAsyncBlock for more information.

Return value

Type: HRESULT

Returns S_OK upon success, or an error code otherwise.

Remarks

This API is intended for the durables without packages add-on type. For durables with packages, use XStoreAcquireLicenseForPackageAsync instead.

This API attempts to acquire a license for the requested durable. If it is the first time this device has acquired the license, a service call will be made, therefore requiring an online connection. Subsequent calls for the same license may be faster due to caching, but this can be invalidated at any time. Offline access to this license can only occur when the license was obtained once while online. For PC, this requires the Offline Permissions to be set for the account that owns the license.

XStoreRegisterPackageLicenseLost can be used to monitor if the license obtained from this API is lost.

Requirements

Header: XStore.h

Library: xgameruntime.lib

Supported Platforms: Windows, Xbox One family consoles and Xbox Series consoles

See also

XStore
XAsyncBlock
XStoreAcquireLicenseForDurablesResult