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

# XStoreCanAcquireLicenseForStoreIdAsync

> XStoreCanAcquireLicenseForStoreIdAsync

# XStoreCanAcquireLicenseForStoreIdAsync

패키지가 있거나 없는 Durable 및 현재 삽입된 디스크의 콘텐츠를 포함하여 라이선스가 부여 가능한 콘텐츠에 대한 미리 보기 라이선스를 검색합니다.
이 API를 사용하면 게임이 실제로 라이선스를 획득하지 않고도 제품에 라이선스를 부여할 수 있는지 확인할 수 있습니다.

## 구문

```cpp theme={null}
HRESULT XStoreCanAcquireLicenseForStoreIdAsync(  
         const XStoreContextHandle storeContextHandle,  
         const char* storeProductId,  
         XAsyncBlock* async  
)  
```

### 매개 변수

*storeContextHandle*   \_In\_\
형식: XStoreContextHandle

[XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext)가 반환한 사용자의 스토어 컨텍스트 핸들입니다.

*storeProductId*   \_In\_z\_\
형식: char\*

확인할 제품의 StoreID

*async*   \_Inout\_\
형식: [XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

수행 중인 비동기 작업을 정의하는 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)입니다.
[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)을 사용하여 호출의 상태를 폴링하고 호출 결과를 검색할 수 있습니다.
자세한 내용은 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)을 참조하세요.

### 반환 값

형식: HRESULT

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

## 설명

**XStoreCanAcquireLicenseForStoreIdAsync**는 게임이 실제로 해당 라이선스를 획득하고 사용자의 동시성 슬롯을 사용하지 않고도 사용자가 특정 콘텐츠에 대한 라이선스를 획득할 수 있는지 확인할 수 있는 기능을 제공합니다.
이 함수는 현재 실행 중인 게임에는 이미 라이선스가 있으므로 사용할 필요가 없지만, 사용자가 동일한 게시자의 다른 게임 또는 콘텐츠를 소유하고 있는지 확인할 수 있습니다.
예를 들어 게임은 이 API를 사용하여 이전 버전의 게임(디지털 또는 삽입된 디스크에서)을 소유한 사용자에게 보상할지 또는 사용자에게 제품을 업셀할지 결정할 수 있습니다.

미리 보기 라이선스와 이 함수의 실행 결과를 검색하려면 이 함수를 호출한 후 [XStoreCanAcquireLicenseForStoreIdResult](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidresult)를 호출합니다.

이 코드 조각은 다음 API 사용의 예를 보여 줍니다.

* **XStoreCanAcquireLicenseForStoreIdAsync**
* [XStoreCanAcquireLicenseForStoreIdResult](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidresult)

```cpp theme={null}
void CALLBACK CanAcquireLicenseForStoreIdCallback(XAsyncBlock* asyncBlock)
{
    XStoreCanAcquireLicenseResult canAcquireLicenseResult{};

    HRESULT hr = XStoreCanAcquireLicenseForStoreIdResult(
        asyncBlock,
        &canAcquireLicenseResult);

    if (FAILED(hr))
    {
        printf("Failed retrieve the license result: 0x%x\r\n", hr);
        return;
    }

    printf("status       : %d\r\n", canAcquireLicenseResult.status);
    printf("licensableSku: %s\r\n", canAcquireLicenseResult.licensableSku);
}

void CanAcquireLicenseForStoreId(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle, const char* storeId)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = CanAcquireLicenseForStoreIdCallback;

    HRESULT hr = XStoreCanAcquireLicenseForStoreIdAsync(
        storeContextHandle,
        storeId,
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to get preview license for store ID: 0x%x\r\n", hr);
        return;
    }
}
```

## 요구 사항

**헤더:** XStore.h(XGameRuntime.h에 포함됨)

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

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

## 개념 설명서

* [Granting players access to add-on content](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)
* [Manage and license downloadable content (DLC)](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)
* [Enabling licensing testing](/publishing/xstore-commerce/xstore-licensing-setup)

## 참고 항목

[XStore](/reference/system/xstore/xstore_members)\
[XStoreCanAcquireLicenseForStoreIdResult](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidresult)\
[How to use a durable without a package](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-dwobs)\
[Granting players access to add-on content](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)


## Related topics

- [XStoreCanAcquireLicenseForStoreIdResult](/ko/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidresult.md)
- [XStoreCanAcquireLicenseResult](/ko/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)
- [XStoreCanLicenseStatus](/ko/reference/system/xstore/enums/xstorecanlicensestatus.md)
- [라이선싱 테스트 활성화](/ko/publishing/xstore-commerce/xstore-licensing-setup.md)
- [플레이어에게 추가 기능 콘텐츠 액세스 부여](/ko/publishing/xstore-commerce/xstore-granting-access.md)
