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

> Specifies an event that should be fired when one or more of a collection of fences reach specific values.

Specifies an event that should be fired when one or more of a collection of fences reach specific values.

## Syntax

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

### Parameters

*ppFences \[in]*\
Type: ID3D12Fence \*const \*

An array of length <i>NumFences</i> that specifies the [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public) objects.

*pFenceValues \[in]*\
Type: const UINT64 \*

An array of length <i>NumFences</i> that specifies the fence values required for the event is to be signaled.

*NumFences*\
Type: UINT

Specifies the number of fences to be included.

*Flags*\
Type: D3D12\_MULTIPLE\_FENCE\_WAIT\_FLAGS

Specifies one  of the [D3D12\_MULTIPLE\_FENCE\_WAIT\_FLAGS](/reference/graphics/d3d12/enums/d3d12_multiple_fence_wait_flags_public) that determines how to proceed.

*hEvent*\
Type: HANDLE

A handle to the event object.

### Return value

Type: HRESULT

This method returns an HRESULT success or error code.

## Remarks

To specify a single fence refer to the [SetEventOnCompletion](/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_seteventoncompletion_public) method.

If *hEvent* is a null handle, then this API will not return until the specified fence value(s) have been reached.

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

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


## Related topics

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