Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SafeTokenHandle.cs
Go to the documentation of this file.
1using System;
3
5
6internal sealed class SafeTokenHandle : SafeHandle
7{
8 public override bool IsInvalid
9 {
10 get
11 {
12 if (!(handle == new IntPtr(0)))
13 {
14 return handle == new IntPtr(-1);
15 }
16 return true;
17 }
18 }
19
21 : base(IntPtr.Zero, ownsHandle: true)
22 {
23 }
24
26 : base(IntPtr.Zero, ownsHandle: true)
27 {
29 }
30
31 protected override bool ReleaseHandle()
32 {
33 return global::Interop.Kernel32.CloseHandle(handle);
34 }
35}