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

# XGameRuntimeInit（API 内容）

> XGameRuntimeInit

# XGameRuntimeInit

XGameRuntimeInit API 的参考资料。

## Functions

| Function | Description |
| - | - |
| [XGameRuntimeInitialize](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize.md) | 初始化 Gaming Runtime。 |
| [XGameRuntimeUninitialize](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/functions/xgameruntimeuninitialize.md) | 取消初始化 Gaming Runtime。 |

## Error Codes

XGameRuntime API 可能返回以下错误代码。有关完整列表，请参阅[错误代码](https://docs.xbox.com/zh-CN/reference/errorcodes.md)。

| Code | Value | Description |
| - | - | - |
| E\_GAMERUNTIME\_NOT\_INITIALIZED | 0x89240100 | 游戏运行时未初始化。 |
| E\_GAMERUNTIME\_DLL\_NOT\_FOUND | 0x89240101 | 找不到游戏运行时 DLL。 |
| E\_GAMERUNTIME\_VERSION\_MISMATCH | 0x89240102 | 游戏运行时 DLL 不支持此版本的 GDK。 |
| E\_GAMERUNTIME\_WINDOW\_NOT\_FOREGROUND | 0x89240103 | 该操作要求应用程序窗口位于前台。 |
| E\_GAMERUNTIME\_SUSPENDED | 0x89240104 | 游戏运行时处于挂起状态。 |
| E\_GAMERUNTIME\_UNINITIALIZE\_ACTIVEOBJECTS | 0x89240105 | 在 XGameRuntimeUninitialize 时游戏运行时存在活动对象。 |
| E\_GAMERUNTIME\_MULTIPLAYER\_NOT\_CONFIGURED | 0x89240106 | 未在此标题上为此用户在服务上设置任何多人游戏活动。 |
| E\_GAMERUNTIME\_OPTIONS\_MISMATCH | 0x89240109 | 运行时已使用不同的选项集初始化。请在使用新选项重新初始化之前取消初始化。 |
| E\_GAMERUNTIME\_OPTIONS\_NOT\_SUPPORTED | 0x8924010A | 传递的选项与游戏的包不兼容。游戏配置信息必须与包匹配。 |
| E\_GAMERUNTIME\_GAMECONFIG\_BAD\_FORMAT | 0x8924010B | 传递给 Initialize 的游戏配置无法解析。 |
| E\_GAMERUNTIME\_INVALID\_HANDLE | 0x8924010C | 句柄在跨运行时初始化时不能有效使用。 |

## Conceptual documentation

* [在 Unity 项目中为 GDK API 使用 C# 包装器](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/pc-dev/tutorials/get-started-with-unity-pc/features/gdk-unity-api-wrappers)

## See also

[系统 API 参考](https://docs.xbox.com/zh-CN/reference/system/gc-reference-system-toc.md)


## Related topics

- [XGameRuntimeTypes（API 内容）](https://docs.xbox.com/zh-CN/reference/system/xgameruntimetypes/xgameruntimetypes_members.md)
- [XGameRuntimeInitialize](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/functions/xgameruntimeinitialize.md)
- [XGameRuntimeInitializeWithOptions](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/functions/xgameruntimeinitializewithoptions.md)
- [XGameRuntimeOptions](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/Structures/xgameruntimeoptions.md)
- [XGameRuntimeGameConfigSource](https://docs.xbox.com/zh-CN/reference/system/xgameruntimeinit/Enumerations/xgameruntimegameconfigsource.md)
