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

# XStoreQueryLicenseTokenResult

> XStoreQueryLicenseTokenResult

# XStoreQueryLicenseTokenResult

检索对 [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync) 调用的结果。有关详细信息，请参阅[许可证令牌概述](/publishing/xstore-commerce/xstore-license-tokens)。

## 语法

```cpp theme={null}
HRESULT XStoreQueryLicenseTokenResult(  
         XAsyncBlock* async,  
         size_t size,  
         char* result  
)  
```

### 参数

*async*   \_Inout\_\
类型：[XAsyncBlock\*](/reference/system/xasync/structs/xasyncblock)

传递给 [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync) 的 XAsyncBlock。可使用 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock) 轮询调用状态并检索调用结果。有关详细信息，请参阅 [XAsyncBlock](/reference/system/xasync/structs/xasyncblock)。

*size*   \_In\_\
类型：size\_t

传递到 **result** 的数组大小。

*result*   \_Out\_writes\_z\_(size)\
类型：char\*

成功时包含已检索的许可证令牌。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

此结果函数使你能够检索 [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync) 的执行结果，如果执行成功，还可以检索所请求的 JSON Web 令牌。因此，此函数应在调用 [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync) 之后调用，通常在回调函数的上下文中。

有关用法示例，请参阅 [XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync)。

## 要求

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

**库：** xgameruntime.lib

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

## 概念文档

* [向玩家授予附加内容的访问权限](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)
* [使用许可证令牌在你的服务上验证许可](/publishing/xstore-commerce/xstore-license-tokens)

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)

[许可证令牌概述](/publishing/xstore-commerce/xstore-license-tokens)

[XStoreQueryLicenseTokenAsync](/reference/system/xstore/functions/xstorequerylicensetokenasync)

[XStoreQueryLicenseTokenResultSize](/reference/system/xstore/functions/xstorequerylicensetokenresultsize)


## Related topics

- [XStoreQueryLicenseTokenResultSize](/zh-CN/reference/system/xstore/functions/xstorequerylicensetokenresultsize.md)
- [XStoreQueryLicenseTokenAsync](/zh-CN/reference/system/xstore/functions/xstorequerylicensetokenasync.md)
- [XStore](/zh-CN/reference/system/xstore/xstore_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStoreQueryGameLicenseResult](/zh-CN/reference/system/xstore/functions/xstorequerygamelicenseresult.md)
