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

> 指定されたキーと完全に一致するキーを持つエントリをキャッシュ内で検索します。

指定されたキーと完全に一致するキーを持つエントリをキャッシュ内で検索します。

関数を 2 回呼び出します。1 回目は値のサイズを取得するため、2 回目はデータを取得するためです。インメモリの一時ストレージにより、この呼び出しパターンはパフォーマンスに優れます。

## 構文

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

### パラメーター

*pKey*\
型: const void \*

検索するエントリのキー。

*KeySize*\
型: UINT

キーのサイズ (バイト単位)。

*pValue*\
型: void \*

キャッシュされたエントリを受け取るメモリ ブロックへのポインター。

*pValueSize*\
型: UINT \*

キャッシュされたエントリのサイズをバイト単位で受け取る **UINT** へのポインター。

### 戻り値

型: HRESULT

関数が成功した場合、**S\_OK** を返します。それ以外の場合は、[**HRESULT**](https://learn.microsoft.com/en-us/windows/desktop/com/structure-of-com-error-codes) [エラー コード](https://learn.microsoft.com/en-us/windows/win32/com/com-error-codes-10) を返します。

| 戻り値                                 | 説明                                         |
| ----------------------------------- | ------------------------------------------ |
| DXGI\_ERROR\_CACHE\_HASH\_COLLISION | 指定されたキーと同じハッシュを持つエントリがありますが、キーが完全には一致しません。 |
| DXGI\_ERROR\_NOT\_FOUND             | エントリが存在しません。                               |

## 解説

## 要件

**ヘッダー:** d3d12\_xs.h または d3d12\_x.h\
**ライブラリ:** d3d12\_xs.lib または d3d12\_x.lib\
**サポートされるプラットフォーム**: XBOX Series 本体および XBOX One ファミリ

## 関連項目

* [D3D12 シェーダー キャッシュ API](https://microsoft.github.io/DirectX-Specs/d3d/ShaderCache.html)


## Related topics

- [XPackageFindChunkAvailability](/ja-jp/reference/system/xpackage/functions/xpackagefindchunkavailability.md)
- [IGameInput::FindDeviceFromId](/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromid.md)
- [IGameInput::FindDeviceFromPlatformString](/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_finddevicefromplatformstring.md)
- [IGameInput::FindDeviceFromObject](/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_finddevicefromobject.md)
- [IGameInput::FindDeviceFromPlatformHandle](/ja-jp/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_finddevicefromplatformhandle.md)
