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

# XPersistentLocalStoragePromptUserForSpaceAsync

> XPersistentLocalStoragePromptUserForSpaceAsync

# XPersistentLocalStoragePromptUserForSpaceAsync

Allows titles to prompt users to free up a requested total number of Bytes of Growable Persistent Local Storage.

## Syntax

```cpp theme={null}
HRESULT XPersistentLocalStoragePromptUserForSpaceAsync(  
         uint64_t requestedBytes,  
         XAsyncBlock* asyncBlock  
)  
```

### Parameters

*requestedBytes*   \_In\_\
Type: uint64\_t

The total amount of space the title wishes to be made available for use.

*asyncBlock*   \_Inout\_\
Type: XAsyncBlock\*

An XAsyncBlock for monitoring the status of the asynchronous call.

### Return value

Type: [HRESULT](https://learn.microsoft.com/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

Returns **S\_OK** if successful; otherwise, returns an error code. For a list of error codes, see [Error Codes](/reference/errorcodes).

## Remarks

Prior to calling, titles should check free space availability by using [XPersistentLocalStorageGetSpaceInfo](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo).

The result of the request should be checked within the callback function by calling [XPersistentLocalStoragePromptUserForSpaceResult](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceresult). This is not a guarantee that the user freed the requested number of bytes; only that the user took action. Your game should query free space again using [XPersistentLocalStorageGetSpaceInfo](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo) when the user retries the operation that resulted in the space request. Result of the async operation is E\_ABORT if the user chose not to free up space.

Persistent Local Storage is not implemented on PC platforms.  Although present, this method should not be used on PC.

This is disabled on datacenter streaming servers. It will always return E\_ABORT when called on datacenter streaming servers.

## Requirements

**Header:** XPersistentLocalStorage.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Local storage on XBOX console](/build/console-features/storage/local-storage)

## See also

[XPersistentLocalStorage](/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members)


## Related topics

- [XPersistentLocalStoragePromptUserForSpaceResult](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragepromptuserforspaceresult.md)
- [XPersistentLocalStorage](/reference/system/xpersistentlocalstorage/xpersistentlocalstorage_members.md)
- [XPersistentLocalStorageSpaceInfo](/reference/system/xpersistentlocalstorage/structs/xpersistentlocalstoragespaceinfo.md)
- [Unity C# API wrappers for the GDK](/build/gdk-and-engines/unity/unity-api-wrappers.md)
- [XPersistentLocalStorageGetSpaceInfo](/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetspaceinfo.md)
