internal unsafe SecPkgContext_StreamSizes(byte[] memory)
{
fixed (void* voidPtr = memory)
{
var unmanagedAddress = new IntPtr(voidPtr);
try
{
// TODO (Issue #3114): replace with Marshal.PtrToStructure.
cbHeader = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress));
cbTrailer = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 4));
cbMaximumMessage = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 8));
cBuffers = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 12));
cbBlockSize = (int)checked((uint)Marshal.ReadInt32(unmanagedAddress, 16));
}
catch (OverflowException)
{
NetEventSource.Fail(this, "Negative size.");
throw;
}
}
}