예제 #1
0
        public unsafe static void QueryContextAttributes(
            ref SafeCtxtHandle context,
            UlAttribute attribute,
            void *buffer)
        {
            int error = Secur32Dll.QueryContextAttributesA(
                ref context._Handle,
                (uint)attribute,
                buffer);

            if (error != 0)
            {
                throw new SspiException(error, @"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);
            }
        }