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

擷取指定市集識別碼的套件識別碼。

<a id="syntaxSection" />

## 語法

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

<a id="parametersSection" />

### 參數

*storeId*   \_In\_z\_\
類型：char\*

包含該套件之產品在市集中的識別碼。

*size*   \_In\_\
類型：size\_t

套件識別碼中的字元數。此大小必須至少為 XPACKAGE\_IDENTIFIER\_MAX\_LENGTH (33)
。

*packageIdentifier*   \_Out\_writes\_z\_(size)\
類型：char\*

成功時，包含套件識別碼。如需套件識別碼的詳細資訊，請參閱[管理可下載內容 (DLC) 並授權](/zh-TW/publishing/xstore-commerce/xstore-dlc)。

<a id="retvalSection" />

### 傳回值

類型：HRESULT

成功時傳回 **S\_OK**，否則傳回錯誤碼。

| 錯誤碼 | 描述 |
| - | - |
| 0x80070057 `E_INVALIDARG` | 沒有對應至該市集識別碼的已安裝套件 |

<a id="remarksSection" />

## 備註

若要下載並安裝指定的市集套件，請呼叫 [XStoreDownloadAndInstallPackagesAsync](/zh-TW/reference/system/xstore/functions/xstoredownloadandinstallpackagesasync)。

若要取得呼叫 `XStoreDownloadAndInstallPackagesAsync` 的結果，請呼叫 [XStoreDownloadAndInstallPackagesResult](/zh-TW/reference/system/xstore/functions/xstoredownloadandinstallpackagesresult)。

若要取得 `XStoreDownloadAndInstallPackagesResult` 傳回之結果中的項目數，請呼叫 [XStoreDownloadAndInstallPackagesResultCount](/zh-TW/reference/system/xstore/functions/xstoredownloadandinstallpackagesresultcount)。

<a id="requirementsSection" />

## 需求

**標頭：** XStore.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

<a id="seealsoSection" />

## 另請參閱

[XStore](/zh-TW/reference/system/xstore/xstore_members)


## Related topics

- [XStoreQueryPackageIdentifier](/reference/system/xstore/functions/xstorequerypackageidentifier.md)
- [XStore](/reference/system/xstore/xstore_members.md)
- [XStoreQueryPackageUpdatesAsync](/reference/system/xstore/functions/xstorequerypackageupdatesasync.md)
