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

# XStoreCanAcquireLicenseForStoreIdResult

> XStoreCanAcquireLicenseForStoreIdResult

# XStoreCanAcquireLicenseForStoreIdResult

获取对 [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync) 调用的结果。

## 语法

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

### 参数

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

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

*storeCanAcquireLicense*   \_Out\_\
类型：[XStoreCanAcquireLicenseResult\*](/reference/system/xstore/structs/xstorecanacquirelicenseresult)

返回时，检查结果的 status 以确认用户是否可获取该产品的许可证。
可为游戏和 Durables（无论是否带包）调用此 API。
如果可通过插入的光盘获取产品许可证，它也会返回结果。
结果包含用户可获取许可证的 SKU。
对于用户可通过光盘获取许可证的内容，SKU 为 "DISC"。

### 返回值

类型：HRESULT

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

`XStoreCanAcquireLicenseForStoreIdResult` 函数返回以下错误代码：

| 错误代码                                                    | 含义                                                 |
| ------------------------------------------------------- | -------------------------------------------------- |
| 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 次。 |

## 备注

此函数检索 [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync) 的执行结果，如果执行成功，还会检索该函数请求的预览许可证。
通常在回调函数的上下文中，于 [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync) 之后调用此函数。
有关用法示例，请参阅 [XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync)。

## 要求

**头文件：** 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)

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)\
[XStoreCanAcquireLicenseForStoreIdAsync](/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync)\
[如何使用不带包的 Durable](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-dwobs)\
[向玩家授予附加内容的访问权限](https://learn.microsoft.com/gaming/gdk/docs/store/commerce/fundamentals/xstore-granting-access-to-content)


## Related topics

- [XStoreCanAcquireLicenseResult](/zh-CN/reference/system/xstore/structs/xstorecanacquirelicenseresult.md)
- [XStoreCanAcquireLicenseForStoreIdAsync](/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforstoreidasync.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)
- [XStoreCanAcquireLicenseForPackageResult](/zh-CN/reference/system/xstore/functions/xstorecanacquirelicenseforpackageresult.md)
