Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Overlapped.cs
Go to the documentation of this file.
1namespace System.Threading;
2
3public class Overlapped
4{
6
8 {
9 get
10 {
12 }
13 set
14 {
15 _overlappedData._asyncResult = value;
16 }
17 }
18
19 public int OffsetLow
20 {
21 get
22 {
24 }
25 set
26 {
27 _overlappedData.OffsetLow = value;
28 }
29 }
30
31 public int OffsetHigh
32 {
33 get
34 {
36 }
37 set
38 {
39 _overlappedData.OffsetHigh = value;
40 }
41 }
42
43 [Obsolete("Overlapped.EventHandle is not 64-bit compatible and has been deprecated. Use EventHandleIntPtr instead.")]
44 public int EventHandle
45 {
46 get
47 {
49 }
50 set
51 {
53 }
54 }
55
57 {
58 get
59 {
61 }
62 set
63 {
64 _overlappedData.EventHandle = value;
65 }
66 }
67
68 public Overlapped()
69 {
71 }
72
73 public Overlapped(int offsetLo, int offsetHi, IntPtr hEvent, IAsyncResult? ar)
74 : this()
75 {
76 _overlappedData.OffsetLow = offsetLo;
77 _overlappedData.OffsetHigh = offsetHi;
78 _overlappedData.EventHandle = hEvent;
79 _overlappedData._asyncResult = ar;
80 }
81
82 [Obsolete("This constructor is not 64-bit compatible and has been deprecated. Use the constructor that accepts an IntPtr for the event handle instead.")]
83 public Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult? ar)
84 : this(offsetLo, offsetHi, new IntPtr(hEvent), ar)
85 {
86 }
87
88 [Obsolete("This overload is not safe and has been deprecated. Use Pack(IOCompletionCallback?, object?) instead.")]
89 [CLSCompliant(false)]
91 {
92 return Pack(iocb, null);
93 }
94
95 [CLSCompliant(false)]
96 public unsafe NativeOverlapped* Pack(IOCompletionCallback? iocb, object? userData)
97 {
98 return _overlappedData.Pack(iocb, userData);
99 }
100
101 [Obsolete("This overload is not safe and has been deprecated. Use UnsafePack(IOCompletionCallback?, object?) instead.")]
102 [CLSCompliant(false)]
104 {
105 return UnsafePack(iocb, null);
106 }
107
108 [CLSCompliant(false)]
109 public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback? iocb, object? userData)
110 {
111 return _overlappedData.UnsafePack(iocb, userData);
112 }
113
114 [CLSCompliant(false)]
115 public unsafe static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr)
116 {
117 if (nativeOverlappedPtr == null)
118 {
119 throw new ArgumentNullException("nativeOverlappedPtr");
120 }
121 return OverlappedData.GetOverlappedFromNative(nativeOverlappedPtr)._overlapped;
122 }
123
124 [CLSCompliant(false)]
125 public unsafe static void Free(NativeOverlapped* nativeOverlappedPtr)
126 {
127 if (nativeOverlappedPtr == null)
128 {
129 throw new ArgumentNullException("nativeOverlappedPtr");
130 }
131 OverlappedData.GetOverlappedFromNative(nativeOverlappedPtr)._overlapped._overlappedData = null;
132 OverlappedData.FreeNativeOverlapped(nativeOverlappedPtr);
133 }
134
135 internal bool IsUserObject(byte[] buffer)
136 {
138 }
139}
unsafe NativeOverlapped * Pack(IOCompletionCallback iocb, object userData)
bool IsUserObject(byte[] buffer)
static unsafe void FreeNativeOverlapped(NativeOverlapped *nativeOverlappedPtr)
static unsafe OverlappedData GetOverlappedFromNative(NativeOverlapped *nativeOverlappedPtr)
unsafe NativeOverlapped * UnsafePack(IOCompletionCallback iocb, object userData)
unsafe NativeOverlapped * UnsafePack(IOCompletionCallback? iocb, object? userData)
Overlapped(int offsetLo, int offsetHi, IntPtr hEvent, IAsyncResult? ar)
Definition Overlapped.cs:73
unsafe NativeOverlapped * UnsafePack(IOCompletionCallback? iocb)
static unsafe Overlapped Unpack(NativeOverlapped *nativeOverlappedPtr)
unsafe NativeOverlapped * Pack(IOCompletionCallback? iocb, object? userData)
Definition Overlapped.cs:96
IAsyncResult? AsyncResult
Definition Overlapped.cs:8
OverlappedData _overlappedData
Definition Overlapped.cs:5
bool IsUserObject(byte[] buffer)
Overlapped(int offsetLo, int offsetHi, int hEvent, IAsyncResult? ar)
Definition Overlapped.cs:83
static unsafe void Free(NativeOverlapped *nativeOverlappedPtr)
unsafe NativeOverlapped * Pack(IOCompletionCallback? iocb)
Definition Overlapped.cs:90
unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped *pOVERLAP)
unsafe int ToInt32()
Definition IntPtr.cs:121