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

# Serialize

> 将库的内容写入到提供的内存中，以便稍后提供回运行时。

将库的内容写入到提供的内存中，以便稍后提供回运行时。

## 语法

```cpp theme={null}
HRESULT Serialize(
    void  pData,
    SIZE_T DataSizeInBytes
)
```

### 参数

*pData \[out]*\
类型：void \*

指定指向数据的指针。此内存必须可读可写至输入大小。此数据可以保存并稍后提供给 [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public)，包括此进程或其他进程的未来实例。如果运行时或驱动程序更新，数据将失效，且不可移植到其他硬件或设备。

*DataSizeInBytes*\
类型：SIZE\_T

提供的大小必须至少为从 [GetSerializedSize](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_getserializedsize_public) 返回的大小。

### 返回值

类型：HRESULT

此方法返回一个 HRESULT 成功或错误代码，包括 E\_INVALIDARG（如果提供的缓冲区不够大）。

## 备注

请参阅 [CreatePipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12device1/methods/id3d12device1_createpipelinelibrary_public) 的备注和示例。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机和 XBOX One 系列

## 另请参阅

[ID3D12PipelineLibrary](/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/id3d12pipelinelibrary_public)


## Related topics

- [PartyManager::SerializeNetworkDescriptor](/zh-CN/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_serializenetworkdescriptor.md)
- [D3D12SerializeRootSignature](/zh-CN/reference/graphics/d3d12/functions/d3d12serializerootsignature_public.md)
- [GetSerializedSize](/zh-CN/reference/graphics/d3d12/interfaces/id3d12pipelinelibrary/methods/id3d12pipelinelibrary_getserializedsize_public.md)
- [D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER](/zh-CN/reference/graphics/d3d12/structs/d3d12_serialized_data_driver_matching_identifier_public.md)
- [D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER](/zh-CN/reference/graphics/d3d12/structs/d3d12_serialized_raytracing_acceleration_structure_header_public.md)
