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

# XPackageInstallChunksResult

> XPackageInstallChunksResult

# XPackageInstallChunksResult

[XPackageInstallChunksAsync](/reference/system/xpackage/functions/xpackageinstallchunksasync) の呼び出し結果を取得します。

## Syntax

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

### Parameters

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

[XPackageInstallChunksAsync](/reference/system/xpackage/functions/xpackageinstallchunksasync) に渡された **XAsyncBlock**。

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

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

### Return value

型: HRESULT

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

## Remarks

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

この例では、非同期 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

* [非同期プログラミングの設計目標と改善](/build/core-features/common/async/async-whitepaper)

## See also

[XPackage](/reference/system/xpackage/xpackage_members)\
[ストリーミング インストールとインテリジェント デリバリー](/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery)\
[XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks)


## Related topics

- [XPackage](/ja-jp/reference/system/xpackage/xpackage_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageInstallChunks](/ja-jp/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [XPackageInstallChunksAsync](/ja-jp/reference/system/xpackage/functions/xpackageinstallchunksasync.md)
- [XPackageChangeChunkInstallOrder](/ja-jp/reference/system/xpackage/functions/xpackagechangechunkinstallorder.md)
