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

# StoreValue

> Adds an entry to the cache.

Adds an entry to the cache.

## Syntax

```cpp theme={null}
HRESULT StoreValue(
    const void  pKey,
    UINT KeySize,
    const void  pValue,
    UINT ValueSize
)
```

### Parameters

*pKey*\
Type: const void \*

The key of the entry to add.

*KeySize*\
Type: UINT

The size of the key, in bytes.

*pValue*\
Type: const void \*

A pointer to a memory block containing the entry to add.

*ValueSize*\
Type: UINT

The size of the entry to add, in bytes.

### Return value

Type: HRESULT

If the function succeeds, it returns **S\_OK**. Otherwise, it returns an [**HRESULT**](https://learn.microsoft.com/en-us/windows/desktop/com/structure-of-com-error-codes) [error code](https://learn.microsoft.com/en-us/windows/win32/com/com-error-codes-10).

| Return value                        | Description                                                                         |
| ----------------------------------- | ----------------------------------------------------------------------------------- |
| DXGI\_ERROR\_ALREADY\_EXISTS        | There's an entry with the same key.                                                 |
| DXGI\_ERROR\_CACHE\_HASH\_COLLISION | There's an entry with the same hash as the provided key, but the key doesn't match. |
| DXGI\_ERROR\_CACHE\_FULL            | Adding this entry would cause the cache to become larger than its maximum size.     |

## Remarks

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

* [D3D12 shader cache APIs](https://microsoft.github.io/DirectX-Specs/d3d/ShaderCache.html)


## Related topics

- [XStore](/reference/system/xstore/xstore_members.md)
- [XStorePrice](/reference/system/xstore/structs/xstoreprice.md)
- [StorePipeline](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_storepipeline_public.md)
- [XStoreDurationUnit](/reference/system/xstore/enums/xstoredurationunit.md)
- [MicrosoftGame.config Element - StoreId](/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-storeid.md)
