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

# PFLobbyGetAccessPolicy

> PFLobbyGetAccessPolicy reference for reading the current PFLobbyAccessPolicy value on a PlayFab lobby using the PlayFab Multiplayer C++ SDK lobby APIs.

Gets the access policy of the lobby.

## Syntax

```cpp theme={null}
HRESULT PFLobbyGetAccessPolicy(  
    PFLobbyHandle lobby,  
    PFLobbyAccessPolicy* accessPolicy  
)  
```

### Parameters

**`lobby`**   PFLobbyHandle

The handle of the lobby.

**`accessPolicy`**   [PFLobbyAccessPolicy\*](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/enums/pflobbyaccesspolicy)\
*output*

The output access policy.

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

If this lobby object was created by calling [PFMultiplayerJoinLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerjoinlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a [PFLobbyUpdatedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) with [PFLobbyUpdatedStateChange::accessPolicyUpdated](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) set to true. If joining the lobby succeeds, this field is guaranteed to be populated by the time PFMultiplayerStartProcessingLobbyStateChanges() provides a [PFLobbyJoinLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyjoinlobbycompletedstatechange). <br /><br /> If this lobby object was created by calling [PFMultiplayerClaimServerLobby()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerclaimserverlobby), this method will return an error until [PFMultiplayerStartProcessingLobbyStateChanges()](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/functions/pfmultiplayerstartprocessinglobbystatechanges) provides a [PFLobbyUpdatedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) with [PFLobbyUpdatedStateChange::accessPolicyUpdated](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyupdatedstatechange) set to true. If claiming the lobby succeeds, this field is guaranteed to be populated by the time PFMultiplayerStartProcessingLobbyStateChanges() provides a [PFLobbyClaimServerLobbyCompletedStateChange](/services/playfab/multiplayer/lobby/playfabmultiplayerreference-cpp/pflobby/structs/pflobbyclaimserverlobbycompletedstatechange).

## Requirements

**Header:** PFLobby.h

## See also

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