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

# XGameSaveSubmitBlobWrite

> XGameSaveSubmitBlobWrite

# XGameSaveSubmitBlobWrite

Adds a write action to a XGameSaveUpdate.

## Syntax

```cpp theme={null}
HRESULT XGameSaveSubmitBlobWrite(  
         XGameSaveUpdateHandle updateContext,  
         const char* blobName,  
         const uint8_t* data,  
         size_t byteCount  
)  
```

### Parameters

*updateContext*   \_In\_\
Type: XGameSaveUpdateHandle

Handle to the **XGameSaveUpdate** the blob will be written to.

*blobName*   \_In\_z\_\
Type: char\*

Name of the blob to be written. The size of the blob name should not be greater than GS\_MAX\_BLOB\_NAME\_SIZE, in bytes.

*data*   \_In\_reads\_bytes\_(byteCount)\
Type: uint8\_t\*

Data to be written to the blob.

*byteCount*   \_In\_\
Type: size\_t

Size of the data to be written to the blob.  The size of the blob data should not be greater than GS\_MAX\_BLOB\_SIZE, in bytes.

<Note>While the size of the blob data is limited to GS\_MAX\_BLOB\_SIZE, the entire update is also limited to GS\_MAX\_BLOB\_SIZE. If an update contains a blob of GS\_MAX\_BLOB\_SIZE, additional updates must be made in separate update requests.</Note>

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

You need to successfully call [XGameSaveCreateUpdate](/reference/system/xgamesave/functions/xgamesavecreateupdate) before making this call.

The storage portion of this API is designed to easily transfer data from the game to persisted storage in a safe, reliable and transactional manner. We want to make sure the backing data for a container is always consistent and as such we want the whole operation to succeed or fail atomically. We don't want to have a partial update where some blob data is inconsistent with other data within the container. In order to do this we provide an update context that blob writes and deletes are submitted to and when that is ready the whole context is submitted. Note that you can only write one modification/deletion per blob in an update context. In practice this looks like the following:

An XGameSaveUpdate will be filled with Write and Delete actions to be carried out on blobs within the container by way of [XGameSaveSubmitBlobWrite](/reference/system/xgamesave/functions/xgamesavesubmitblobwrite) and [XGameSaveSubmitBlobDelete](/reference/system/xgamesave/functions/xgamesavesubmitblobdelete). An update is completed by calling [XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate).

See the [XGameSaveCreateUpdate examples](/reference/system/xgamesave/functions/xgamesavecreateupdate#example) for usage.

## Requirements

**Header:** XGameSave.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [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)\
[XGameSaveCreateUpdate](/reference/system/xgamesave/functions/xgamesavecreateupdate)\
[XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate)\
[XGameSaveSubmitBlobDelete](/reference/system/xgamesave/functions/xgamesavesubmitblobdelete)\
[Debugging Game Saves](/build/core-features/common/game-save/game-saves-debugging)


## Related topics

- [XGameSaveSubmitBlobDelete](/reference/system/xgamesave/functions/xgamesavesubmitblobdelete.md)
- [XGameSaveSubmitUpdate](/reference/system/xgamesave/functions/xgamesavesubmitupdate.md)
- [XGameSaveSubmitUpdateAsync](/reference/system/xgamesave/functions/xgamesavesubmitupdateasync.md)
- [XGameSaveCreateUpdate](/reference/system/xgamesave/functions/xgamesavecreateupdate.md)
- [XGameSave API overview](/build/core-features/common/game-save/xgamesave.md)
