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