-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathSymUnmanagedExtensions.Constant.cs
More file actions
47 lines (39 loc) · 1.42 KB
/
SymUnmanagedExtensions.Constant.cs
File metadata and controls
47 lines (39 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the License.txt file in the project root for more information.
using System;
namespace Microsoft.DiaSymReader
{
using static InteropUtilities;
partial class SymUnmanagedExtensions
{
public static string GetName(this ISymUnmanagedConstant constant)
{
if (constant == null)
{
throw new ArgumentNullException(nameof(constant));
}
return BufferToString(GetItems(constant,
(ISymUnmanagedConstant a, int b, out int c, char[] d) => a.GetName(b, out c, d))!);
}
public static object GetValue(this ISymUnmanagedConstant constant)
{
if (constant == null)
{
throw new ArgumentNullException(nameof(constant));
}
object value;
ThrowExceptionForHR(constant.GetValue(out value));
return value;
}
public static byte[] GetSignature(this ISymUnmanagedConstant constant)
{
if (constant == null)
{
throw new ArgumentNullException(nameof(constant));
}
return NullToEmpty(GetItems(constant,
(ISymUnmanagedConstant a, int b, out int c, byte[] d) => a.GetSignature(b, out c, d)));
}
}
}