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

# XStoreQueryProductForPackageAsync

> XStoreQueryProductForPackageAsync

# XStoreQueryProductForPackageAsync

지정된 패키지의 스토어 제품 정보를 검색합니다.

## 구문

```cpp theme={null}
HRESULT XStoreQueryProductForPackageAsync(  
         const XStoreContextHandle storeContextHandle,  
         XStoreProductKind productKinds,  
         const char* packageIdentifier,  
         XAsyncBlock* async  
)  
```

### 매개 변수

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

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

*productKinds*   \_In\_\
형식: [XStoreProductKind](/reference/system/xstore/enums/xstoreproductkind)

찾을 제품의 형식입니다.

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

스토어 패키지를 고유하게 식별하는 문자열입니다. 패키지 식별자에 대한 자세한 내용은 [다운로드 가능 콘텐츠(DLC) 관리 및 라이선싱](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)을 참조하세요.

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

## 설명

이 함수의 실행 결과와 스토어 제품 정보를 검색하려면 이 함수를 호출한 후 [XStoreQueryProductForPackageResult](/reference/system/xstore/functions/xstorequeryproductforpackageresult)를 호출합니다.

다음 코드 조각은 패키지에 대한 제품 정보를 검색하는 예를 보여줍니다.

```cpp theme={null}
void CALLBACK QueryProductForPackageCallback(XAsyncBlock* asyncBlock)
{
    XStoreProductQueryHandle queryHandle = nullptr;

    HRESULT hr = XStoreQueryProductForPackageResult(
        asyncBlock,
        &queryHandle);

    if (FAILED(hr))
    {
        printf("Failed retrieve the product query handle: 0x%x\r\n", hr);
        XStoreCloseProductsQueryHandle(queryHandle);
        return;
    }

    // Use result of query

     XStoreCloseProductsQueryHandle(queryHandle);
}

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

    XStoreProductKind allProductKinds =
        XStoreProductKind::Consumable |
        XStoreProductKind::Durable |
        XStoreProductKind::Game |
        XStoreProductKind::Pass |
        XStoreProductKind::UnmanagedConsumable;

    HRESULT hr = XStoreQueryProductForPackageAsync(
        storeContextHandle,
        allProductKinds,
        packageIdentifier,
        asyncBlock.get());

    if (FAILED(hr))
    {
        printf("Failed to get product for package: 0x%x\r\n", hr);
        return;
    }
}


```

## 요구 사항

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

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

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

## 참고 항목

[XStore](/reference/system/xstore/xstore_members)\
[XStoreQueryProductForPackageResult](/reference/system/xstore/functions/xstorequeryproductforpackageresult)\
[XStoreQueryAssociatedProductsAsync](/reference/system/xstore/functions/xstorequeryassociatedproductsasync)\
[XStoreQueryEntitledProductsAsync](/reference/system/xstore/functions/xstorequeryentitledproductsasync)\
[XStoreQueryProductsAsync](/reference/system/xstore/functions/xstorequeryproductsasync)\
[XStoreQueryProductForCurrentGameAsync](/reference/system/xstore/functions/xstorequeryproductforcurrentgameasync)\
[XStoreQueryProductForPackageAsync](/reference/system/xstore/functions/xstorequeryproductforpackageasync)


## Related topics

- [XStoreQueryProductForPackageResult](/ko/reference/system/xstore/functions/xstorequeryproductforpackageresult.md)
- [XStoreQueryProductsAsync](/ko/reference/system/xstore/functions/xstorequeryproductsasync.md)
- [XStoreQueryProductForCurrentGameAsync](/ko/reference/system/xstore/functions/xstorequeryproductforcurrentgameasync.md)
- [XStoreQueryAssociatedProductsForStoreIdResult](/ko/reference/system/xstore/functions/xstorequeryassociatedproductsforstoreidresult.md)
- [XStoreProductKind](/ko/reference/system/xstore/enums/xstoreproductkind.md)
