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

# XGameStreamingInitialize

> XGameStreamingInitialize

# XGameStreamingInitialize

初始化 Game Streaming API。

## 语法

```cpp theme={null}
HRESULT XGameStreamingInitialize(  
)  
```

### 参数

无

### 返回值

类型：HRESULT

如果成功，则返回 S\_OK；否则返回错误代码。有关错误代码列表，请参阅[错误代码](/reference/errorcodes)。

## 备注

<Note>在时间敏感线程上调用此函数并不安全。有关详细信息，请参阅[时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)。</Note>

必须在调用大多数其他 XGameStreaming API 之前调用此 API。如果尚未调用此 API，其他 API 将返回 `E_GAMESTREAMING_NOT_INITIALIZED`。

## 要求

**标头：** XGameStreaming.h

**库：** xgameruntime.lib

**支持的平台：** Windows、XBOX One 系列主机和 XBOX Series 主机

## 概念性文档

* [时间敏感线程](https://learn.microsoft.com/gaming/gdk/docs/gdk-dev/console-dev/overviews/threads/time-sensitive-threads)

## 另请参阅

[XGameStreamingUninitialize](/reference/system/xgamestreaming/functions/xgamestreaminguninitialize)\
[XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members)


## Related topics

- [XGameStreamingUninitialize](/zh-CN/reference/system/xgamestreaming/functions/xgamestreaminguninitialize.md)
- [XGameStreaming](/zh-CN/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingRegisterConnectionStateChanged](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged.md)
- [XGameStreamingSetResolution](/zh-CN/reference/system/xgamestreaming/functions/xgamestreamingsetresolution.md)
- [XGameStreamingGetClients](/zh-CN/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
