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

◆ DecodeObject< TResult >() [2/2]

static unsafe TResult Internal.Cryptography.Pal.Native.Helpers.DecodeObject< TResult > ( this byte[] encoded,
string lpszStructType,
DecodedObjectReceiver< TResult > receiver )
inlinestatic

Definition at line 71 of file Helpers.cs.

72 {
73 int pcbStructInfo = 0;
74 if (!global::Interop.crypt32.CryptDecodeObjectPointer(CertEncodingType.All, lpszStructType, encoded, encoded.Length, CryptDecodeObjectFlags.None, null, ref pcbStructInfo))
75 {
76 throw Marshal.GetLastWin32Error().ToCryptographicException();
77 }
78 byte* ptr = stackalloc byte[(int)(uint)pcbStructInfo];
79 if (!global::Interop.crypt32.CryptDecodeObjectPointer(CertEncodingType.All, lpszStructType, encoded, encoded.Length, CryptDecodeObjectFlags.None, ptr, ref pcbStructInfo))
80 {
81 throw Marshal.GetLastWin32Error().ToCryptographicException();
82 }
83 return receiver(ptr, pcbStructInfo);
84 }

References System.Runtime.InteropServices.Marshal.GetLastWin32Error().