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

# PFLobbyGetCustomContext

> PFLobbyGetCustomContext reference for reading the app-defined pointer context previously attached to a lobby handle in the PlayFab Multiplayer C++ SDK.

Retrieves the app's private, custom pointer-sized context value previously associated with this lobby object.

## Syntax

```cpp theme={null}
HRESULT PFLobbyGetCustomContext(  
    PFLobbyHandle lobby,  
    void** customContext  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`customContext`**   void\*\*\
*output, may return nullptr*

The output custom context.

### Return value

Type: HRESULT

`S_OK` if retrieving the custom context succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [PFMultiplayerGetErrorMessage()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/functions/pfmultiplayergeterrormessage).

## Remarks

If no custom context has been set yet, the value pointed to by `customContext` is set to nullptr.

## Requirements

**Header:** PFLobby.h

## See also

[PFLobby members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members)\
[PFLobbySetCustomContext](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbysetcustomcontext)


## Related topics

- [PFLobbySetCustomContext](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pflobbysetcustomcontext.md)
- [PFMultiplayer C/C++ API overview - PFLobby.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/pflobby_members.md)
- [PFMatchmakingTicketGetCustomContext](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetcustomcontext.md)
- [PartyEndpoint::GetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyEndpoint/methods/partyendpoint_getcustomcontext.md)
- [PartyNetwork::GetCustomContext](/services/playfab/multiplayer/networking/reference/classes/PartyNetwork/methods/partynetwork_getcustomcontext.md)
