System.Net.SSPIAuthType.QueryContextAttributes C# (CSharp) Method

QueryContextAttributes() public method

public QueryContextAttributes ( System.Net.SafeDeleteContext context, System.Net.Interop attribute, byte buffer, Type handleType, SafeHandle &refHandle ) : int
context System.Net.SafeDeleteContext
attribute System.Net.Interop
buffer byte
handleType System.Type
refHandle System.Runtime.InteropServices.SafeHandle
return int
        public unsafe int QueryContextAttributes(SafeDeleteContext context, Interop.SspiCli.ContextAttribute attribute, byte[] buffer, Type handleType, out SafeHandle refHandle)
        {
            refHandle = null;
            if (handleType != null)
            {
                if (handleType == typeof(SafeFreeContextBuffer))
                {
                    refHandle = SafeFreeContextBuffer.CreateEmptyHandle();
                }
                else if (handleType == typeof(SafeFreeCertContext))
                {
                    refHandle = new SafeFreeCertContext();
                }
                else
                {
                    throw new ArgumentException(SR.Format(SR.SSPIInvalidHandleType, handleType.FullName), nameof(handleType));
                }
            }

            fixed (byte* bufferPtr = buffer)
            {
                return SafeFreeContextBuffer.QueryContextAttributes(context, attribute, bufferPtr, refHandle);
            }
        }