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

# XblMultiplayerSessionSetLocked

> XblMultiplayerSessionSetLocked

# XblMultiplayerSessionSetLocked

Sets if a session is locked or not. If locked, members that leave the session will be able to come back into the session, allowing no additional users to take that spot.

## Syntax

```cpp theme={null}
void XblMultiplayerSessionSetLocked(  
         XblMultiplayerSessionHandle handle,  
         bool locked  
)  
```

### Parameters

*handle*   \_In\_\
Type: [XblMultiplayerSessionHandle](/reference/live/xsapi-c/multiplayer_c/handles/xblmultiplayersessionhandle)

Handle to the multiplayer session.

*locked*   \_In\_\
Type: bool

Set true, if the session should be lock, false otherwise.

### Return value

Type: void

## Remarks

If the session is locked, it must also be set to closed.

## Requirements

**Header:** multiplayer\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[multiplayer\_c](/reference/live/xsapi-c/multiplayer_c/multiplayer_c_members)


## Related topics

- [XblMultiplayerSessionSetSessionChangeSubscription](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionsetsessionchangesubscription.md)
- [XblMultiplayerSessionSetClosed](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionsetclosed.md)
- [XblMultiplayerSessionConstantsSetMaxMembersInSession](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionconstantssetmaxmembersinsession.md)
- [XblMultiplayerSessionSetMatchmakingTargetSessionConstantsJson](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionsetmatchmakingtargetsessionconstantsjson.md)
- [XblMultiplayerSessionSetMatchmakingResubmit](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionsetmatchmakingresubmit.md)
