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

# PFGameSaveFilesAddUserWithUiAsync

> Adds a user to the game save system. This downloads save state from the cloud as needed, and might trigger these UI callbacks: PFGameSaveFilesUiProgressCallback, PFGameSaveFilesUiSyncFailedCallback, PFGameSaveFilesUiActiveDeviceContentionCallback, PFGameSaveFilesUiConflictCallback, PFGameSaveFilesUiOutOfStorageCallback See PFGameSaveFilesSetUiCallbacks for more detail. PFGameSaveFilesInitialize must be called prior. On XBOX and Windows platforms, stock UI is provided by the system.

Adds a user to the game save system. This downloads save state from the cloud as needed, and might trigger these UI callbacks: PFGameSaveFilesUiProgressCallback, PFGameSaveFilesUiSyncFailedCallback, PFGameSaveFilesUiActiveDeviceContentionCallback, PFGameSaveFilesUiConflictCallback, PFGameSaveFilesUiOutOfStorageCallback See PFGameSaveFilesSetUiCallbacks for more detail. PFGameSaveFilesInitialize must be called prior. On XBOX and Windows platforms, stock UI is provided by the system.

## Syntax

```cpp theme={null}
HRESULT PFGameSaveFilesAddUserWithUiAsync(  
    PFLocalUserHandle localUserHandle,  
    PFGameSaveFilesAddUserOptions options,  
    XAsyncBlock* async  
)  
```

### Parameters

**`localUserHandle`**   PFLocalUserHandle

Local user to add.

**`options`**   [PFGameSaveFilesAddUserOptions](/services/playfab/api-references/c/pfgamesavefilestypes/enums/pfgamesavefilesadduseroptions)

Options to use when adding the user.

**`async`**   XAsyncBlock\*<br />*Inout*

An XAsyncBlock for polling the call's status and retrieving the call results.

### Return value

Type: HRESULT

To retrieve the result of a call to PFGameSaveFilesAddUserWithUiAsync, call PFGameSaveFilesAddUserWithUiResult. After this call completes, you can call PFGameSaveFilesGetFolder to get the root folder of the game save files and folders for this user. All the root folder's files and subfolders will be synchronized with the cloud. This can only be called once per user, typically before showing the game's main menu. To re-trigger the download the same user, call PFGameSaveFilesUninitializeAsync and wait for it to complete first

## Requirements

**Header:** PFGameSaveFiles.h

## See also

[PFGameSaveFiles members](/services/playfab/api-references/c/pfgamesavefiles/pfgamesavefiles_members)
