未验证 提交 15e89256 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Explicitly set SizeConst = 1 and remove the warning suppression (#90174)

上级 baeb1507
......@@ -377,24 +377,14 @@ public class MarshalAsHolders
[MarshalAs(UnmanagedType.IDispatch, IidParameterIndex = 42)]
public int F4;
// We are explicitly testing ByValArray without a SizeConst
// CS9125: Attribute parameter 'SizeConst' must be specified.
#pragma warning disable CS9125
[MarshalAs(UnmanagedType.ByValArray)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
public int F5;
#pragma warning restore CS9125
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public int F6;
// We are explicitly testing ByValArray without a SizeConst
// CS9125: Attribute parameter 'SizeConst' must be specified.
#pragma warning disable CS9125
[MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.FunctionPtr)]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1, ArraySubType = UnmanagedType.FunctionPtr)]
public int F7;
#pragma warning restore CS9125
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 87, ArraySubType = UnmanagedType.FunctionPtr)]
public int F8;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册