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

# XPackageEnumerationCallback

> XPackageEnumerationCallback

# XPackageEnumerationCallback

The callback used by [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages) to enumerate each package.

## Syntax

```cpp theme={null}
bool XPackageEnumerationCallback(  
         void* context,  
         const XPackageDetails* details  
)  
```

### Parameters

*context*   \_In\_\
Type: void\*

The context passed to [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages) when enumeration of the package was initiated.

*details*   \_In\_\
Type: [XPackageDetails](/reference/system/xpackage/structs/xpackagedetails)\*

Pointer to an [XPackageDetails](/reference/system/xpackage/structs/xpackagedetails) structure that contains the installation information for the current package in the enumeration.

### Return value

Type: bool

Return true to continue enumerating packages, or false to stop the enumeration.

## Remarks

The **XPackageEnumerationCallback** callback is called for each package during the [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages) enumeration.

Both [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages) and [XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled) provide details about an installation, through an [XPackageDetails](/reference/system/xpackage/structs/xpackagedetails) structure. If the package is installing, the **installing** property of **XPackageDetails** is **true** and you can create an installation monitor, to let the package's identifier monitor progress.

There are no generic installation queue notifications; the intent is to use [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages) to show and track items in flight, and to use [XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled) to announce the presence of new DLC. Nor is there a mechanism to start, stop, or cancel an installation. From a game's perspective, the installation should take care of itself. Errors are automatically retried and are invisible to the game.

Example:

```cpp theme={null}
bool CALLBACK ListDlcCallback(
    void* /* context */,
    const XPackageDetails* details)
{
    printf("Found dlc: %s\n", details->displayName);
    return true; // continue enumerating
}

HRESULT ListDlc()
{
    HRESULT hr = XPackageEnumeratePackages(
        XPackageKind::Content,                      /* Looking for content packages (DLC) */
        XPackageEnumerationScope::ThisAndRelated,   /* For this game and related games*/
        nullptr, ListDlcCallback);
    return hr;
}
```

## Requirements

**Header:** XPackage.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc)

## See also

[XPackage](/reference/system/xpackage/xpackage_members)\
[How to create and use Downloadable Content Packages (DLC) for PC and XBOX One](/build/core-features/common/packaging/packaging-downloadable-content-dlc)\
[XPackageDetails](/reference/system/xpackage/structs/xpackagedetails)\
[XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages)\
[XPackageRegisterPackageInstalled](/reference/system/xpackage/functions/xpackageregisterpackageinstalled)


## Related topics

- [XPackageEnumeratePackages](/reference/system/xpackage/functions/xpackageenumeratepackages.md)
- [XPackageMountWithUiAsync](/reference/system/xpackage/functions/xpackagemountwithuiasync.md)
- [Manage and license downloadable content (DLC)](/publishing/xstore-commerce/xstore-dlc.md)
- [XPackage](/reference/system/xpackage/xpackage_members.md)
- [XPackageFeatureEnumerationCallback](/reference/system/xpackage/functions/xpackagefeatureenumerationcallback.md)
