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;
}
}
}