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

# HCTracePlatformThisThreadIdCallback

> Platform hook that returns the ID of the calling thread for libHttpClient trace messages.

# HCTracePlatformThisThreadIdCallback

Platform hook that returns the ID of the calling thread for libHttpClient trace messages.

## Syntax

```cpp theme={null}
uint64_t CALLBACK HCTracePlatformThisThreadIdCallback(  
         void* context  
)  
```

### Parameters

*context*\
Type: void\*

The *threadIdContext* value that was passed to [HCTraceSetPlatformCallbacks](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracesetplatformcallbacks.md). The header declares this parameter without a name; this page calls it *context*.

### Return value

Type: uint64\_t

ID of the calling thread. libHttpClient passes this value as the *threadId* parameter of [HCTraceCallback](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracecallback.md) and includes it in debugger output.

## Remarks

Set this callback by calling [HCTraceSetPlatformCallbacks](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracesetplatformcallbacks.md) before you initialize libHttpClient.

> [!NOTE]
>
> The XBOX Game Development Kit (GDK) builds of libHttpClient for Windows PC and XBOX consoles don't call this callback. They use the operating system thread ID instead. Only libHttpClient builds that use the generic platform tracing implementation call this hook.

## Requirements

**Header:** trace.h

**Library:** libHttpClient.lib

**Supported platforms:** Windows, XBOX One family consoles and XBOX Series consoles

## See also

[trace](https://docs.xbox.com/reference/live/httpclient/trace/trace_members.md)\
[HCTraceSetPlatformCallbacks](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracesetplatformcallbacks.md)\
[HCTracePlatformWriteMessageToDebuggerCallback](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctraceplatformwritemessagetodebuggercallback.md)


## Related topics

- [HCTraceSetPlatformCallbacks](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracesetplatformcallbacks.md)
- [HCTracePlatformWriteMessageToDebuggerCallback](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctraceplatformwritemessagetodebuggercallback.md)
- [trace (contents)](https://docs.xbox.com/reference/live/httpclient/trace/trace_members.md)
- [HCTraceCallback](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracecallback.md)
- [HCTraceSetClientCallback](https://docs.xbox.com/reference/live/httpclient/trace/functions/hctracesetclientcallback.md)
