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

# SetEventOnMultipleFenceCompletion

> 指定当一组围栏中的一个或多个达到特定值时应触发的事件。

指定当一组围栏中的一个或多个达到特定值时应触发的事件。

## 语法

```cpp theme={null}
HRESULT SetEventOnMultipleFenceCompletion(
    ID3D12Fence const  ppFences,
    const UINT64  pFenceValues,
    UINT NumFences,
    D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
    HANDLE hEvent
)
```

### 参数

*ppFences \[in]*\
类型：ID3D12Fence \*const \*

一个长度为 <i>NumFences</i> 的数组，用于指定 [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public) 对象。

*pFenceValues \[in]*\
类型：const UINT64 \*

一个长度为 <i>NumFences</i> 的数组，指定触发事件所需的围栏值。

*NumFences*\
类型：UINT

指定要包含的围栏数量。

*Flags*\
类型：D3D12\_MULTIPLE\_FENCE\_WAIT\_FLAGS

指定 [D3D12\_MULTIPLE\_FENCE\_WAIT\_FLAGS](/reference/graphics/d3d12/enums/d3d12_multiple_fence_wait_flags_public) 之一，决定如何继续执行。

*hEvent*\
类型：HANDLE

事件对象的句柄。

### 返回值

类型：HRESULT

此方法返回 HRESULT 成功或错误代码。

## 备注

若要指定单个围栏，请参阅 [SetEventOnCompletion](/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_seteventoncompletion_public) 方法。

如果 *hEvent* 为 null 句柄，则此 API 不会返回，直到达到指定的围栏值。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12Device1](/reference/graphics/d3d12/interfaces/id3d12device1/id3d12device1_public)


## Related topics

- [D3D12_MULTIPLE_FENCE_WAIT_FLAGS](/zh-CN/reference/graphics/d3d12/enums/d3d12_multiple_fence_wait_flags_public.md)
- [SetEventOnCompletion](/zh-CN/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_seteventoncompletion_public.md)
- [DirectStorage 概述](/zh-CN/build/console-features/storage/directstorage/directstorage-overview.md)
- [Wait](/zh-CN/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_wait_public.md)
- [GetDeviceRemovedReason](/zh-CN/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getdeviceremovedreason_public.md)
