Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SecurityPackageInfoClass.cs
Go to the documentation of this file.
2
3namespace System.Net;
4
5internal sealed class SecurityPackageInfoClass
6{
7 internal int Capabilities;
8
9 internal short Version;
10
11 internal short RPCID;
12
13 internal int MaxToken;
14
15 internal string Name;
16
17 internal string Comment;
18
19 internal unsafe SecurityPackageInfoClass(SafeHandle safeHandle, int index)
20 {
21 if (safeHandle.IsInvalid)
22 {
23 if (System.Net.NetEventSource.Log.IsEnabled())
24 {
25 System.Net.NetEventSource.Info(this, $"Invalid handle: {safeHandle}", ".ctor");
26 }
27 return;
28 }
29 IntPtr intPtr = safeHandle.DangerousGetHandle() + sizeof(System.Net.SecurityPackageInfo) * index;
30 if (System.Net.NetEventSource.Log.IsEnabled())
31 {
32 System.Net.NetEventSource.Info(this, $"unmanagedAddress: {intPtr}", ".ctor");
33 }
35 Capabilities = ptr->Capabilities;
36 Version = ptr->Version;
37 RPCID = ptr->RPCID;
38 MaxToken = ptr->MaxToken;
39 IntPtr name = ptr->Name;
40 if (name != IntPtr.Zero)
41 {
43 if (System.Net.NetEventSource.Log.IsEnabled())
44 {
45 System.Net.NetEventSource.Info(this, $"Name: {Name}", ".ctor");
46 }
47 }
48 name = ptr->Comment;
49 if (name != IntPtr.Zero)
50 {
52 if (System.Net.NetEventSource.Log.IsEnabled())
53 {
54 System.Net.NetEventSource.Info(this, $"Comment: {Comment}", ".ctor");
55 }
56 }
57 if (System.Net.NetEventSource.Log.IsEnabled())
58 {
59 System.Net.NetEventSource.Info(this, ToString(), ".ctor");
60 }
61 }
62
63 public override string ToString()
64 {
65 return $"Capabilities:0x{Capabilities:x} Version:{Version} RPCID:{RPCID} MaxToken:{MaxToken} Name:{Name ?? "(null)"} Comment: {Comment ?? "(null)"}";
66 }
67}
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
unsafe SecurityPackageInfoClass(SafeHandle safeHandle, int index)
static unsafe? string PtrToStringUni(IntPtr ptr)
Definition Marshal.cs:652
Version(int major, int minor, int build, int revision)
Definition Version.cs:47
static readonly IntPtr Zero
Definition IntPtr.cs:18