> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStoreAcquireLicenseForDurablesAsync

> XStoreAcquireLicenseForDurablesAsync

# XStoreAcquireLicenseForDurablesAsync

DLC (パッケージ付きの永続型)、パッケージなしの永続型、または永続型アドオン製品のライセンスを取得します。

## Syntax

```cpp theme={null}
HRESULT XStoreAcquireLicenseForDurablesAsync(
         const XStoreContextHandle storeContextHandle,
         const char* storeId,
         XAsyncBlock* async
)
```

### Parameters

*storeContextHandle*   \_In\_\
型: XStoreContextHandle

[XStoreCreateContext](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstorecreatecontext.md) から返される、ユーザーのストア コンテキスト ハンドル。

*storeId*   \_In\_z\_\
型: char\*

ライセンスを取得する永続型のストア ID。

*async*   \_Inout\_\
型: XAsyncBlock\*

非同期作業を定義する [XAsyncBlock](https://docs.xbox.com/ja-jp/reference/system/xasync/structs/xasyncblock.md)。
[XAsyncBlock](https://docs.xbox.com/ja-jp/reference/system/xasync/structs/xasyncblock.md) を使用して呼び出しの状態を確認し、呼び出し結果を取得します。
詳細については、[XAsyncBlock](https://docs.xbox.com/ja-jp/reference/system/xasync/structs/xasyncblock.md) を参照してください。

### Return value

型: HRESULT

成功した場合は **S\_OK** を返します。そうでない場合はエラー コードを返します。

## Remarks

この API は、要求された永続型のライセンス取得を試みます。
デバイスが初めてライセンスを取得する場合はサービス呼び出しが行われるため、オンライン接続が必要です。
同じライセンスに対する後続の呼び出しはキャッシュにより高速になる可能性がありますが、ライセンスはいつでも無効化される可能性があります。
本体では、オフライン アクセスには所有アカウントで「ホーム XBOX」が有効になっている必要があり、ライセンスはオンライン時に最初に 1 回取得しておく必要があります。
PC では、オフライン アクセスにはライセンスを所有するアカウントで「オフラインでの許可」が設定されている必要があり、ライセンスはオンライン時に最初に 1 回取得しておく必要があります。

[XStoreRegisterPackageLicenseLost](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md) を使用して、この API から取得したライセンスが失われたかどうかを監視できます。

## Requirements

**ヘッダー:** XStore.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム**: Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [基本的なストア操作](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-basic-operations.md)
* [パッケージなしの永続型を使用する方法](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-dwob.md)
* [プレイヤーへのアドオン コンテンツへのアクセス許可の付与](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-granting-access.md)
* [ライセンス テストの有効化](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-licensing-setup.md)

## See also

[XStore](https://docs.xbox.com/ja-jp/reference/system/xstore/xstore_members.md)\
[XAsyncBlock](https://docs.xbox.com/ja-jp/reference/system/xasync/structs/xasyncblock.md)\
[XStoreAcquireLicenseForDurablesResult](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)\
[パッケージなしの永続型を使用する方法](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-dwob.md)\
[プレイヤーへのアドオン コンテンツへのアクセス許可の付与](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-granting-access.md)


## Related topics

- [XStoreAcquireLicenseForDurablesResult](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)
- [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [ライセンス供与テストの有効化](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-licensing-setup.md)
- [XStoreRegisterPackageLicenseLost](https://docs.xbox.com/ja-jp/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
- [プレイヤーにアドオン コンテンツへのアクセスを付与する](https://docs.xbox.com/ja-jp/publishing/xstore-commerce/xstore-granting-access.md)
