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

# OpenSharedHandleByName

> 使用 Name 和 Access 開啟共用資源、共用堆積和共用柵欄的控制代碼。

使用 Name 和 Access 開啟共用資源、共用堆積和共用柵欄的控制代碼。

## 語法

```cpp theme={null}
HRESULT OpenSharedHandleByName(
    LPCWSTR Name,
    DWORD Access,
    HANDLE  pNTHandle
)
```

### 參數

*Name \[in]*\
類型：LPCWSTR

在呼叫
[ID3D12Device::CreateSharedHandle](https://docs.xbox.com/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsharedhandle_public.md) 時，選擇性地以 *Name* 參數傳遞的名稱。

*Access*\
類型：DWORD

在呼叫
[ID3D12Device::CreateSharedHandle](https://docs.xbox.com/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsharedhandle_public.md) 時，於 *Access* 參數中指定的存取層級。

*pNTHandle \[out]*\
類型：HANDLE \*

共用控制代碼的指標。

### 傳回值

類型：HRESULT

此方法會傳回其中一個 [Direct3D 12 傳回碼](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues)。

## 需求

**標頭：** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台**：XBOX Series 主機與 XBOX One 系列

## 另請參閱

[ID3D12Device](https://docs.xbox.com/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device.md)


## Related topics

- [OpenSharedHandle](https://docs.xbox.com/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_opensharedhandle_public.md)
- [OpenWaitHandle](https://docs.xbox.com/zh-TW/reference/input/gameinput/interfaces/IGameInputDispatcher/methods/igameinputdispatcher_openwaithandle.md)
- [Get Player Shared Secrets](https://docs.xbox.com/api-reference/authentication/get-player-shared-secrets.md)
- [Update Player Shared Secret](https://docs.xbox.com/api-reference/authentication/update-player-shared-secret.md)
- [Create Player Shared Secret](https://docs.xbox.com/api-reference/authentication/create-player-shared-secret.md)
