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

# XPackageCloseMountHandle

> XPackageCloseMountHandle

# XPackageCloseMountHandle

Fecha o identificador de montagem especificado e desmonta o dispositivo.

## Sintaxe

```cpp theme={null}
void XPackageCloseMountHandle(  
         XPackageMountHandle mount  
)  
```

### Parâmetros

*mount*   \_In\_\
Tipo: XPackageMountHandle

O identificador de montagem a ser fechado.

### Valor retornado

Tipo: void

## Comentários

> [!NOTE]
>
> Não é seguro chamar esta função em um thread sensível ao tempo. Para obter mais informações, consulte [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).

Depois que [XPackageMount](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagemount.md) monta um identificador de pacote específico e retorna um identificador de montagem para ele, XPackageCloseMountHandle desmonta o dispositivo. Isso pode levar vários segundos. Para obter mais informações sobre identificadores de pacote, consulte [Gerenciar e licenciar conteúdo para download (DLC)](https://docs.xbox.com/pt-BR/publishing/xstore-commerce/xstore-dlc.md).

[XPackageGetMountPathSize](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagegetmountpathsize.md) e [XPackageGetMountPath](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath.md) são usados para retornar o caminho do arquivo para o conteúdo do pacote.

Somente pacotes de conteúdo podem ser montados. Uma tentativa de montar outro jogo resultará em E\_ACCESS\_DENIED.

Exemplo:

```cpp theme={null}
HRESULT MountDlc(char* dlcIdentifier)
{
    XPackageMountHandle mountHandle;
    HRESULT hr = XPackageMount(dlcIdentifier, &mountHandle);
    if (FAILED(hr)) return hr;

    size_t pathSize;
    hr = XPackageGetMountPathSize(mountHandle, &pathSize);
    if (FAILED(hr))
    {
        XPackageCloseMountHandle(mountHandle);
        return hr;
    }

    char* path = new (std::nothrow) char[pathSize];
    if (path == nullptr)
    {
        XPackageCloseMountHandle(mountHandle);
        return E_OUTOFMEMORY;
    }

    hr = XPackageGetMountPath(mountHandle, pathSize, path);
    if (FAILED(hr))
    {
        XPackageCloseMountHandle(mountHandle);
        delete[] path;
        return hr;
    }

    printf("Dlc %s mounted at path %s\n", dlcIdentifier, path);

    delete[] path;

    // Unmounts DLC path if this is the last handle
    // to it.
    XPackageCloseMountHandle(mountHandle);
    return S_OK;
}
```

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

* [Threads sensíveis ao tempo](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## Confira também

[XPackage](https://docs.xbox.com/pt-BR/reference/system/xpackage/xpackage_members.md)\
[Como criar e usar pacotes de conteúdo para download (DLC) para PC e XBOX One](https://docs.xbox.com/pt-BR/build/core-features/common/packaging/packaging-downloadable-content-dlc.md)
[XPackageMount](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagemount.md)\
[XPackageGetMountPathSize](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagegetmountpathsize.md)\
[XPackageGetMountPath](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath.md)


## Related topics

- [XPackage (conteúdo da API)](https://docs.xbox.com/pt-BR/reference/system/xpackage/xpackage_members.md)
- [Usar wrappers C# para APIs do GDK no seu projeto do Unity](https://docs.xbox.com/pt-BR/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageCloseInstallationMonitorHandle](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagecloseinstallationmonitorhandle.md)
- [XPackageMountWithUiResult](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagemountwithuiresult.md)
- [XPackageGetMountPath](https://docs.xbox.com/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath.md)
