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

# XtfRegisterPackageOnDrive

> XtfRegisterPackageOnDrive

Registers a package deployed on the specified drive.

## Syntax

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

### Parameters

*address*\
Type: LPCWSTR

\[in] The address of the console.

*packageFullName*\
Type: PCWSTR

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

*drive*\
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*\
Type: XtfPackageInfo\*

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

### Return value

Type: HRESULT

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

## 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](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m.md), [XtfGetCountofAppUserModelIds](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m.md), and [XtfGetAumid](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m.md) functions to get the package full name and Application User Model IDs (AUMIDs) for the registered package from the `XtfPackageInfo` object. Use [XtfClosePackageInfo](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfclosepackageinfo-xtfapi-xbox-windows-m.md) to free the `XtfPackageInfo` object when you are done with it.

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

## Requirements

**Header:** xtfapi.h

**Library:** XtfApi.lib

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

## See also

[Run from PC Deployment (NDA topic)](https://docs.xbox.com/home/setup-install/concepts/deployment.md)\
[XTF Transport Errors (NDA topic)](https://docs.xbox.com/tools/tools-console/commandlinetools/xtf-transport-errors.md)\
[Additional Xtf APIs](https://docs.xbox.com/reference/tools/xtf/xtfapi/atoc-xtfapi.md)


## Related topics

- [Additional Xtf APIs (API contents)](https://docs.xbox.com/reference/tools/xtf/xtfapi/atoc-xtfapi.md)
- [XtfRegisterAllPackagesOnDrive](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfregisterallpackagesondrive-xtfapi-xbox-windows-m.md)
- [XtfRegisterPackage](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfregisterpackage-xtfapi-xbox-windows-m.md)
- [XtfRegisterNetworkSharePackage](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfregisternetworksharepackage-xtfapi-xbox-windows-m.md)
- [XtfUnregisterPackage](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfunregisterpackage-xtfapi-xbox-windows-m.md)
