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

# XSystemGetAnalyticsInfo

> XSystemGetAnalyticsInfo

# XSystemGetAnalyticsInfo

Provides diagnostic information about the operating system and device on which the game is running.

## Syntax

```cpp theme={null}
XSystemAnalyticsInfo XSystemGetAnalyticsInfo(  
)  
```

### Parameters

None.

### Return value

Type: [XSystemAnalyticsInfo](/reference/system/xsystem/structs/xsystemanalyticsinfo)

Returns an [XSystemAnalyticsInfo](/reference/system/xsystem/structs/xsystemanalyticsinfo) structure that contains information about the current device.

## Remarks

<Note>This function isn't safe to call on a time-sensitive thread. For more information, see [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads).</Note>

The **XSystemGetAnalyticsInfo** function returns an [XSystemAnalyticsInfo](/reference/system/xsystem/structs/xsystemanalyticsinfo) structure that contains diagnostic information about the current device. This information includes the versions of both the operating system in which the game is running and the operating system from which the game was launched, as well as the family and form of the device.

The following example illustrates how to retrieve the version information for the operating system in which a game is running, by invoking **XSystemGetAnalyticsInfo** and concatenating the results returned in the *osVersion* member of **XSystemAnalyticsInfo**.

```cpp theme={null}
// Get the version of the operating system in which the game is running.
std::string Game::GetGameOSVersion()
{
    // Call XSystemGetAnalyticsInfo()
    XSystemAnalyticsInfo info = XSystemGetAnalyticsInfo();

    // Return a formatted string from the osVersion member of XSystemAnalyticsInfo.
    return std::to_string(info.osVersion.major) + "." +
        std::to_string(info.osVersion.minor) + "." +
        std::to_string(info.osVersion.build) + "." +
        std::to_string(info.osVersion.revision);

}
```

## Requirements

**Header:** XSystem.h

**Library:** xgameruntime.lib

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

## Conceptual documentation

* [Time-sensitive threads](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XSystem](/reference/system/xsystem/xsystem_members)\
[XSystemAnalyticsInfo](/reference/system/xsystem/structs/xsystemanalyticsinfo)
