> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XblMultiplayerCreateSearchHandleAsync

> XblMultiplayerCreateSearchHandleAsync

Create a search handle associated with an existing session. This makes the session queryable.

## Syntax

```cpp theme={null}
HRESULT XblMultiplayerCreateSearchHandleAsync(  
         XblContextHandle xblContext,  
         const XblMultiplayerSessionReference* sessionRef,  
         const XblMultiplayerSessionTag* tags,  
         size_t tagsCount,  
         const XblMultiplayerSessionNumberAttribute* numberAttributes,  
         size_t numberAttributesCount,  
         const XblMultiplayerSessionStringAttribute* stringAttributes,  
         size_t stringAttributesCount,  
         XAsyncBlock* async  
)  
```

### Parameters

*xblContext*   \_In\_\
Type: [XblContextHandle](https://docs.xbox.com/reference/live/xsapi-c/types_c/handles/xblcontexthandle.md)

XBOX live context for the local user.

*sessionRef*   \_In\_\
Type: [XblMultiplayerSessionReference\*](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionreference.md)

Session reference to create a search handle for.

*tags*   \_In\_reads\_opt\_(tagsCount)\
Type: [XblMultiplayerSessionTag\*](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessiontag.md)

Optional set of tags to attach to search handle.

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

Count of tags.

*numberAttributes*   \_In\_reads\_opt\_(numberAttributesCount)\
Type: [XblMultiplayerSessionNumberAttribute\*](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionnumberattribute.md)

Optional attributes to attach to search handle.

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

Count of number attributes.

*stringAttributes*   \_In\_reads\_opt\_(stringAttributesCount)\
Type: [XblMultiplayerSessionStringAttribute\*](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/structs/xblmultiplayersessionstringattribute.md)

Optional attributes to attach to search handle.

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

Count of string attributes.

*async*   \_In\_\
Type: XAsyncBlock\*

The AsyncBlock for this operation.

### Return value

Type: HRESULT

HRESULT return code for this API operation.

## Requirements

**Header:** multiplayer\_c.h

**Library:** Microsoft.Xbox.Services.142.C.lib or Microsoft.Xbox.Services.143.C.lib

## See also

[multiplayer\_c](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/multiplayer_c_members.md)


## Related topics

- [XblMultiplayerCreateSearchHandleResult](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayercreatesearchhandleresult.md)
- [Multiplayer session browse](https://docs.xbox.com/services/xbox-services/multiplayer/concepts/live-session-browse.md)
- [multiplayer_c (contents)](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/multiplayer_c_members.md)
- [XblMultiplayerDeleteSearchHandleAsync](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayerdeletesearchhandleasync.md)
- [XblMultiplayerGetSearchHandlesAsync](https://docs.xbox.com/reference/live/xsapi-c/multiplayer_c/functions/xblmultiplayergetsearchhandlesasync.md)
