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

# 获取 Title Storage 服务配置的配额信息

> 通过 XblTitleStorageGetQuotaAsync 检索 XBOX Title Storage 中指定服务配置和存储类型的配额及已用字节的扁平 C 代码示例。

本主题演示如何使用以下扁平 C 代码示例获取 XBOX Title Storage 中指定服务配置和存储类型的配额信息。

<Note>对于 `TrustedPlatform ` 存储类型,请求是针对调用玩家的 XBOX 用户 ID 发出的。</Note>

#### Flat C

```cpp theme={null}
auto asyncBlock = std::make_unique<XAsyncBlock>();
asyncBlock->queue = queue;
asyncBlock->context = nullptr;
asyncBlock->callback = [](XAsyncBlock* asyncBlock)
{
    std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock };   // Take over ownership of XAsyncBlock*.
    size_t usedBytes;
    size_t quotaBytes;
    HRESULT hr = XblTitleStorageGetQuotaResult(asyncBlock, &usedBytes, &quotaBytes);
};

HRESULT hr = XblTitleStorageGetQuotaAsync(
    xboxLiveContext,
    scid,
    storageType,
    asyncBlock.get()
);

if (SUCCEEDED(hr))
{
    // The call succeeded, so release  std::unique_ptr ownership of XAsyncBlock* because
    // the callback takes over ownership. If the call fails, however, std::unique_ptr keeps
    // ownership and deletes XAsyncBlock*.
    asyncBlock.release();
}
```

## 另请参阅

[XAsyncBlock](/reference/system/xasync/structs/xasyncblock)

[XblTitleStorageGetQuotaAsync](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetquotaasync)

[XblTitleStorageGetQuotaResult](/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetquotaresult)


## Related topics

- [Title Storage 示例代码](/zh-CN/services/xbox-services/storage/title-storage/how-to/live-title-storage-howto-nav.md)
- [XblTitleStorageGetQuotaAsync](/zh-CN/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetquotaasync.md)
- [操作指南](/zh-CN/services/xbox-services/storage/title-storage/how-to/index.md)
- [服务 C API 概览 - PFServiceConfig.h](/zh-CN/services/playfab/api-references/c/pfserviceconfig/pfserviceconfig_members.md)
- [获取基于事件的统计信息](/zh-CN/services/xbox-services/player-data/stats-leaderboards/event-based/how-to/live-getting-eb-stat.md)
