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

# PartyEndpoint::SetCustomContext

> Configures an optional, custom pointer-sized context value with this endpoint object.

Configures an optional, custom pointer-sized context value with this endpoint object.

## Syntax

```cpp theme={null}
PartyError SetCustomContext(  
    void* customContext  
)  
```

### Parameters

**`customContext`**   void\*\
*optional*

An arbitrary, pointer-sized value to store with the endpoint object.

### Return value

PartyError

`c_partyErrorSuccess` if configuring the custom context succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PartyManager::GetErrorMessage()](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_geterrormessage).

## Remarks

The custom context is typically used as a "shortcut" that simplifies accessing local, title-specific memory associated with the endpoint without requiring a mapping lookup. The value is retrieved using the [GetCustomContext()](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getcustomcontext) method. <br /><br /> Any configured value is treated as opaque by the library, and is only valid on the local device; it is not transmitted over the network.

## Requirements

**Header:** Party.h

## See also

[PartyEndpoint](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/partyendpoint)\
[PartyEndpoint::GetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getcustomcontext)


## Related topics

- [PartyEndpoint::GetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getcustomcontext.md)
- [PartyNetwork::SetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_setcustomcontext.md)
- [PartyDevice::SetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyDevice/methods/partydevice_setcustomcontext.md)
- [PartyInvitation::SetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyInvitation/methods/partyinvitation_setcustomcontext.md)
- [PartyChatControl::SetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyChatControl/methods/partychatcontrol_setcustomcontext.md)
