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

# XUserGetMaxUsers

> XUserGetMaxUsers

# XUserGetMaxUsers

Retrieves the maximum number of users that a game session allows on the current platform.

## Syntax

```cpp theme={null}
HRESULT XUserGetMaxUsers(  
         uint32_t* maxUsers  
)  
```

### Parameters

*maxUsers*   \_Out\_\
Type: uint32\_t\*

Contains the maximum number of users that a game session allows on the current platform.

### Return value

Type: HRESULT

HRESULT success or error code.\
For a list of error codes, see [Error Codes](/reference/errorcodes).

## Remarks

To retrieve the user ID for a specific user, call [XUserGetId](/reference/system/xuser/functions/xusergetid).

To retrieve the state of a specific user, call [XUserGetState](/reference/system/xuser/functions/xusergetstate).

To retrieve the age group for a specific user, call [XUserGetAgeGroup](/reference/system/xuser/functions/xusergetagegroup).

To retrieve the max user size of a multiplayer session, call [XblMultiplayerManagerGameSessionConstants](/reference/live/xsapi-c/multiplayer_manager_c/functions/xblmultiplayermanagergamesessionconstants).

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

**Supported platforms:** Windows, Steam Deck, XBOX One family consoles and XBOX Series consoles

## See also

[XUser](/reference/system/xuser/xuser_members)

[XUserGetId](/reference/system/xuser/functions/xusergetid)

[XUserGetState](/reference/system/xuser/functions/xusergetstate)

[XUserGetAgeGroup](/reference/system/xuser/functions/xusergetagegroup)


## Related topics

- [XUser](/reference/system/xuser/xuser_members.md)
- [MicrosoftGame.config Element - MaxUserQuota](/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-maxuserquota.md)
- [XUserGetDefaultAudioEndpointUtf16](/reference/system/xuser/functions/xusergetdefaultaudioendpointutf16.md)
- [XUserGetGamertag](/reference/system/xuser/functions/xusergetgamertag.md)
- [XUserGetId](/reference/system/xuser/functions/xusergetid.md)
