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

# HCMockSetMockMatchedCallback

> HCMockSetMockMatchedCallback

# HCMockSetMockMatchedCallback

Add an intermediate callback that will be called when the specified mock is matched. This gives the client another opportunity to specify the mock response.

## Syntax

```cpp theme={null}
HRESULT HCMockSetMockMatchedCallback(  
         HCMockCallHandle call,  
         HCMockMatchedCallback callback,  
         void* context  
)  
```

### Parameters

*call*   \_In\_\
Type: HCMockCallHandle

The matched mock.

*callback*   \_In\_\
Type: HCMockMatchedCallback

Callback to be invoked when the mock is matched.

*context*   \_In\_opt\_\
Type: void\*

Client context.

### Return value

Type: HRESULT

Result code for this API operation. Possible values are S\_OK, E\_INVALIDARG, or E\_FAIL.

## Requirements

**Header:** mock.h

**Library:** libHttpClient.GDK.lib

## See also

[mock](/reference/live/httpclient/mock/mock_members)


## Related topics

- [HCMockRemoveMock](/reference/live/httpclient/mock/functions/hcmockremovemock.md)
- [HCMockAddMock](/reference/live/httpclient/mock/functions/hcmockaddmock.md)
- [HCMockClearMocks](/reference/live/httpclient/mock/functions/hcmockclearmocks.md)
- [HCMockResponseSetHeader](/reference/live/httpclient/mock/functions/hcmockresponsesetheader.md)
- [HCMockCallCreate](/reference/live/httpclient/mock/functions/hcmockcallcreate.md)
