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

# XblSocialRelationshipResultGetRelationships

> XblSocialRelationshipResultGetRelationships

# XblSocialRelationshipResultGetRelationships

从 XblSocialRelationshipResultHandle 获取 XblSocialRelationship 对象列表。

## 语法

```cpp theme={null}
HRESULT XblSocialRelationshipResultGetRelationships(  
         XblSocialRelationshipResultHandle resultHandle,  
         const XblSocialRelationship** relationships,  
         size_t* relationshipsCount  
)  
```

### 参数

*resultHandle*   \_In\_\
类型：[XblSocialRelationshipResultHandle](/reference/live/xsapi-c/social_c/handles/xblsocialrelationshipresulthandle)

社交关系结果句柄。

*relationships*   \_Out\_\
类型：[XblSocialRelationship\*\*](/reference/live/xsapi-c/social_c/structs/xblsocialrelationship)

回传指向 XblSocialRelationship 对象数组的指针。返回指针的内存在 XblSocialRelationshipResultHandle 对象关闭之前的整个生命周期内保持有效。

*relationshipsCount*   \_Out\_\
类型：size\_t\*

回传 relationships 数组中的项数。

### 返回值

类型：HRESULT

此 API 操作的 HRESULT 返回代码。

## 备注

当不再使用 XblSocialRelationshipResultHandle 时，请务必调用 [XblSocialRelationshipResultCloseHandle](/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultclosehandle)。当所有未关闭的句柄都已关闭时，将释放与社交关系结果列表关联的内存。

## 要求

**头文件：** social\_c.h

**库：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另请参阅

[social\_c](/reference/live/xsapi-c/social_c/social_c_members)
