ModuleBuilder.DefineUninitializedData(String, Int32, FieldAttributes) 方法
本文内容
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在可移植可执行 (PE) 文件的 .sdata 部分定义未初始化的数据字段。
public:
System::Reflection::Emit::FieldBuilder ^ DefineUninitializedData(System::String ^ name, int size, System::Reflection::FieldAttributes attributes);
C#
public System.Reflection.Emit.FieldBuilder DefineUninitializedData(string name, int size, System.Reflection.FieldAttributes attributes);
member this.DefineUninitializedData : string * int * System.Reflection.FieldAttributes -> System.Reflection.Emit.FieldBuilder
Public Function DefineUninitializedData (name As String, size As Integer, attributes As FieldAttributes) As FieldBuilder
- name
- String
用于引用数据的名称。
name
不能包含嵌入的 null。
- size
- Int32
数据字段的大小。
- attributes
- FieldAttributes
字段的属性。
用于引用数据的字段。
name
为 null
。
Static 将自动包含在 中 attributes
。
在调用 方法之前, CreateGlobalFunctions 不会创建此方法定义的数据。
备注
从 .NET Framework 2.0 Service Pack 1 开始,此成员不再需要ReflectionPermission标志ReflectionPermissionFlag.ReflectionEmit。 (请参阅反射发出中的安全问题.) 若要使用此功能,应用程序应面向.NET Framework 3.5 或更高版本。
产品 | 版本 |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided), 2.1 |