> ## 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](/zh-TW/reference/live/xsapi-c/social_c/handles/xblsocialrelationshipresulthandle)

社交關係結果控制代碼。

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

傳回指向 XblSocialRelationship 物件陣列的指標。在 XblSocialRelationshipResultHandle 物件關閉之前，所傳回指標的記憶體在該物件的存留期間內都保持有效。

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

傳回 relationships 陣列中的項目數目。

### 傳回值

類型：HRESULT

此 API 作業的 HRESULT 傳回碼。

## 備註

不再使用 XblSocialRelationshipResultHandle 時，請務必呼叫 [XblSocialRelationshipResultCloseHandle](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultclosehandle)。當所有未關閉的控制代碼都已關閉時，與社交關係結果清單相關聯的記憶體將會被釋放。

## 需求

**標頭：** social\_c.h

**程式庫：** Microsoft.Xbox.Services.14x.GDK.C.lib

## 另請參閱

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


## Related topics

- [XblSocialRelationship](/zh-TW/reference/live/xsapi-c/social_c/structs/xblsocialrelationship.md)
- [XblSocialGetSocialRelationshipsResult](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialgetsocialrelationshipsresult.md)
- [XblSocialRelationshipResultGetNextResult](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgetnextresult.md)
- [取得社交關係](/zh-TW/services/xbox-services/community/people-system/how-to/live-getting-a-social-relationship.md)
- [XblSocialRelationshipResultGetTotalCount](/zh-TW/reference/live/xsapi-c/social_c/functions/xblsocialrelationshipresultgettotalcount.md)
