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

# XStoreRegisterGameLicenseChanged

> XStoreRegisterGameLicenseChanged

# XStoreRegisterGameLicenseChanged

Registra una devolución de llamada para el evento de cambio de licencia del título.
Esto solo se aplica a los cambios de la licencia del título en ejecución, y no a ninguna licencia de duraderos (DLC).

## Sintaxis

```cpp theme={null}
HRESULT XStoreRegisterGameLicenseChanged(  
         XStoreContextHandle storeContextHandle,  
         XTaskQueueHandle queue,  
         void* context,  
         XStoreGameLicenseChangedCallback* callback,  
         XTaskQueueRegistrationToken* token  
)  
```

### Parámetros

*storeContextHandle*   \_In\_\
Tipo: XStoreContextHandle

El identificador de contexto de la tienda para el usuario, devuelto por [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext).

*queue*   \_In\_\
Tipo: XTaskQueueHandle

Cola asincrónica para controlar el trabajo asincrónico.

*context*   \_In\_opt\_\
Tipo: void\*

Contexto definido por el juego que se pasará a la devolución de llamada.

*callback*   \_In\_\
Tipo: XStoreGameLicenseChangedCallback\*

La devolución de llamada que se va a registrar.

*token*   \_Out\_\
Tipo: [XTaskQueueRegistrationToken\*](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

Si se ejecuta correctamente, contiene un token que se usa para identificar la devolución de llamada.

### Valor devuelto

Tipo: HRESULT

Código HRESULT de éxito o de error.

## Comentarios

Esta función registra la función de devolución de llamada definida por [XStoreGameLicenseChangedCallback](/reference/system/xstore/functions/xstoregamelicensechangedcallback).
Se llamará a la función registrada cuando se produzca el siguiente evento de cambio de licencia del juego.
Este evento se produce cuando se realiza una compra relacionada con el juego actual en este dispositivo o cuando se actualiza la licencia del juego y el juego pasa de una licencia de prueba a una licencia completa.
La función registrada no se llamará por el propio acto de registro.
Para evitar una fuga de memoria, debe llamar a [XStoreUnregisterGameLicenseChanged](/reference/system/xstore/functions/xstoreunregistergamelicensechanged) cuando haya terminado con la función de devolución de llamada.

Consulte [XStoreCreateContext](/reference/system/xstore/functions/xstorecreatecontext) para ver un ejemplo de uso.

## Requisitos

**Encabezado:** XStore.h (incluido en XGameRuntime.h)

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** Windows, consolas de la familia XBOX One y consolas XBOX Series

## Documentación conceptual

* [Habilitación de las pruebas de licencias](/publishing/xstore-commerce/xstore-licensing-setup)

## Consulte también

[XStore](/reference/system/xstore/xstore_members)\
[XStoreGameLicenseChangedCallback](/reference/system/xstore/functions/xstoregamelicensechangedcallback)\
[XStoreUnregisterGameLicenseChanged](/reference/system/xstore/functions/xstoreunregistergamelicensechanged)


## Related topics

- [XStoreUnregisterGameLicenseChanged](/es/reference/system/xstore/functions/xstoreunregistergamelicensechanged.md)
- [XStoreGameLicenseChangedCallback](/es/reference/system/xstore/functions/xstoregamelicensechangedcallback.md)
- [XStoreCreateContext](/es/reference/system/xstore/functions/xstorecreatecontext.md)
- [Habilitación de las pruebas de licencias](/es/publishing/xstore-commerce/xstore-licensing-setup.md)
- [XTaskQueueRegistrationToken](/es/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken.md)
