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

# FindValue

> Looks up an entry in the cache whose key exactly matches the provided key.

Looks up an entry in the cache whose key exactly matches the provided key.

Call the function twice. The first time to retrieve the value's size, and the second time to retrieve the data. In-memory temporary storage makes this calling pattern performant.

## Syntax

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

### Parameters

*pKey*\
Type: const void \*

The key of the entry to look up.

*KeySize*\
Type: UINT

The size of the key, in bytes.

*pValue*\
Type: void \*

A pointer to a memory block that receives the cached entry.

*pValueSize*\
Type: UINT \*

A pointer to a **UINT** that receives the size of the cached entry, 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\_CACHE\_HASH\_COLLISION | There's an entry with the same hash as the provided key, but the key doesn't exactly match. |
| DXGI\_ERROR\_NOT\_FOUND             | The entry isn't present.                                                                    |

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

- [Find lobbies](/services/playfab/multiplayer/lobby/find-lobbies.md)
- [XUserFindForDevice](/reference/system/xuser/functions/xuserfindfordevice.md)
- [PFMultiplayerFindLobbies](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerfindlobbies.md)
- [IGameInput::FindDeviceFromId](/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md)
- [IGameInput::FindDeviceFromObject](/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_finddevicefromobject.md)
