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

# XblSocialManagerGetLocalUsers

> XblSocialManagerGetLocalUsers

# XblSocialManagerGetLocalUsers

Returns user handles for all users tracked by SocialManager.

## Syntax

```cpp theme={null}
HRESULT XblSocialManagerGetLocalUsers(  
         size_t usersCount,  
         XblUserHandle* users  
)  
```

### Parameters

*usersCount*   \_In\_\
Type: size\_t

The size of the user handle array.

*users*   \_Out\_writes\_(usersCount)\
Type: XblUserHandle\*

Passes back a pointer to an array to populate with local users. This array is only valid until the next call to XblSocialManagerDoWork. The user handles returned are not duplicated copies so do not call close on them.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

Duplicate handle is not called before returning the handles, so if the user is needed after removing it from SocialManager, duplicate handle must be called. Make sure to have created a social graph for at least one local user by calling [XblSocialManagerAddLocalUser](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanageraddlocaluser). Also, call [XblSocialManagerGetLocalUserCount](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagergetlocalusercount) to get the number of local users currently tracked.

## Requirements

**Header:** social\_manager\_c.h

**Library:** Microsoft.Xbox.Services.14x.GDK.C.lib

## See also

[social\_manager\_c](/reference/live/xsapi-c/social_manager_c/social_manager_c_members)


## Related topics

- [XblSocialManagerGetLocalUserCount](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagergetlocalusercount.md)
- [XblSocialManagerUserGroupGetLocalUser](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerusergroupgetlocaluser.md)
- [XblSocialManagerAddLocalUser](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanageraddlocaluser.md)
- [XblSocialManagerRemoveLocalUser](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerremovelocaluser.md)
- [XblSocialManagerUserGroupGetUsersTrackedByGroup](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerusergroupgetuserstrackedbygroup.md)
