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

# XtfGetAumid

> XtfGetAumid

# XtfGetAumid

從套件資訊物件取得位於指定索引處的應用程式使用者模型識別碼 (AUMID)。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
HRESULT XtfGetAumid(
         XtfPackageInfo packageInfo,
         UINT32 aumidIndex,
         PWSTR aumid,
         UINT32 *aumidBufferLength
)  
```

<a id="parametersSection" />

### 參數

*packageInfo*\
類型: XtfPackageInfo

\[in] 套件之資訊物件的指標。

*aumidIndex*\
類型: UINT32

\[in] 套件中 AUMID 的索引。

*aumid*\
類型: PWSTR

\[out, optional] 套件中位於 `aumidIndex` 所指定索引處的 AUMID。

*aumidBufferLength*\
類型: UINT32 \*

\[in, out] 為 `aumid` 配置的長度 (以 **WCHAR** 為單位)。

<a id="retvalSection" />

### 傳回值

類型: HRESULT

如果成功，會傳回 `S_OK`。如果 `aumid` 不夠大，此函式會傳回 `HRESULT_FROM_WIN32(ERROR_MORE_DATA)`，並在 `aumidBufferLength` 中傳回所需的緩衝區長度。

<a id="remarksSection" />

## 備註

使用此函式可從已註冊套件的資訊物件，取得位於 `aumidIndex` 所指定索引處的 AUMID。呼叫 [XtfRegisterPackage](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m) 或 [XtfRegisterNetworkSharePackage](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m) 函式註冊套件時，會傳回套件資訊物件的指標。

呼叫此函式之前，請使用 [XtfGetcountofAppUserModelIds](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m) 函式取得套件的 AUMID 數目。如果您在 `aumidIndex` 中指定的值等於或大於 `XtfGetcountofAppUserModelIds` 所傳回的值，就會發生錯誤。同樣地，如果在 `aumidIndex` 所指定的索引處沒有可擷取的資料，也會發生錯誤。

您也可以使用 [XtfGetPackageFullName](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m) 函式擷取已註冊套件的完整名稱。如需套件的詳細資訊，請參閱[封裝](/zh-TW/build/core-features/common/packaging/gc-packaging-toc)。

<a id="requirements" />

## 需求

**標頭:** xtfapi.h

**程式庫:** XtfApi.lib

**支援的平台:** Windows (適用於 XBOX 主機工具)

<a id="seealsoSection" />

## 另請參閱

[XTF 傳輸錯誤 (NDA 主題)](/zh-TW/tools/tools-console/commandlinetools/xtf-transport-errors)\
[XtfRegisterPackage](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m)\
[XtfRegisterNetworkSharePackage](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m)\
[其他 Xtf API](/zh-TW/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfGetTitleOSState](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgettitleosstate-xtfapi-xbox-windows-m.md)
- [XtfGetTitleOSFourPartVersion](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgettitleosfourpartversion-xtfapi-xbox-windows-m.md)
- [XtfGetCountofAppUserModelIds](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m.md)
- [XtfGetPackageFullName](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m.md)
- [XtfRegisterNetworkSharePackage](/zh-TW/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m.md)
