> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XStoreCanAcquireLicenseForPackageResult

> XStoreCanAcquireLicenseForPackageResult

# XStoreCanAcquireLicenseForPackageResult

获取对 [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md) 调用的结果。

## 语法

```cpp theme={null}
HRESULT XStoreCanAcquireLicenseForPackageResult(  
         XAsyncBlock* async,  
         XStoreCanAcquireLicenseResult* storeCanAcquireLicense  
)  
```

### 参数

*async*   \_Inout\_\
类型：[XAsyncBlock\*](https://docs.xbox.com/zh-CN/reference/system/xasync/structs/xasyncblock.md)

传递给 [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md) 的 XAsyncBlock。
使用 [XAsyncBlock](https://docs.xbox.com/zh-CN/reference/system/xasync/structs/xasyncblock.md) 检查调用状态并获取结果。有关详细信息，请参阅 [XAsyncBlock](https://docs.xbox.com/zh-CN/reference/system/xasync/structs/xasyncblock.md)。

*storeCanAcquireLicense*   \_Out\_\
类型：[XStoreCanAcquireLicenseResult\*](https://docs.xbox.com/zh-CN/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)

指示是否可以获取许可证以及用户可以获取哪个 SKU 的许可证的结构。

### 返回值

类型：HRESULT

成功时返回 S\_OK；否则返回错误代码。

**XStoreCanAcquireLicenseForPackageResult** 函数可能返回以下错误代码：

| 错误代码 | 含义 |
| - | - |
| 0x87E10BC6 `LM_E_CONTENT_NOT_IN_CATALOG` | 在目录中找不到该产品。 |
| 0x803F8001 `LM_E_CONTENT_NOT_OWNED` | 未拥有该产品。 |
| 0x803F8008 `LM_E_PREDOWNLOAD_LICENSE_NOT_YET_AVAILABLE` | 已拥有该产品，但由于尚未发布而无法授予许可证。 |
| 0x803F9006 `LM_E_ENTITLED_USER_SIGNED_OUT` | 产品的拥有者未登录。 |
| 0x89245305 `E_GAMESTORE_LICENSE_ACTION_THROTTLED` | 游戏对产品的许可证请求过于频繁，现已受到限流。同一产品在 10 分钟内的许可证请求上限为 30 次。 |

## 备注

此结果函数检索 [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md) 的执行结果，如果执行成功，还会检索预览许可证。
通常在回调函数的上下文中，于 [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md) 之后调用此函数。
有关详细信息，请参阅 [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md)。

## 要求

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

**库：** xgameruntime.lib

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

## 概念文档

* [向玩家授予附加内容的访问权限](https://docs.xbox.com/zh-CN/publishing/xstore-commerce/xstore-granting-access.md)

## 另请参阅

[XStore](https://docs.xbox.com/zh-CN/reference/system/xstore/xstore_members.md)\
[XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md)\
[管理和授权可下载内容 (DLC)](https://docs.xbox.com/zh-CN/publishing/xstore-commerce/xstore-dlc.md)


## Related topics

- [XStoreCanAcquireLicenseResult](https://docs.xbox.com/zh-CN/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)
- [XStoreCanAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageasync.md)
- [XStoreAcquireLicenseForPackageAsync](https://docs.xbox.com/zh-CN/reference/system/xstore/functions/xstoreacquirelicenseforpackageasync.md)
- [XStore（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xstore/xstore_members.md)
- [在 Unity 项目中使用 GDK API 的 C# 包装器](https://docs.xbox.com/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
