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

从包信息对象中获取指定索引处的应用程序用户模型 ID (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](/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m) 或 [XtfRegisterNetworkSharePackage](/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m) 函数注册包时，会返回指向包信息对象的指针。

在调用此函数之前，请使用 [XtfGetcountofAppUserModelIds](/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m) 函数获取包中 AUMID 的数量。如果在 `aumidIndex` 中指定的值等于或大于 `XtfGetcountofAppUserModelIds` 返回的值，则会发生错误。同样，如果在 `aumidIndex` 指定的索引处没有可检索的数据，也会发生错误。

你还可以使用 [XtfGetPackageFullName](/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m) 函数检索已注册包的完整名称。有关包的更多信息，请参阅 [打包](/build/core-features/common/packaging/gc-packaging-toc)。

<a id="requirements" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[XtfRegisterPackage](/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m)\
[XtfRegisterNetworkSharePackage](/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m)\
[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

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