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

Recupera o resultado de uma chamada para [XPackageInstallChunksAsync](/pt-BR/reference/system/xpackage/functions/xpackageinstallchunksasync).

## Sintaxe

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

### Parâmetros

*asyncBlock*   \_Inout\_\
Tipo: [XAsyncBlock\*](/pt-BR/reference/system/xasync/structs/xasyncblock)

O **XAsyncBlock** passado para [XPackageInstallChunksAsync](/pt-BR/reference/system/xpackage/functions/xpackageinstallchunksasync).

*installationMonitor*   \_Out\_\
Tipo: XPackageInstallationMonitorHandle\*

No retorno, contém um monitor de instalação para a instalação.

### Valor retornado

Tipo: HRESULT

Código de sucesso ou de erro HRESULT.

## Comentários

[XPackageInstallChunks](/pt-BR/reference/system/xpackage/functions/xpackageinstallchunks) tem uma variante assíncrona. A instalação de partes pode envolver solicitar que o usuário aceite o tamanho do download.

Este exemplo mostra como os BigMaps são instalados usando as APIs assíncronas:

```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;
}
```

## Requisitos

**Cabeçalho:** XPackage.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatíveis:** Windows, consoles da família XBOX One e consoles XBOX Series

## Documentação conceitual

* [Metas de design e melhorias da programação assíncrona](/pt-BR/build/core-features/common/async/async-whitepaper)

## Confira também

[XPackage](/pt-BR/reference/system/xpackage/xpackage_members)\
[Instalação por streaming e Intelligent Delivery](/pt-BR/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery)\
[XPackageInstallChunks](/pt-BR/reference/system/xpackage/functions/xpackageinstallchunks)


## Related topics

- [XPackageInstallChunksResult](/reference/system/xpackage/functions/xpackageinstallchunksresult.md)
- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [Asynchronous programming design goals and improvements](/build/core-features/common/async/async-whitepaper.md)
