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

# OpenSharedHandleByName

> 使用 Name 和 Access 打开共享资源、共享堆和共享围栏的句柄。

使用 Name 和 Access 打开共享资源、共享堆和共享围栏的句柄。

## 语法

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

### 参数

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

在对 [ID3D12Device::CreateSharedHandle](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsharedhandle_public) 的调用中可选择性地作为 <i>Name</i> 参数传递的名称。

*Access*\
类型：DWORD

在对 [ID3D12Device::CreateSharedHandle](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createsharedhandle_public) 的调用中的 <i>Access</i> 参数中指定的访问级别。

*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](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [OpenSharedHandle](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_opensharedhandle_public.md)
- [IGameInputDispatcher::OpenWaitHandle](/zh-CN/reference/input/gameinput/interfaces/IGameInputDispatcher/methods/igameinputdispatcher_openwaithandle.md)
- [OpenSSL 许可证](/zh-CN/services/playfab/sdks/cocos2d-x/Licenses/openssl-license.md)
- [SHARED_SHAPE_CONTEXTS](/zh-CN/reference/audio/acphal/structs/shared_shape_contexts.md)
- [PFAuthenticationLoginWithOpenIdConnectAsync](/zh-CN/services/playfab/api-references/c/pfauthentication/functions/pfauthenticationloginwithopenidconnectasync.md)
