Пример #1
0
        public unsafe static void QueryContextAttributes(ref SafeCtxtHandle context, UlAttribute attribute, void *buffer)
        {
            int num = Secur32Dll.QueryContextAttributesA(ref context.Handle, (uint)attribute, buffer);

            if (num != 0)
            {
                throw new SspiException(num, "QueryContextAttributesA");
            }
        }
Пример #2
0
        public unsafe static SecurityStatus SafeQueryContextAttributes(
            ref SafeCtxtHandle context,
            UlAttribute attribute,
            void *buffer)
        {
            try
            {
                int error = Secur32Dll.QueryContextAttributesA(
                    ref context._Handle,
                    (uint)attribute,
                    buffer);

                return(Convert(error));
            }
            catch
            {
                return(SecurityStatus.SecEUnknowError);
            }
        }
Пример #3
0
        public unsafe static SecurityStatus SafeQueryContextAttributes(ref SafeCtxtHandle context, UlAttribute attribute, void *buffer)
        {
            SecurityStatus result;

            try
            {
                int error = Secur32Dll.QueryContextAttributesA(ref context.Handle, (uint)attribute, buffer);
                result = Sspi.Convert(error);
            }
            catch
            {
                result = (SecurityStatus)4294967295u;
            }
            return(result);
        }