System.Net.SecPkgContext_Sizes.SecPkgContext_Sizes C# (CSharp) Method

SecPkgContext_Sizes() private method

private SecPkgContext_Sizes ( byte memory ) : System.Diagnostics
memory byte
return System.Diagnostics
        internal unsafe SecPkgContext_Sizes(byte[] memory)
        {
            fixed (void* voidPtr = memory)
            {
                IntPtr unmanagedAddress = new IntPtr(voidPtr);
                try
                {
                    // TODO (Issue #3114): replace with Marshal.PtrToStructure.
                    cbMaxToken = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress));
                    cbMaxSignature = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 4));
                    cbBlockSize = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 8));
                    cbSecurityTrailer = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 12));
                }
                catch (OverflowException)
                {
                    NetEventSource.Fail(this, "Negative size.");
                    throw;
                }
            }
        }
SecPkgContext_Sizes