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

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

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

Definition at line 56 of file Helpers.cs.

57 {
58 int pcbStructInfo = 0;
59 if (!global::Interop.crypt32.CryptDecodeObjectPointer(CertEncodingType.All, lpszStructType, encoded, encoded.Length, CryptDecodeObjectFlags.None, null, ref pcbStructInfo))
60 {
61 throw Marshal.GetLastWin32Error().ToCryptographicException();
62 }
63 byte* ptr = stackalloc byte[(int)(uint)pcbStructInfo];
64 if (!global::Interop.crypt32.CryptDecodeObjectPointer(CertEncodingType.All, lpszStructType, encoded, encoded.Length, CryptDecodeObjectFlags.None, ptr, ref pcbStructInfo))
65 {
66 throw Marshal.GetLastWin32Error().ToCryptographicException();
67 }
68 return receiver(ptr, pcbStructInfo);
69 }

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