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

# XblMultiplayerSessionCreateHandle

> XblMultiplayerSessionCreateHandle

# XblMultiplayerSessionCreateHandle

Creates a new local multiplayer session.

## Syntax

```cpp theme={null}
XblMultiplayerSessionHandle XblMultiplayerSessionCreateHandle(  
         uint64_t xuid,  
         const XblMultiplayerSessionReference* sessionReference,  
         const XblMultiplayerSessionInitArgs* initArgs  
)  
```

### Parameters

*xuid*   \_In\_\
Type: uint64\_t

The XBOX User ID of the user who is creating this session.

*sessionReference*   \_In\_opt\_\
Type: [XblMultiplayerSessionReference\*](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference)

A reference that uniquely identifies the session.

*initArgs*   \_In\_opt\_\
Type: [XblMultiplayerSessionInitArgs\*](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessioninitargs)

Additional args used to initialize the session. Must also include the sessionReference if these are included.

### Return value

Type: XblMultiplayerSessionHandle

Handle to a local multiplayer session.

## Remarks

You must call [XblMultiplayerWriteSessionAsync](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayerwritesessionasync) after this to write batched local changes to the service. If this is called without XblMultiplayerWriteSessionAsync, this will only create a local session object, but does not commit it to the service. When the local session object is no longer needed, call [XblMultiplayerSessionCloseHandle](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionclosehandle).

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

- [Multiplayer tasks](/services/xbox-services/multiplayer/mpsd/how-to/live-mpsd-how-tos.md)
- [Moving from MPSD to PlayFab Multiplayer and MPA](/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
- [XblMultiplayerCreateSearchHandleAsync](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayercreatesearchhandleasync.md)
- [XblMultiplayerSessionHandleId](/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionhandleid.md)
- [XblMultiplayerSessionReferenceCreate](/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayersessionreferencecreate.md)
