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

QueryContextAttributes() public method

public QueryContextAttributes ( SafeDeleteContext phContext, System.Net.Interop attribute, byte buffer, Type handleType, SafeHandle &refHandle ) : int
phContext SafeDeleteContext
attribute System.Net.Interop
buffer byte
handleType Type
refHandle System.Runtime.InteropServices.SafeHandle
return int
        public unsafe int QueryContextAttributes(SafeDeleteContext phContext, 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(phContext, attribute, bufferPtr, refHandle);
            }
        }