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

# SetProtectedResourceSession

> Specifies whether or not protected resources can be accessed by subsequent commands in the command list.

Specifies whether or not protected resources can be accessed by subsequent commands in the command list. By default, no protected resources are enabled. After calling **SetProtectedResourceSession** with a valid session, protected resources of the same type can refer to that session. After calling **SetProtectedResourceSession** with **NULL**, no protected resources can be accessed.

## Syntax

```cpp theme={null}
void SetProtectedResourceSession(
    ID3D12ProtectedResourceSession  pProtectedResourceSession
)
```

### Parameters

*pProtectedResourceSession \[in, optional]*<br />Type: ID3D12ProtectedResourceSession \*

An optional pointer to an **ID3D12ProtectedResourceSession**. You can obtain an **ID3D12ProtectedResourceSession** by calling [ID3D12Device4::CreateProtectedResourceSession](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_createprotectedresourcesession_public).

### Return value

Type: void

If set, indicates that protected resources can be accessed with the given session. Access to protected resources can only happen after **SetProtectedResourceSession** is called with a valid session. The command list state is cleared when calling this method. If you pass **NULL**, then no protected resources can be accessed.

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

[ID3D12GraphicsCommandList3](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist3/id3d12graphicscommandlist3_public)


## Related topics

- [D3D12_PROTECTED_RESOURCE_SESSION_DESC1](/reference/graphics/d3d12/structs/d3d12_protected_resource_session_desc1_public.md)
- [D3D12_PROTECTED_RESOURCE_SESSION_DESC](/reference/graphics/d3d12/structs/d3d12_protected_resource_session_desc_public.md)
- [ID3D12ProtectedResourceSession](/reference/graphics/d3d12/interfaces/id3d12protectedresourcesession/id3d12protectedresourcesession_public.md)
- [D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS](/reference/graphics/d3d12/enums/d3d12_protected_resource_session_support_flags_public.md)
- [D3D12_PROTECTED_RESOURCE_SESSION_FLAGS](/reference/graphics/d3d12/enums/d3d12_protected_resource_session_flags_public.md)
