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

# Obter informações de cota de uma configuração de serviço do Title Storage

> Exemplo de código C simples para recuperar a cota e os bytes usados do Title Storage do XBOX para uma configuração de serviço e um tipo de armazenamento por meio de XblTitleStorageGetQuotaAsync.

Este tópico demonstra como obter informações de cota para uma configuração de serviço e um tipo de armazenamento especificados no Title Storage do XBOX usando o exemplo de código C simples a seguir.

<Note>Para os tipos de armazenamento `TrustedPlatform `, a solicitação é feita para a ID de usuário XBOX do jogador chamador.</Note>

#### C simples

```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();
}
```

## Veja também

[XAsyncBlock](/pt-BR/reference/system/xasync/structs/xasyncblock)

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

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


## Related topics

- [Código de exemplo do Title Storage](/pt-BR/services/xbox-services/storage/title-storage/how-to/live-title-storage-howto-nav.md)
- [Instruções](/pt-BR/services/xbox-services/storage/title-storage/how-to/index.md)
- [Visão geral do Title Storage dos serviços XBOX](/pt-BR/services/xbox-services/storage/title-storage/live-title-storage-overview.md)
- [XblTitleStorageGetQuotaAsync](/pt-BR/reference/live/xsapi-c/title_storage_c/functions/xbltitlestoragegetquotaasync.md)
- [Title Storage](/pt-BR/services/xbox-services/storage/title-storage/index.md)
