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

# XPackageInstallChunksResult

> XPackageInstallChunksResult

# XPackageInstallChunksResult

[XPackageInstallChunksAsync](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksasync.md) の呼び出し結果を取得します。

## Syntax

```cpp theme={null}
HRESULT XPackageInstallChunksResult(  
         XAsyncBlock* asyncBlock,  
         XPackageInstallationMonitorHandle* installationMonitor  
)  
```

### Parameters

*asyncBlock*   \_Inout\_\
型: [XAsyncBlock\*](https://docs.xbox.com/ja-jp/reference/system/xasync/structs/xasyncblock.md)

[XPackageInstallChunksAsync](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksasync.md) に渡された **XAsyncBlock**。

*installationMonitor*   \_Out\_\
型: XPackageInstallationMonitorHandle\*

戻り時、インストールに対するインストール モニターを含みます。

### Return value

型: HRESULT

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

## Remarks

[XPackageInstallChunks](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunks.md) には非同期バリアントがあります。チャンクのインストールでは、ダウンロード サイズを承諾するようユーザーに促す場合があります。

この例では、非同期 API を使用して BigMaps をインストールする方法を示します:

```cpp theme={null}
void CALLBACK BigMapsInstallProgress(
    void* /* context */,
    XPackageInstallationMonitorHandle monitor)
{
    XPackageInstallationProgress progress;
    XPackageGetInstallationProgress(monitor, &progress);
    if (progress.completed)
    {
        printf("BigMaps Installed\n");
        XPackageCloseInstallationMonitorHandle(monitor);
    }
}

void CALLBACK BigMapsAsyncInstallComplete(XAsyncBlock* asyncBlock)
{
    XPackageInstallationMonitorHandle monitor;
    HRESULT hr = XPackageInstallChunksResult(asyncBlock, &monitor);
    delete asyncBlock;

    if (SUCCEEDED(hr))
    {
        XTaskQueueRegistrationToken token;
        if (FAILED(XPackageRegisterInstallationProgressChanged(
            monitor,
            nullptr,
            BigMapsInstallProgress, &token)))
        {
            XPackageCloseInstallationMonitorHandle(monitor);
        }
    }
}

HRESULT InstallBigMapsAsync(XTaskQueueHandle queue)
{
    char id[XPACKAGE_IDENTIFIER_MAX_LENGTH];
    HRESULT hr = XPackageGetCurrentProcessPackageIdentifier(_countof(id), id);
    if (FAILED(hr)) return hr;

    XPackageChunkSelector selector;
    selector.type = XPackageChunkSelectorType::Tag;
    selector.tag = "BigMaps";

    XAsyncBlock* asyncBlock = new (std::nothrow) XAsyncBlock{};
    asyncBlock->callback = BigMapsAsyncInstallComplete;
    asyncBlock->queue = queue;

    hr = XPackageInstallChunksAsync(
        id, 1, &selector, 1000,
        false, asyncBlock);

    if (FAILED(hr))
    {
        delete asyncBlock;
    }

    return hr;
}
```

## Requirements

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

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

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

## Conceptual documentation

* [非同期プログラミングの設計目標と改善](https://docs.xbox.com/ja-jp/build/core-features/common/async/async-whitepaper.md)

## See also

[XPackage](https://docs.xbox.com/ja-jp/reference/system/xpackage/xpackage_members.md)\
[ストリーミング インストールと Intelligent Delivery](https://docs.xbox.com/ja-jp/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery.md)\
[XPackageInstallChunks](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunks.md)


## Related topics

- [XPackage (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xpackage/xpackage_members.md)
- [Unity プロジェクトでの GDK API 用 C# ラッパーの使用](https://docs.xbox.com/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageInstallChunks](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [XPackageInstallChunksAsync](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksasync.md)
- [XPackageChangeChunkInstallOrder](https://docs.xbox.com/ja-jp/reference/system/xpackage/functions/xpackagechangechunkinstallorder.md)
