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

# PFMatchmakingTicketGetCustomContext

> Retrieves the app's private, pointer-sized custom context value previously associated with a PlayFab Multiplayer matchmaking ticket via the setter function.

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

## Syntax

```cpp theme={null}
HRESULT PFMatchmakingTicketGetCustomContext(  
    PFMatchmakingTicketHandle ticket,  
    void** customContext  
)  
```

### Parameters

**`ticket`**   PFMatchmakingTicketHandle

The handle of the matchmaking ticket.

**`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:** PFMatchmaking.h

## See also

[PFMatchmaking members](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members)\
[PFMatchmakingTicketSetCustomContext](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketsetcustomcontext)


## Related topics

- [PFMatchmakingTicketSetCustomContext](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketsetcustomcontext.md)
- [PlayFab Multiplayer C++ SDK Release Notes](/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
- [PFMultiplayer C/C++ API overview - PFMatchmaking.h](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/pfmatchmaking_members.md)
- [XblMatchmakingGetMatchTicketDetailsAsync](/reference/live/xsapi-c/matchmaking_c/functions/xblmatchmakinggetmatchticketdetailsasync.md)
- [PFMatchmakingTicketGetTicketId](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmatchmaking/functions/pfmatchmakingticketgetticketid.md)
