Skip to main content

XblMultiplayerSessionGetRoleByName

Fetches the XblMultiplayerRole object by role type name and role name.

Syntax

Parameters

handle   _In_
Type: XblMultiplayerSessionHandle
Handle to the multiplayer session. roleTypeName   _In_z_
Type: char*
Name of the role type the role belongs to. roleName   _In_z_
Type: char*
Name of the role. role   _Out_
Type: XblMultiplayerRole**
Passes back a pointer to the role object with info about the role. The memory for the pointer will remain valid for the life of the XblMultiplayerSessionHandle object until it is closed. If no such role exists, nullptr will be passed back.

Return value

Type: HRESULT HRESULT return code for this API operation.

Remarks

Note that newly created sessions will not have role info populated until the XblMultiplayerWriteSessionAsync is called.

Requirements

Header: multiplayer_c.h Library: Microsoft.Xbox.Services.14x.GDK.C.lib

See also

multiplayer_c
Last modified on August 4, 2026