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

# XPackageMountWithUiAsync

> XPackageMountWithUiAsync

# XPackageMountWithUiAsync

지정된 콘텐츠의 설치를 비동기적으로 탑재하고 이에 대한 탑재 핸들을 반환합니다.
로그인한 모든 사용자의 자녀 보호 설정을 기준으로 콘텐츠에 연령 제한이 있는 경우 사용자에게 자녀 보호 동의 UI를 표시합니다.

## 구문

```cpp theme={null}
HRESULT XPackageMountWithUiAsync(
  const char * packageIdentifier,
  XAsyncBlock * async
) noexcept;
```

### 매개 변수

*packageIdentifier*  \_In\_z\_\
형식: const char \*

디스크에 설치된 패키지를 고유하게 식별하는 문자열입니다.
[XPackageEnumerationCallback](/reference/system/xpackage/functions/xpackageenumerationcallback)에서 반환된 [XPackageDetails](/reference/system/xpackage/structs/xpackagedetails) 구조체의 packageIdentifier 필드를 전달합니다.
패키지 식별자에 대한 자세한 내용은 [다운로드 가능한 콘텐츠(DLC) 관리 및 라이선스](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)를 참조하세요.

*async*  \_Inout\_\
형식: XAsyncBlock \*

비동기 호출의 상태를 모니터링하기 위한 **XAsyncBlock**입니다.

### 반환 값

형식: HRESULT

HRESULT 성공 또는 오류 코드입니다.

## 설명

이 API는 로그인된 모든 사용자에게 연령에 적합하지 않은 콘텐츠를 탑재하는 경우 사용자에게 자녀 보호 동의 프롬프트를 표시합니다.
성인 사용자가 프롬프트에서 자녀 보호 동의를 승인하면 API가 패키지 탑재를 시도합니다.
성인 사용자가 프롬프트에서 자녀 보호 동의를 거부하면 API는 패키지 탑재에 실패합니다.

이 API는 [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync) / [Result](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult) 및 [XStoreIsLicenseValid](/reference/system/xstore/functions/xstoreislicensevalid)를 자동으로 호출합니다.
API가 DLC에 대해 유효한 라이선스를 획득할 수 없으면 탑재에 실패합니다.

이 코드 예제에서 게임은 콘텐츠가 연령 제한이 있는 경우 DLC를 흑백으로 렌더링합니다.
게임의 외부 코드는 사용자가 사용할 DLC를 선택할 때 `MountDlc`를 호출합니다.

```cpp theme={null}
extern void RenderDlc(const char* packageId, const char* displayName, bool monochrome); 

void ShowDlc() 
{ 
// 게임의 모든 DLC를 열거하고 사용자에게 렌더링합니다
XPackageEnumeratePackages(XPackageKind::Content, XPackageEnumerationScope::ThisAndRelated, nullptr,
 [](void*, const XPackageDetails* details) 
  {     
        RenderDlc(details->packageIdentifier,
                  details->displayName, 
                  details->ageRestricted);
  }); 
} 

 HRESULT MountDlc(const char* packageId, XPackageMountHandle* handle)
 {  
    XAsync async{};  
    RETURN_IF_FAILED(XPackageMountWithUiAsync(packageId, &async));
    RETURN_IF_FAILED(XAsyncGetStatus(&async, true));
    RETURN_IF_FAILED(XPackageMountWithUiResult(&async, handle));  
    return S_OK; 
} 
```

## 요구 사항

**헤더:** XPackage.h

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

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

## 개념 문서

* [서비스로서의 게임(GaaS) 지원](/build/core-features/common/packaging/supporting-games-as-a-service)

## 함께 보기

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


## Related topics

- [[DEPRECATED] XPackageMount](/ko/reference/system/xpackage/functions/xpackagemount.md)
- [Games-as-a-Service(GaaS) 지원](/ko/build/core-features/common/packaging/supporting-games-as-a-service.md)
- [XPackage](/ko/reference/system/xpackage/xpackage_members.md)
- [XStoreAcquireLicenseForPackageAsync](/ko/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [GDK용 Unity C# API 래퍼](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
