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

# 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](/reference/graphics/d3d12/interfaces/id3d12fence/methods/id3d12fence_getcompletedvalue_public)), 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*<br />Type: const IID &

The GUID of the interface to a fence. Most commonly, [ID3D12Fence](/reference/graphics/d3d12/interfaces/id3d12fence/id3d12fence_public), 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]*<br />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<br />**Library:** d3d12\_xs.lib or d3d12\_x.lib<br />**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12ProtectedSession](/reference/graphics/d3d12/interfaces/id3d12protectedsession/id3d12protectedsession_public)


## Related topics

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