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

지정된 탑재 핸들을 닫고 디바이스를 마운트 해제합니다.

## 구문

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

### 매개 변수

*mount*   \_In\_\
형식: XPackageMountHandle

닫을 탑재 핸들입니다.

### 반환 값

형식: void

## 설명

<Note>이 함수는 시간에 민감한 스레드에서 호출해서는 안전하지 않습니다. 자세한 내용은 [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)를 참조하세요.</Note>

[XPackageMount](/reference/system/xpackage/functions/xpackagemount)가 특정 패키지 식별자를 탑재하고 이에 대한 탑재 핸들을 반환한 후, XPackageCloseMountHandle은 디바이스를 마운트 해제합니다. 이 작업은 몇 초가 걸릴 수 있습니다. 패키지 식별자에 대한 자세한 내용은 [다운로드 가능한 콘텐츠(DLC) 관리 및 라이선스](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)를 참조하세요.

[XPackageGetMountPathSize](/reference/system/xpackage/functions/xpackagegetmountpathsize) 및 [XPackageGetMountPath](/reference/system/xpackage/functions/xpackagegetmountpath)는 패키지 콘텐츠의 파일 경로를 반환하는 데 사용됩니다.

콘텐츠 패키지만 탑재할 수 있습니다. 다른 게임을 탑재하려고 하면 E\_ACCESS\_DENIED가 발생합니다.

예제:

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

    // 이것이 마지막 핸들인 경우 DLC 경로를 마운트 해제합니다.
    XPackageCloseMountHandle(mountHandle);
    return S_OK;
}
```

## 요구 사항

**헤더:** XPackage.h

**라이브러리:** xgameruntime.lib

**지원 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 개념 문서

* [시간에 민감한 스레드](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 함께 보기

[XPackage](/reference/system/xpackage/xpackage_members)\
[PC 및 XBOX One용 다운로드 가능 콘텐츠 패키지(DLC)를 만들고 사용하는 방법](/build/core-features/common/packaging/packaging-downloadable-content-dlc)
[XPackageMount](/reference/system/xpackage/functions/xpackagemount)\
[XPackageGetMountPathSize](/reference/system/xpackage/functions/xpackagegetmountpathsize)\
[XPackageGetMountPath](/reference/system/xpackage/functions/xpackagegetmountpath)


## Related topics

- [XPackage](/ko/reference/system/xpackage/xpackage_members.md)
- [GDK용 Unity C# API 래퍼](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPackageCloseInstallationMonitorHandle](/ko/reference/system/xpackage/functions/xpackagecloseinstallationmonitorhandle.md)
- [XPackageMountWithUiResult](/ko/reference/system/xpackage/functions/xpackagemountwithuiresult.md)
- [XPackageGetMountPath](/ko/reference/system/xpackage/functions/xpackagegetmountpath.md)
