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

# XStoreGetUserPurchaseIdResultSize

> XStoreGetUserPurchaseIdResultSize

# XStoreGetUserPurchaseIdResultSize

获取 [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult) 返回的结果的大小。

## 语法

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

### 参数

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

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

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

成功时返回 [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult) 将返回的结果大小。

### 返回值

类型：HRESULT

HRESULT 成功或错误代码。

## 备注

此结果函数使你能够检索调用 [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult) 时购买 ID 的大小。因此，此函数应在调用 [XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult) 之后调用，通常在回调函数的上下文中。有关用法示例，请参阅 [XStoreGetUserPurchaseIdAsync](/reference/system/xstore/functions/xstoregetuserpurchaseidasync)。

## 要求

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

**库：** xgameruntime.lib

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

## 另请参阅

[XStore](/reference/system/xstore/xstore_members)\
[XStoreGetUserPurchaseIdAsync](/reference/system/xstore/functions/xstoregetuserpurchaseidasync)\
[XStoreGetUserPurchaseIdResult](/reference/system/xstore/functions/xstoregetuserpurchaseidresult)


## Related topics

- [XStore](/zh-CN/reference/system/xstore/xstore_members.md)
- [面向 GDK 的 Unity C# API 包装器](/zh-CN/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XStoreGetUserPurchaseIdResult](/zh-CN/reference/system/xstore/functions/xstoregetuserpurchaseidresult.md)
- [XStoreGetUserPurchaseIdAsync](/zh-CN/reference/system/xstore/functions/xstoregetuserpurchaseidasync.md)
- [XStoreGetUserCollectionsIdResultSize](/zh-CN/reference/system/xstore/functions/xstoregetusercollectionsidresultsize.md)
