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

Récupère le résultat d'un appel à [XPackageInstallChunksAsync](/fr/reference/system/xpackage/functions/xpackageinstallchunksasync).

## Syntaxe

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

### Paramètres

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

**XAsyncBlock** passé à [XPackageInstallChunksAsync](/fr/reference/system/xpackage/functions/xpackageinstallchunksasync).

*installationMonitor*   \_Out\_\
Type : XPackageInstallationMonitorHandle\*

Au retour, contient un moniteur d'installation pour l'installation.

### Valeur de retour

Type : HRESULT

Code de réussite ou d'erreur HRESULT.

## Remarques

[XPackageInstallChunks](/fr/reference/system/xpackage/functions/xpackageinstallchunks) possède une variante asynchrone. L'installation de blocs peut impliquer de demander à l'utilisateur d'accepter la taille du téléchargement.

Cet exemple montre comment BigMaps est installé à l'aide des API asynchrones :

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

## Configuration requise

**En-tête :** XPackage.h

**Bibliothèque :** xgameruntime.lib

**Plateformes prises en charge :** Windows, consoles de la famille XBOX One et consoles XBOX Series

## Documentation conceptuelle

* [Objectifs de conception et améliorations de la programmation asynchrone](/fr/build/core-features/common/async/async-whitepaper)

## Voir aussi

[XPackage](/fr/reference/system/xpackage/xpackage_members)\
[Installation en streaming et Intelligent Delivery](/fr/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery)\
[XPackageInstallChunks](/fr/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)
- [XPackageInstallChunks](/reference/system/xpackage/functions/xpackageinstallchunks.md)
- [XPackageInstallChunksAsync](/es/reference/system/xpackage/functions/xpackageinstallchunksasync.md)
