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

# XStoreQueryPackageIdentifier

> XStoreQueryPackageIdentifier

# XStoreQueryPackageIdentifier

指定されたストア ID のパッケージ識別子を取得します。

<a id="syntaxSection" />

## 構文

```cpp theme={null}
HRESULT XStoreQueryPackageIdentifier(
         const char* storeId,
         size_t size,
         char* packageIdentifier
)
```

<a id="parametersSection" />

### パラメーター

*storeId*   \_In\_z\_\
Type: char\*

パッケージを含む製品のストア内の ID。

*size*   \_In\_\
Type: size\_t

パッケージ識別子の文字数。このサイズは、少なくとも XPACKAGE\_IDENTIFIER\_MAX\_LENGTH (33) 以上である必要があります。

*packageIdentifier*   \_Out\_writes\_z\_(size)\
Type: char\*

成功時に、パッケージ識別子が格納されます。パッケージ識別子の詳細については、[ダウンロード可能なコンテンツ (DLC) の管理とライセンス](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-manage-and-license-optional-packages)を参照してください。

<a id="retvalSection" />

### 戻り値

Type: HRESULT

成功した場合は **S\_OK** を返します。それ以外の場合はエラー コードを返します。

| エラー コード                   | 説明                              |
| ------------------------- | ------------------------------- |
| 0x80070057 `E_INVALIDARG` | ストア ID に対応するインストール済みパッケージがありません |

<a id="remarksSection" />

## 解説

指定されたストア パッケージをダウンロードしてインストールするには、[XStoreDownloadAndInstallPackagesAsync](/reference/system/xstore/functions/xstoredownloadandinstallpackagesasync) を呼び出します。

`XStoreDownloadAndInstallPackagesAsync` の呼び出し結果を取得するには、[XStoreDownloadAndInstallPackagesResult](/reference/system/xstore/functions/xstoredownloadandinstallpackagesresult) を呼び出します。

`XStoreDownloadAndInstallPackagesResult` から返される結果内の項目の数を取得するには、[XStoreDownloadAndInstallPackagesResultCount](/reference/system/xstore/functions/xstoredownloadandinstallpackagesresultcount) を呼び出します。

<a id="requirementsSection" />

## 要件

**ヘッダー:** XStore.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One 本体および XBOX Series 本体

<a id="seealsoSection" />

## 関連項目

[XStore](/reference/system/xstore/xstore_members)


## Related topics

- [XStore](/ja-jp/reference/system/xstore/xstore_members.md)
- [GDK 向け Unity C# API ラッパー](/ja-jp/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStoreQueryPackageUpdatesAsync](/ja-jp/reference/system/xstore/functions/xstorequerypackageupdatesasync.md)
- [XStoreQueryProductForPackageAsync](/ja-jp/reference/system/xstore/functions/xstorequeryproductforpackageasync.md)
- [XStoreQueryProductForPackageResult](/ja-jp/reference/system/xstore/functions/xstorequeryproductforpackageresult.md)
