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

# 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).</Note>

Depois que [XPackageMount](/pt-BR/reference/system/xpackage/functions/xpackagemount) 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)](/pt-BR/publishing/xstore-commerce/xstore-dlc).

[XPackageGetMountPathSize](/pt-BR/reference/system/xpackage/functions/xpackagegetmountpathsize) e [XPackageGetMountPath](/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath) 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](/pt-BR/reference/system/xpackage/xpackage_members)\
[Como criar e usar pacotes de conteúdo para download (DLC) para PC e XBOX One](/pt-BR/build/core-features/common/packaging/packaging-downloadable-content-dlc)
[XPackageMount](/pt-BR/reference/system/xpackage/functions/xpackagemount)\
[XPackageGetMountPathSize](/pt-BR/reference/system/xpackage/functions/xpackagegetmountpathsize)\
[XPackageGetMountPath](/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath)


## Related topics

- [XPackage](/pt-BR/reference/system/xpackage/xpackage_members.md)
- [Wrappers de API C# do Unity para o GDK](/pt-BR/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageCloseInstallationMonitorHandle](/pt-BR/reference/system/xpackage/functions/xpackagecloseinstallationmonitorhandle.md)
- [XPackageMountWithUiResult](/pt-BR/reference/system/xpackage/functions/xpackagemountwithuiresult.md)
- [XPackageGetMountPath](/pt-BR/reference/system/xpackage/functions/xpackagegetmountpath.md)
