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

# XGameSaveGetRemainingQuota

> XGameSaveGetRemainingQuota

# XGameSaveGetRemainingQuota

Returns the amount of data available to store using the **XGameSave** api.

## Syntax

```cpp theme={null}
HRESULT XGameSaveGetRemainingQuota(  
         XGameSaveProviderHandle provider,  
         int64_t* remainingQuota  
)  
```

### Parameters

*provider*   \_In\_\
Type: XGameSaveProviderHandle

Handle to the **XGameSaveProvider** to query remaining data for.

*remainingQuota*   \_Out\_\
Type: int64\_t\*

Amount of data available to be used as storage.

### Return value

Type: HRESULT

Function result.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

Each application has a quota on how much data they can save for a user, if this is exceeded any attempts to save more data may fail with **E\_GS\_QUOTA\_EXCEEDED**. As this is not a fixed size we have exposed access to the remaining quota so the application can try to avoid **E\_GS\_QUOTA\_EXCEEDED** failures. To give an accurate view we always make sure that any outstanding writes, updates or deletes are handled first before returning since any of these can change the remaining quota. It is recommended that you call this function to make sure there is a reasonable amount of data left to execute a call to [XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate).

```cpp theme={null}
void Sample::_GetQuotaSync(uint64_t* remainingQuota) 
{ 
    HRESULT hr = XGameSaveGetRemainingQuota(_provider, remainingQuota); 
    if (FAILED(hr)) 
    { 
        printf("Error retrieving Quota hr=0x%08x\n", hr); 
    } 
} 
```

## Requirements

**Header:** XGameSave.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## Conceptual documentation

* [Game Saves storage systems](/build/core-features/common/game-save/game-saves-storage-systems)
* [XGameSave API overview](/build/core-features/common/game-save/xgamesave)
* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XGameSave](/reference/system/xgamesave/xgamesave_members)\
[XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate)\
[Debugging Game Saves](/build/core-features/common/game-save/game-saves-debugging)


## Related topics

- [XGameSave API overview](/build/core-features/common/game-save/xgamesave.md)
- [XGameSave](/reference/system/xgamesave/xgamesave_members.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XGameSaveGetRemainingQuotaAsync](/reference/system/xgamesave/functions/xgamesavegetremainingquotaasync.md)
- [XGameSaveGetRemainingQuotaResult](/reference/system/xgamesave/functions/xgamesavegetremainingquotaresult.md)
