-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathUnionDataType.cs
More file actions
81 lines (63 loc) · 1.31 KB
/
UnionDataType.cs
File metadata and controls
81 lines (63 loc) · 1.31 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
using System;
using System.Runtime.InteropServices;
namespace ReClassNET.Memory
{
[StructLayout(LayoutKind.Explicit)]
public struct UInt8Data
{
[FieldOffset(0)]
public sbyte SByteValue;
[FieldOffset(0)]
public byte ByteValue;
}
[StructLayout(LayoutKind.Explicit)]
public struct UInt16Data
{
[FieldOffset(0)]
public short ShortValue;
[FieldOffset(0)]
public ushort UShortValue;
}
[StructLayout(LayoutKind.Explicit)]
public struct UInt32FloatData
{
[FieldOffset(0)]
public int Raw;
[FieldOffset(0)]
public int IntValue;
public IntPtr IntPtr => (IntPtr)IntValue;
[FieldOffset(0)]
public uint UIntValue;
public UIntPtr UIntPtr => (UIntPtr)UIntValue;
[FieldOffset(0)]
public float FloatValue;
}
[StructLayout(LayoutKind.Explicit)]
public struct UInt64FloatDoubleData
{
[FieldOffset(0)]
public int Raw1;
[FieldOffset(4)]
public int Raw2;
[FieldOffset(0)]
public long LongValue;
public IntPtr IntPtr =>
#if RECLASSNET64
(IntPtr)LongValue;
#else
unchecked((IntPtr)(int)LongValue);
#endif
[FieldOffset(0)]
public ulong ULongValue;
public UIntPtr UIntPtr =>
#if RECLASSNET64
(UIntPtr)ULongValue;
#else
unchecked((UIntPtr)(uint)ULongValue);
#endif
[FieldOffset(0)]
public float FloatValue;
[FieldOffset(0)]
public double DoubleValue;
}
}