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

Registers a package deployed on the specified drive.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

### Parameters

*address*<br />Type: LPCWSTR

\[in] The address of the console.

*packageFullName*<br />Type: PCWSTR

\[in] The package full name of the package to register.

*drive*<br />Type: DWORD

\[in] The drive to register the package on. This parameter accepts the following values:

| Value | Description                               |
| ----- | ----------------------------------------- |
| 0     | Retail drive                              |
| 1     | Development drive                         |
| 2 - 8 | External drive 1 through external drive 7 |

*packageInfo*<br />Type: XtfPackageInfo\*

\[out] Package information object about the package that was registered.

<a id="retvalSection" />

### Return value

Type: HRESULT

Returns `S_OK` if successful; otherwise, returns an HRESULT error code.

<a id="remarksSection" />

## Remarks

This function registers a package deployed to a specified drive, such as an external drive, and provides package information as an `XtfPackageInfo` object reference. Use the [XtfGetPackageFullName](/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m), [XtfGetCountofAppUserModelIds](/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m), and [XtfGetAumid](/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m) functions to get the package full name and Application User Model IDs (AUMIDs) for the registered package from the `XtfPackageInfo` object. Use [XtfClosePackageInfo](/reference/tools/xtf/xtfapi/functions/xtfclosepackageinfo-xtfapi-xbox-windows-m) to free the `XtfPackageInfo` object when you are done with it.

For more information about managing applications, see [Application Management (xbapp.exe) (NDA topic)](/tools/tools-console/commandlinetools/xbapp).

<a id="requirementsSection" />

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

**Supported platforms:** Windows (for XBOX console tools)

<a id="seealsoSection" />

## See also

[Run from PC Deployment (NDA topic)](/home/setup-install/concepts/deployment)<br />[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)<br />[Additional Xtf APIs](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

- [XtfRegisterAllPackagesOnDrive](/reference/tools/xtf/xtfapi/functions/xtfregisterallpackagesondrive-xtfapi-xbox-windows-m.md)
- [XtfRegisterPackage](/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m.md)
- [XtfRegisterNetworkSharePackage](/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m.md)
- [XtfUnregisterPackage](/reference/tools/xtf/xtfapi/functions/xtfunregisterpackage-xtfapi-xbox-windows-m.md)
- [IXtfApplicationClient::DeployEx](/reference/tools/xtf/xtfapplication/classes/IXtfApplicationClient/methods/ixtfapplicationclient-deployex.md)
