Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SecurityPackageInfoClass() [4/4]

unsafe System.Net.SecurityPackageInfoClass.SecurityPackageInfoClass ( SafeHandle safeHandle,
int index )
inlinepackage

Definition at line 19 of file SecurityPackageInfoClass.cs.

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(SecurityPackageInfo) * index;
30 if (System.Net.NetEventSource.Log.IsEnabled())
31 {
32 System.Net.NetEventSource.Info(this, $"unmanagedAddress: {intPtr}", ".ctor");
33 }
34 SecurityPackageInfo* ptr = (SecurityPackageInfo*)(void*)intPtr;
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 }
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static unsafe? string PtrToStringUni(IntPtr ptr)
Definition Marshal.cs:652

References System.Net.SecurityPackageInfo.Capabilities, System.Net.SecurityPackageInfoClass.Capabilities, System.Net.SecurityPackageInfo.Comment, System.Net.SecurityPackageInfoClass.Comment, System.Runtime.InteropServices.SafeHandle.DangerousGetHandle(), System.index, System.Net.NetEventSource.Info(), System.Runtime.InteropServices.SafeHandle.IsInvalid, System.Net.NetEventSource.Log, System.Net.SecurityPackageInfo.MaxToken, System.Net.SecurityPackageInfoClass.MaxToken, System.Net.SecurityPackageInfo.Name, System.Net.SecurityPackageInfoClass.Name, System.Runtime.InteropServices.Marshal.PtrToStringUni(), System.Net.SecurityPackageInfo.RPCID, System.Net.SecurityPackageInfoClass.RPCID, System.Net.SecurityPackageInfoClass.ToString(), System.Net.SecurityPackageInfo.Version, and System.IntPtr.Zero.