> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SetCpuAffinity

> IDStorageFactoryX::SetCpuAffinity

# IDStorageFactoryX::SetCpuAffinity

DirectStorage の CPU アフィニティ マスクを設定します。

## 構文

```cpp theme={null}
HRESULT SetCpuAffinity(  
         UINT64 affinity  
)  
```

### パラメーター

*affinity*\
Type: UINT64

CPU アフィニティ マスク。

### 戻り値

Type: HRESULT

標準の HRESULT エラー コード。

## 解説

DirectStorage は通常、呼び出し元のスレッドで処理を実行します。ただし、一部の処理は呼び出し元のスレッドで実行できません。そのような処理を特定の CPU コアのセットに制限するには、CPU アフィニティ マスクを設定します。

詳細については、[DirectStorage の概要](https://docs.xbox.com/ja-jp/build/console-features/storage/directstorage/directstorage-overview.md) の「IDStorageFileX」セクション内の「SetCPUAffinity」を参照してください。

## 要件

**ヘッダー:** dstorage\_xs.h

**ライブラリ:** dstorage\_xs.lib

**サポートされているプラットフォーム:** XBOX Series 本体

## 関連項目

[IDStorageFactoryX](https://docs.xbox.com/ja-jp/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)\
[DStorage](https://docs.xbox.com/ja-jp/reference/system/dstorage/dstorage_members.md)


## Related topics

- [IDStorageFactoryX (インターフェイスの内容)](https://docs.xbox.com/ja-jp/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)
- [PFMultiplayerSetThreadAffinityMask](https://docs.xbox.com/ja-jp/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayersetthreadaffinitymask.md)
- [set_thread_affinity_mask](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_affinity_mask.md)
- [get_thread_affinity_mask](https://docs.xbox.com/ja-jp/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_get_thread_affinity_mask.md)
- [TrySetLampArrayWorkerThreadAffinityMask](https://docs.xbox.com/ja-jp/reference/lighting/lamparray/functions/trysetlamparrayworkerthreadaffinitymask.md)
