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

# XSystemGetAnalyticsInfo

> XSystemGetAnalyticsInfo

# XSystemGetAnalyticsInfo

ゲームが実行されているオペレーティング システムおよびデバイスに関する診断情報を提供します。

## Syntax

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

### Parameters

なし。

### Return value

型: [XSystemAnalyticsInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/structs/xsystemanalyticsinfo.md)

現在のデバイスに関する情報を含む [XSystemAnalyticsInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/structs/xsystemanalyticsinfo.md) 構造体を返します。

## Remarks

> [!NOTE]
>
> この関数はタイム センシティブなスレッドで呼び出すのは安全ではありません。詳細については、[タイム センシティブなスレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads) を参照してください。

**XSystemGetAnalyticsInfo** 関数は、現在のデバイスに関する診断情報を含む [XSystemAnalyticsInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/structs/xsystemanalyticsinfo.md) 構造体を返します。この情報には、ゲームが実行されているオペレーティング システムのバージョン、ゲームが起動されたオペレーティング システムのバージョン、およびデバイスのファミリーと形態が含まれます。

次の例は、**XSystemGetAnalyticsInfo** を呼び出して **XSystemAnalyticsInfo** の *osVersion* メンバーで返された結果を連結することにより、ゲームが実行されているオペレーティング システムのバージョン情報を取得する方法を示しています。

```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

**ヘッダー:** XSystem.h

**ライブラリ:** xgameruntime.lib

**サポートされているプラットフォーム:** Windows、XBOX One ファミリー本体および XBOX Series 本体

## Conceptual documentation

* [タイム センシティブなスレッド](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## See also

[XSystem](https://docs.xbox.com/ja-jp/reference/system/xsystem/xsystem_members.md)\
[XSystemAnalyticsInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/structs/xsystemanalyticsinfo.md)


## Related topics

- [XSystemAnalyticsInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/structs/xsystemanalyticsinfo.md)
- [XSystem (API の内容)](https://docs.xbox.com/ja-jp/reference/system/xsystem/xsystem_members.md)
- [XSystemGetRuntimeInfo](https://docs.xbox.com/ja-jp/reference/system/xsystem/functions/xsystemgetruntimeinfo.md)
- [XVersion](https://docs.xbox.com/ja-jp/reference/system/xgameruntimetypes/structs/xversion.md)
- [Report Device Info](https://docs.xbox.com/api-reference/analytics/report-device-info.md)
