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

# XStoreQueryAddOnLicensesAsync

> XStoreQueryAddOnLicensesAsync

# XStoreQueryAddOnLicensesAsync

디지털 게임 라이선스에 연결된 Durable 추가 기능의 라이선스를 열거합니다.
이는 패키지가 없는 Durable 형식에만 적용되며 디스크 라이선스가 아닌 디지털 라이선스에서만 사용할 수 있습니다.
디스크 라이선스로 이를 실행하면 사용자가 소유하거나 라이선스를 부여받을 수 있는 개별 durable이 존재하더라도 빈 결과가 반환됩니다.
디스크 시나리오의 경우 대신 [XStoreAcquireLicenseForDurablesAsync](/reference/system/xstore/functions/xstoreacquirelicensefordurablesasync)를 사용합니다.

## 구문

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

### 매개 변수

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

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

*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 성공 또는 오류 코드입니다.

## 설명

추가 기능 라이선스와 이 함수의 실행 결과를 검색하려면 이 함수를 호출한 후 [XStoreQueryAddonLicensesResult](/reference/system/xstore/functions/xstorequeryaddonlicensesresult)를 호출합니다.
이 함수로 얻은 라이선스의 수를 검색하려면 이 함수를 호출한 후 [XStoreQueryAddonLicensesResultCount](/reference/system/xstore/functions/xstorequeryaddonlicensesresultcount)를 호출합니다.
결과 카운트 함수는 결과 함수에 전달할 배열의 적절한 크기를 결정할 수 있게 해주므로 중요합니다.

다음 코드 조각은 사용자가 소유하거나 라이선스를 부여받을 수 있는 Durable 추가 기능 라이선스(패키지 없음)를 검색하는 예를 보여 줍니다.

```cpp theme={null}
void CALLBACK QueryAddOnLicensesCallback(XAsyncBlock* asyncBlock)
{
    uint32_t count;
    HRESULT hr = XStoreQueryAddOnLicensesResultCount(
        asyncBlock,
        &count);

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

    printf("Number of add-on licenses: %d", count);

    XStoreAddonLicense* addOnLicenses = new XStoreAddonLicense[count];
    hr = XStoreQueryAddOnLicensesResult(asyncBlock, count, &addOnLicenses);

    if (FAILED(hr))
    {
        printf("Failed retrieve the add-on licenses: 0x%x\r\n", hr);
        delete[] addOnLicenses;
        return;
    }

    for (uint32_t index = 0; index < count; index++)
    {
        printf("expirationDate : %d\r\n", addOnLicenses[index].expirationDate);
        printf("inAppOfferToken: %s\r\n", addOnLicenses[index].inAppOfferToken);
        printf("isActive       : %s\r\n", addOnLicenses[index].isActive ? "true" : "false");
        printf("skuStoreId     : %s\r\n", addOnLicenses[index].skuStoreId);
    }

    delete[] addOnLicenses;
}

void QueryAddOnLicenses(XStoreContextHandle storeContextHandle, XTaskQueueHandle taskQueueHandle)
{
    auto asyncBlock = std::make_unique<XAsyncBlock>();
    ZeroMemory(asyncBlock.get(), sizeof(*asyncBlock));
    asyncBlock->queue = taskQueueHandle;
    asyncBlock->callback = QueryAddOnLicensesCallback;

    HRESULT hr = XStoreQueryAddOnLicensesAsync(
        storeContextHandle,
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to get add-on licenses: 0x%x\r\n", hr);
        return;
    }
}


```

## 요구 사항

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

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

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

## 개념 설명서

* [Basic store operations](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-basic-store-operations)
* [Enabling licensing testing](/publishing/xstore-commerce/xstore-licensing-setup)

## 참고 항목

[XStore](/reference/system/xstore/xstore_members)\
[XStoreQueryAddonLicensesResult](/reference/system/xstore/functions/xstorequeryaddonlicensesresult)\
[XStoreQueryAddonLicensesResultCount](/reference/system/xstore/functions/xstorequeryaddonlicensesresultcount)


## Related topics

- [XStoreQueryAddOnLicensesResult](/ko/reference/system/xstore/functions/xstorequeryaddonlicensesresult.md)
- [라이선싱 테스트 활성화](/ko/publishing/xstore-commerce/xstore-licensing-setup.md)
- [기본 스토어 작업](/ko/publishing/xstore-commerce/xstore-basic-operations.md)
- [XStore](/ko/reference/system/xstore/xstore_members.md)
- [GDK용 Unity C# API 래퍼](/ko/build/gdk-and-engines/unity/unity-api-wrappers.md)
