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

# XtfRegisterPackageOnDrive

> XtfRegisterPackageOnDrive

# XtfRegisterPackageOnDrive

注册部署到指定驱动器上的包。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
HRESULT XtfRegisterPackageOnDrive(
         LPCWSTR address,
         PCWSTR packageFullName,
         DWORD drive,
         XtfPackageInfo* packageInfo
)  
```

<a id="parametersSection" />

### 参数

*address*<br />类型：LPCWSTR

\[in] 主机的地址。

*packageFullName*<br />类型：PCWSTR

\[in] 要注册的包的完整名称。

*drive*<br />类型：DWORD

\[in] 要在其上注册包的驱动器。此参数接受以下值：

| 值     | 描述               |
| ----- | ---------------- |
| 0     | 零售驱动器            |
| 1     | 开发驱动器            |
| 2 - 8 | 外部驱动器 1 到外部驱动器 7 |

*packageInfo*<br />类型：XtfPackageInfo\*

\[out] 有关已注册包的包信息对象。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数注册部署到指定驱动器（例如外部驱动器）的包，并将包信息作为 `XtfPackageInfo` 对象引用提供。使用 [XtfGetPackageFullName](/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m)、[XtfGetCountofAppUserModelIds](/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m) 和 [XtfGetAumid](/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m) 函数从 `XtfPackageInfo` 对象中获取已注册包的包完整名称以及应用程序用户模型 ID (AUMID)。使用完 `XtfPackageInfo` 对象后，请使用 [XtfClosePackageInfo](/reference/tools/xtf/xtfapi/functions/xtfclosepackageinfo-xtfapi-xbox-windows-m) 释放它。

有关管理应用程序的详细信息，请参阅[应用程序管理 (xbapp.exe) (NDA 主题)](/tools/tools-console/commandlinetools/xbapp)。

<a id="requirementsSection" />

## 要求

**头文件：** xtfapi.h

**库：** XtfApi.lib

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

<a id="seealsoSection" />

## 另请参阅

[Run from PC Deployment (NDA 主题)](/home/setup-install/concepts/deployment)<br />[XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[其他 Xtf API](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfRegisterAllPackagesOnDrive](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfregisterallpackagesondrive-xtfapi-xbox-windows-m.md)
- [XtfRegisterPackage](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m.md)
- [XtfRegisterNetworkSharePackage](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m.md)
- [XtfUnregisterPackage](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfunregisterpackage-xtfapi-xbox-windows-m.md)
- [XtfGetPackageFullName](/zh-CN/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m.md)
