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

# XGameSave Provider Initialize method reference

> Reference for the XGameSave wrapper Provider.Initialize method, which prepares the save-game provider and syncs all containers for the specified user.

# Microsoft.Xbox.Wrappers.XGameSave.Provider.Initialize

Initializes the save game wrapper, and synchronizes all of the containers for the specified user.

<a id="syntaxSection" />

## Syntax

```cpp theme={null}
HRESULT Initialize(XUserHandle userHandle,
                   const std::string& serviceConfigurationId);
```

<a id="parametersSection" />

### Parameters

*userHandle*   \_In\_<br />Type: XUserHandle

A handle to the XBOX Live User account.

*serviceConfigurationId*  \_In\_<br />Type: std::string

The game's Service Configuration ID (SCID).

<a id="retvalSection" />

### Return value

Type: HRESULT

This method returns **S\_OK** upon success, and the following HRESULT codes upon failure:

* **E\_GS\_USER\_CANCELED**
* **E\_GS\_USER\_NOT\_REGISTERED\_IN\_SERVICE**
* **E\_GS\_NO\_ACCESS**
* **E\_GS\_NO\_SERVICE\_CONFIGURATION**

<a id="remarksSection" />

## Remarks

You must call this method before you can call any other method from the `Provider` class.

You shouldn't call this method on the game's UI thread because it can block, and then potentially show UI to the user as it synchronizes their game saves.

To load the data from the given blob, from the specified container, call [Load](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load).

<a id="requirementsSection" />

## Requirements

**Header:** xgamesavewrappers.hpp

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

<a id="seealsoSection" />

## See also

[Microsoft.Xbox.Wrappers.XGameSave.Provider](/reference/system/Wrappers/classes/provider/xgamesave_wrapper_provider)<br />[XGameSave wrapper members](/reference/system/Wrappers/xgamesave_wrapper_members)


## Related topics

- [XGameSave Provider Save method reference](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_save.md)
- [XGameSaveInitializeProviderResult](/reference/system/xgamesave/functions/xgamesaveinitializeproviderresult.md)
- [XGameSaveInitializeProvider](/reference/system/xgamesave/functions/xgamesaveinitializeprovider.md)
- [XGameSaveInitializeProviderAsync](/reference/system/xgamesave/functions/xgamesaveinitializeproviderasync.md)
- [XGameSave Provider Load method reference](/reference/system/Wrappers/classes/provider/methods/xgamesave_wrapper_provider_load.md)
