> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://docs.xbox.com/reference/errorcodes.md).

## Remarks

To retrieve the user ID for a specific user, call [XUserGetId](https://docs.xbox.com/reference/system/xuser/functions/xusergetid.md).

To retrieve the state of a specific user, call [XUserGetState](https://docs.xbox.com/reference/system/xuser/functions/xusergetstate.md).

To retrieve the age group for a specific user, call [XUserGetAgeGroup](https://docs.xbox.com/reference/system/xuser/functions/xusergetagegroup.md).

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

## Requirements

**Header:** XUser.h

**Library:** xgameruntime.lib

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

## See also

[XUser](https://docs.xbox.com/reference/system/xuser/xuser_members.md)

[XUserGetId](https://docs.xbox.com/reference/system/xuser/functions/xusergetid.md)

[XUserGetState](https://docs.xbox.com/reference/system/xuser/functions/xusergetstate.md)

[XUserGetAgeGroup](https://docs.xbox.com/reference/system/xuser/functions/xusergetagegroup.md)


## Related topics

- [XUser (API contents)](https://docs.xbox.com/reference/system/xuser/xuser_members.md)
- [GET (/users/xuid({xuid})/history/titles)](https://docs.xbox.com/reference/live/rest/uri/titlehistory/uri-titlehistoryusersxuidhistorytitlesgetv2.md)
- [GET (/users/xuid({xuid})/achievements)](https://docs.xbox.com/reference/live/rest/uri/achievements/uri-achievementsusersxuidachievementsgetv2.md)
- [GET (/users/xuid({xuid})/inbox)](https://docs.xbox.com/reference/live/rest/uri/users/uri-usersxuidinboxget.md)
- [MaxUserQuota Element (MicrosoftGame.config)](https://docs.xbox.com/reference/system/microsoftgameconfig/elements/microsoftgameconfig-element-maxuserquota.md)
