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

# GetStatusFence

> Retrieves the fence for the protected session. From the fence, you can retrieve the current uniqueness validity value (using ID3D12Fence::GetCompletedValue).

Retrieves the fence for the protected session. From the fence, you can retrieve the current uniqueness validity value (using [ID3D12Fence::GetCompletedValue](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_getcompletedvalue_public.md)), and add monitors for changes to its value. This is a read-only fence.

## Syntax

```cpp theme={null}
HRESULT GetStatusFence(
    const IID & riid,
    void  ppFence
)
```

### Parameters

*riid*\
Type: const IID &

The GUID of the interface to a fence. Most commonly, [ID3D12Fence](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public.md), although it may be any GUID for any interface. If the protected session object doesn't support the interface for this GUID, the function returns **E\_NOINTERFACE**.

*ppFence \[optional]*\
Type: void \*\*

A pointer to a memory block that receives a pointer to the fence for the given protected session.

### Return value

Type: HRESULT

If this method succeeds, it returns **S\_OK**. Otherwise, it returns an **HRESULT** error code.

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

[ID3D12ProtectedSession](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12protectedsession/id3d12protectedsession_public.md)


## Related topics

- [GetHResult](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageStatusArrayX/methods/idstoragestatusarrayx_gethresult.md)
- [IDStorageStatusArrayX (Interface contents)](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageStatusArrayX/idstoragestatusarrayx.md)
- [CreateFence](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createfence_public.md)
- [DSTORAGE_ERROR_RECORD](https://docs.xbox.com/reference/system/dstorage/structs/dstorage_error_record.md)
- [DirectStorage Overview](https://docs.xbox.com/build/console-features/storage/directstorage/directstorage-overview.md)
