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

# XblSocialManagerDoWork

> XblSocialManagerDoWork

# XblSocialManagerDoWork

Called whenever the title wants to update the social graph and get list of change events.

## Syntax

```cpp theme={null}
HRESULT XblSocialManagerDoWork(  
         const XblSocialManagerEvent** socialEvents,  
         size_t* socialEventsCount  
)  
```

### Parameters

*socialEvents*   \_Outptr\_result\_maybenull\_\
Type: [XblSocialManagerEvent\*\*](/reference/live/xsapi-c/social_manager_c/structs/xblsocialmanagerevent)

Passes back a pointer to the array of social events that have occurred since the last call to XblSocialManagerDoWork. This array is only valid until the next call to XblSocialManagerDoWork. The internal array will automatically be cleaned up when XblCleanup is called.

*socialEventsCount*   \_Out\_\
Type: size\_t\*

Passes back the number of events in the social events array.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Remarks

Must be called every frame for data to be up to date. The array of social events that is sent back is only valid until the next call to [XblSocialManagerDoWork](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerdowork). Make sure to check if there were social events sent back. If the social events array is null, no results. If the social events count is 0, no results. If there were social events sent back then handle each [XblSocialManagerEvent](/reference/live/xsapi-c/social_manager_c/structs/xblsocialmanagerevent) by their respective [XblSocialManagerEventType](/reference/live/xsapi-c/social_manager_c/enums/xblsocialmanagereventtype).

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

- [XblSocialManagerUserGroupGetUsers](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerusergroupgetusers.md)
- [XblSocialManagerEvent](/reference/live/xsapi-c/social_manager_c/structs/xblsocialmanagerevent.md)
- [XblSocialManagerUpdateSocialUserGroup](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagerupdatesocialusergroup.md)
- [Social Manager overview](/services/xbox-services/community/social-manager/live-social-manager-overview.md)
- [XblSocialManagerCreateSocialUserGroupFromFilters](/reference/live/xsapi-c/social_manager_c/functions/xblsocialmanagercreatesocialusergroupfromfilters.md)
