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

# XStoreAcquireLicenseForDurablesAsync

> XStoreAcquireLicenseForDurablesAsync

# XStoreAcquireLicenseForDurablesAsync

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

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*storeContextHandle*   \_In\_\
型: XStoreContextHandle

[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext) から返される、ユーザーのストア コンテキスト ハンドル。

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

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

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

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

<a id="retvalSection" />

### Return value

型: HRESULT

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

<a id="remarksSection" />

## Remarks

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

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

<a id="requirementsSection" />

## Requirements

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

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

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

<a id="seealsoSection" />

## Conceptual documentation

* [基本的なストア操作](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-basic-store-operations)
* [パッケージなしの耐久型を使用する方法](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-dwobs)
* [プレイヤーへのアドオン コンテンツへのアクセス許可の付与](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)
* [ライセンス テストの有効化](/publishing/xstore-commerce/xstore-licensing-setup)

## See also

[XStore](/reference/system/xstore/xstore_members)\
[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)\
[XStoreAcquireLicenseForDurablesResult](/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult)\
[パッケージなしの耐久型を使用する方法](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-dwobs)\
[プレイヤーへのアドオン コンテンツへのアクセス許可の付与](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)


## Related topics

- [XStoreAcquireLicenseForDurablesResult](/ja-jp/reference/system/xstore/functions/xstoreacquirelicensefordurablesresult.md)
- [XStoreAcquireLicenseForPackageAsync](/ja-jp/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [ライセンス供与テストの有効化](/ja-jp/publishing/xstore-commerce/xstore-licensing-setup.md)
- [XStoreRegisterPackageLicenseLost](/ja-jp/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
- [パッケージのない耐久型の使用方法](/ja-jp/publishing/xstore-commerce/xstore-dwob.md)
