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

# XStoreUnregisterPackageLicenseLost

> XStoreUnregisterPackageLicenseLost

# XStoreUnregisterPackageLicenseLost

取消注册指定的商店许可证丢失回调。

## 语法

```cpp theme={null}
bool XStoreUnregisterPackageLicenseLost(  
         XStoreLicenseHandle licenseHandle,  
         XTaskQueueRegistrationToken token,  
         bool wait  
)  
```

### 参数

*licenseHandle*   \_In\_\
类型：XStoreLicenseHandle

与回调关联的许可证句柄。

*token*   \_In\_\
类型：[XTaskQueueRegistrationToken](/reference/system/xtaskqueue/structs/xtaskqueueregistrationtoken)

标识要取消注册的回调的令牌。

*wait*   \_In\_\
类型：bool

等待任何待处理的事件回调完成。

### 返回值

类型：bool

如果 *wait* 为 false 且回调正在等待取消注册，则返回 false。
否则返回 true。

## 备注

<Note>在时间敏感型线程上调用此函数不安全。
有关详细信息，请参阅[时间敏感型线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。</Note>

此函数取消注册由 [XStorePackageLicenseLostCallback](/reference/system/xstore/functions/xstorepackagelicenselostcallback) 定义的回调函数。
使用 [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost) 生成的相同 **XTaskQueueRegistrationToken** 来取消注册回调函数。
为避免内存泄漏，每个使用 [XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost) 注册的函数在不再需要回调函数时必须通过 **XStoreUnregisterPackageLicenseLost** 取消注册。

有关使用示例，请参阅 [XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync)。

## 要求

**头文件：** XStore.h（包含在 XGameRuntime.h 中）

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念文档

* [时间敏感型线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)
* [授予玩家访问加载项内容的权限](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)\
[XStoreAcquireLicenseForPackageAsync](/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync)\
[XStoreAcquireLicenseForPackageResult](/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult)\
[XStoreIsLicenseValid](/reference/system/xstore/functions/xstoreislicensevalid)\
[XStoreCloseLicenseHandle](/reference/system/xstore/functions/xstorecloselicensehandle)\
[XStoreRegisterPackageLicenseLost](/reference/system/xstore/functions/xstoreregisterpackagelicenselost)\
[XStorePackageLicenseLostCallback](/reference/system/xstore/functions/xstorepackagelicenselostcallback)\
[授予玩家访问加载项内容的权限](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)


## Related topics

- [XStorePackageLicenseLostCallback](/zh-CN/reference/system/xstore/functions/xstorepackagelicenselostcallback.md)
- [XStoreRegisterPackageLicenseLost](/zh-CN/reference/system/xstore/functions/xstoreregisterpackagelicenselost.md)
- [XStoreAcquireLicenseForPackageResult](/zh-CN/reference/system/xstore/functions/xstoreacquirelicenseforpackageresult.md)
- [XStoreCloseLicenseHandle](/zh-CN/reference/system/xstore/functions/xstorecloselicensehandle.md)
- [XStoreIsLicenseValid](/zh-CN/reference/system/xstore/functions/xstoreislicensevalid.md)
