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

# PFMultiplayerFindLobbies

> PFMultiplayerFindLobbies reference for searching PlayFab lobbies on behalf of a local user using filter and sort strings in the PlayFab Multiplayer C++ SDK.

Search for lobbies on behalf of the local user.

## Syntax

```cpp theme={null}
HRESULT PFMultiplayerFindLobbies(  
    PFMultiplayerHandle handle,  
    const PFEntityKey* searchingEntity,  
    const PFLobbySearchConfiguration* searchConfiguration,  
    void* asyncContext  
)  
```

### Parameters

**`handle`**   PFMultiplayerHandle

The handle of the PFMultiplayer API instance.

**`searchingEntity`**   [PFEntityKey\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pfmultiplayer/pfentitykey_clientsdk)

The PlayFab entity performing the search.

**`searchConfiguration`**   [PFLobbySearchConfiguration\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysearchconfiguration)

The configuration used to filter and sort the searched lobbies.

**`asyncContext`**   void\*\
*optional*

An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.

### Return value

Type: HRESULT

`S_OK` if the call 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

This is an asynchronous operation. Upon successful completion, the title will be provided a [PFLobbyFindLobbiesCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyfindlobbiescompletedstatechange) with the [PFLobbyFindLobbiesCompletedStateChange::result](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyfindlobbiescompletedstatechange) field set to `S_OK`. Upon a failed completion, the title will be provided a [PFLobbyFindLobbiesCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyfindlobbiescompletedstatechange) with the [PFLobbyFindLobbiesCompletedStateChange::result](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyfindlobbiescompletedstatechange) field set to a failure.

## Requirements

**Header:** PFLobby.h

## See also

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


## Related topics

- [Integrate Party with Lobby using Multiplayer SDK](/services/playfab/multiplayer/networking/party-lobby-integration.md)
- [Use lobby and matchmaking together](/services/playfab/multiplayer/lobby/lobby-and-matchmaking.md)
- [PFLobbySearchConfiguration](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysearchconfiguration.md)
- [PFLobbySearchResult](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbysearchresult.md)
- [PlayFab Multiplayer C++ SDK Release Notes](/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/lobby-and-matchmaking-release-notes.md)
