> ## 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.

# XStoreDownloadAndInstallPackageUpdatesAsync

> XStoreDownloadAndInstallPackageUpdatesAsync

# XStoreDownloadAndInstallPackageUpdatesAsync

指定されたストア パッケージの更新をダウンロードしてインストールします。

## 構文

```cpp theme={null}
HRESULT XStoreDownloadAndInstallPackageUpdatesAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char** packageIdentifiers,  
         size_t packageIdentifiersCount,  
         XAsyncBlock* async  
)  
```

### パラメーター

*storeContextHandle*   \_In\_\
Type: XStoreContextHandle

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

*packageIdentifiers*   \_In\_z\_count\_(packageIdentifiersCount)\
Type: char\*\*

パッケージ識別子文字列のリスト。
パッケージ識別子は、Microsoft Store からのパッケージを一意に識別します。パッケージ識別子の詳細については、[ダウンロード可能なコンテンツ (DLC) の管理とライセンス](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)を参照してください。

*packageIdentifiersCount*   \_In\_\
Type: size\_t

`packageIdentifiers` 内の識別子の数。

*async*   \_Inout\_\
Type: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

実行中の非同期処理を定義する [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) は、呼び出しの状態のポーリングと呼び出し結果の取得に使用できます。詳細については、[XAsyncBlock](/reference/system/xasync/structs/xasyncblock) を参照してください。

### 戻り値

Type: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

HRESULT の成功またはエラー コード。

## 解説

この関数は、指定されたストア パッケージの更新をダウンロードしてインストールします。

<Note>この関数を呼び出したときにゲームの更新が見つかった場合、ゲームはインストールを行えるように直ちに終了します。</Note>

ダウンロードおよびインストール更新の結果を取得するには、この関数を呼び出した後に [XStoreDownloadAndInstallPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult) を呼び出します。
使用例については、[XStoreQueryGameAndDlcPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerygameanddlcpackageupdatesasync) を参照してください。

この API を実行中のゲームから呼び出すと、ダウンロードは高優先度となり、`storeIds` パラメーターで指定された順序でキューの先頭に配置されます。

## 要件

**ヘッダー:** XStore.h (XGameRuntime.h に含まれる)

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

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

## 関連概念ドキュメント

* [更新の確認](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-checking-for-updates)

## 関連項目

[XStore](/reference/system/xstore/xstore_members)\
[XStoreDownloadAndInstallPackageUpdatesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult)


## Related topics

- [XStoreDownloadAndInstallPackageUpdatesResult](/ja-jp/reference/system/xstore/functions/xstoredownloadandinstallpackageupdatesresult.md)
- [XStoreDownloadPackageUpdatesAsync](/ja-jp/reference/system/xstore/functions/xstoredownloadpackageupdatesasync.md)
- [更新プログラムの確認](/ja-jp/publishing/xstore-commerce/xstore-checking-updates.md)
- [XStore](/ja-jp/reference/system/xstore/xstore_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
