> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XPackageGetCurrentProcessPackageIdentifier

> XPackageGetCurrentProcessPackageIdentifier

# XPackageGetCurrentProcessPackageIdentifier

傳回識別此處理程序之安裝的安裝身分識別字串。

## 語法

```cpp theme={null}
HRESULT XPackageGetCurrentProcessPackageIdentifier(  
         size_t bufferSize,  
         char* buffer  
)  
```

### 參數

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

*buffer* 參數中緩衝區的大小。

*buffer*   \_Out\_writes\_(bufferSize)\
類型：char\*

傳回時，包含識別此處理程序之安裝的安裝身分識別字串。

### 傳回值

類型：HRESULT

HRESULT 成功或錯誤碼。

## 備註

`XPackageGetCurrentProcessPackageIdentifier` 函式會傳回用來查詢此處理程序之安裝的套件識別碼字串。字串長度不得大於 `XPACKAGE_IDENTIFIER_MAX_LENGTH` 物件。如需套件識別碼的詳細資訊，請參閱[管理可下載內容 (DLC) 及授權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)。

請參考下列程式碼範例：

```cpp theme={null}
char id[XPACKAGE_IDENTIFIER_MAX_LENGTH];

HRESULT hr = XPackageGetCurrentProcessPackageIdentifier(_countof(id), id);
```

如需搭配 XBOX One 遊戲使用之封裝技術的資訊，請參閱[封裝概觀](https://docs.xbox.com/zh-TW/build/core-features/common/packaging/overviews/packaging.md)。如需建立 XVC 套件之步驟的資訊，請參閱[開始封裝 XBOX 主機遊戲](https://docs.xbox.com/zh-TW/build/core-features/common/packaging/overviews/packaging-getting-started-for-console.md)。

## 需求

**標頭：** XPackage.h

**程式庫：** xgameruntime.lib

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

## 概念文件

* [檢查更新](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-checking-updates.md)
* [管理可下載內容 (DLC) 及授權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)

## 另請參閱

[串流安裝與 Intelligent Delivery](https://docs.xbox.com/zh-TW/build/core-features/common/packaging/overviews/streaming_install-intelligent_delivery.md)\
[XPackage](https://docs.xbox.com/zh-TW/reference/system/xpackage/xpackage_members.md)


## Related topics

- [檢查更新](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-checking-updates.md)
- [管理可下載內容 (DLC) 並授權](https://docs.xbox.com/zh-TW/publishing/xstore-commerce/xstore-dlc.md)
- [XStoreQueryPackageUpdatesAsync](https://docs.xbox.com/zh-TW/reference/system/xstore/functions/xstorequerypackageupdatesasync.md)
- [XPackage (API 內容)](https://docs.xbox.com/zh-TW/reference/system/xpackage/xpackage_members.md)
- [在 Unity 專案中使用 GDK API 的 C# 包裝函式](https://docs.xbox.com/zh-TW/build/gdk-and-engines/unity/unity-api-wrappers.md)
