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

# XtfRegisterPackage

> XtfRegisterPackage

Registers a package deployed to the title scratch drive.

## Syntax

```cpp theme={null}
HRESULT XtfRegisterPackage(
         LPCWSTR address,
         LPCWSTR titleScratchRelativePath,
         XtfPackageInfo* packageInfo
)  
```

### Parameters

*address*\
Type: LPCWSTR

\[in] The address of the console.

*titleScratchRelativePath*\
Type: LPCWSTR

\[in] The relative path on the title scratch drive of the package to register.

*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 the title scratch 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.

You can also use [XtfUnregisterPackage](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfunregisterpackage-xtfapi-xbox-windows-m.md) to unregister a package. 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

[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

- [XtfUnregisterPackage](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfunregisterpackage-xtfapi-xbox-windows-m.md)
- [XtfGetPackageFullName](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetpackagefullname-xtfapi-xbox-windows-m.md)
- [XtfGetAumid](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetaumid-xtfapi-xbox-windows-m.md)
- [XtfGetCountofAppUserModelIds](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfgetcountofappusermodelids-xtfapi-xbox-windows-m.md)
- [XtfClosePackageInfo](https://docs.xbox.com/reference/tools/xtf/xtfapi/functions/xtfclosepackageinfo-xtfapi-xbox-windows-m.md)
