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

# XSystemHandleCallback

> XSystemHandleCallback

# XSystemHandleCallback

Callback that is invoked when a GRTS handle is created or destroyed.

## Syntax

```cpp theme={null}
typedef void (CALLBACK *XSystemHandleCallback)(
    _In_ XSystemHandle handle,
    _In_ XSystemHandleType type,
    _In_ XSystemHandleCallbackReason reason,
    _In_ void* context
    );
```

### Parameters

*handle*    \_In\_\
Type: XSystemHandle

The XSystemHandle whose state is changing. Callers will need to statically cast this to the correct
GRTS handle type based on what is passed in the *type* parameter.

*type*    \_In\_\
Type: [XSystemHandleType](/reference/system/xsystem/enums/xsystemhandletype)

The GRTS type of the handle getting created or destroyed.

*reason*    \_In\_\
Type: [XSystemHandleCallbackReason](/reference/system/xsystem/enums/xsystemhandlecallbackreason)

Indicates if the handle is getting created or destroyed.

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

User define context to be passed to the callback.

## Remarks

This callback is set when the game calls [XSystemHandleTrack](/reference/system/xsystem/functions/xsystemhandletrack).

## Requirements

**Header:** XSystem.h

**Library:** xgameruntime.lib

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

## See also

[XSystem members](/reference/system/xsystem/xsystem_members)

[XSystemHandleTrack](/reference/system/xsystem/functions/xsystemhandletrack)
