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

# OpenSharedHandle

> HANDLE と REFIID を使用して、共有リソース、共有ヒープ、および共有フェンスのハンドルを開きます。

HANDLE と REFIID を使用して、共有リソース、共有ヒープ、および共有フェンスのハンドルを開きます。

## 構文

```cpp theme={null}
HRESULT OpenSharedHandle(
    HANDLE NTHandle,
    const IID & riid,
    void  ppvObj
)
```

### パラメーター

*NTHandle \[in]*\
型: HANDLE

[ID3D12Device::CreateSharedHandle](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsharedhandle_public) の呼び出しによって出力されたハンドル。

*riid*\
型: const IID &

次のいずれかのインターフェイスのグローバル一意識別子 (**GUID**):

<ul>
  <li>
    [ID3D12Heap](/reference/graphics/d3d12/interfaces/id3d12heap/id3d12heap_public)
  </li>

  <li>
    [ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)
  </li>

  <li>
    [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public)
  </li>
</ul>

インターフェイスの **REFIID** または **GUID** は、\_\_uuidof() マクロを使用して取得できます。
たとえば、\_\_uuidof(ID3D12Heap) は、リソースのインターフェイスの **GUID** を取得します。

*ppvObj \[out, optional]*\
型: void \*\*

次のいずれかのインターフェイスへのポインターを受け取るメモリ ブロックへのポインター:

<ul>
  <li>
    [ID3D12Heap](/reference/graphics/d3d12/interfaces/id3d12heap/id3d12heap_public)
  </li>

  <li>
    [ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)
  </li>

  <li>
    [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public)
  </li>
</ul>

### 戻り値

型: HRESULT

このメソッドは [Direct3D 12 の戻りコード](https://learn.microsoft.com/en-us/windows/win32/direct3d12/d3d12-graphics-reference-returnvalues) のいずれかを返します。

## 要件

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

## 関連項目

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)

[マルチアダプター システム](https://learn.microsoft.com/en-us/windows/win32/direct3d12/multi-engine)


## Related topics

- [OpenSharedHandleByName](/ja-jp/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_opensharedhandlebyname_public.md)
- [IGameInputDispatcher::OpenWaitHandle](/ja-jp/reference/input/gameinput/interfaces/IGameInputDispatcher/methods/igameinputdispatcher_openwaithandle.md)
- [SHARED_SHAPE_CONTEXTS](/ja-jp/reference/audio/acphal/structs/shared_shape_contexts.md)
- [PFAuthenticationLoginWithOpenIdConnectAsync](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithopenidconnectasync.md)
- [PFAuthenticationReLoginWithOpenIdConnectAsync](/ja-jp/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationreloginwithopenidconnectasync.md)
