> ## 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 のサンプル コード](/ja-jp/services/xbox-services/storage/title-storage/how-to/live-title-storage-howto-nav.md)
- [XblTitleStorageGetQuotaAsync](/ja-jp/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetquotaasync.md)
- [ハウツー](/ja-jp/services/xbox-services/storage/title-storage/how-to/index.md)
- [XBOX サービス Title Storage の概要](/ja-jp/services/xbox-services/storage/title-storage/live-title-storage-overview.md)
- [Services C API 概要 - PFServiceConfig.h](/ja-jp/services/playfab/api-references/c/pfserviceconfig/pfserviceconfig_members.md)
