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

# XtfRegisterPackage

> XtfRegisterPackage

# XtfRegisterPackage

Registers a package deployed to the title scratch drive.

<a id="syntaxSection" />

## Syntax

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

<a id="parametersSection" />

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

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

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

[XTF Transport Errors (NDA topic)](/tools/tools-console/commandlinetools/xtf-transport-errors)\
[Additional Xtf APIs](/reference/tools/xtf/xtfapi/atoc-xtfapi)


## Related topics

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