示例#1
0
        public static unsafe SecurityStatus SafeAcceptSecurityContext(
            ref SafeCredHandle credential,
            ref SafeCtxtHandle context,
            ref SecBufferDescEx input,
            int contextReq,
            TargetDataRep targetDataRep,
            ref SafeCtxtHandle newContext,
            ref SecBufferDescEx output,
            out int contextAttr,
            out long timeStamp)
        {
            try
            {
                input.Pin();
                output.Pin();

                fixed(void *fixedContext = &context._Handle)
                {
                    int error = Secur32Dll.AcceptSecurityContext(
                        ref credential._Handle,
                        (context.IsInvalid) ? null : fixedContext,
                        ref input._SecBufferDesc,
                        contextReq,
                        (int)targetDataRep,
                        ref newContext._Handle,
                        ref output._SecBufferDesc,
                        out contextAttr,
                        out timeStamp);

                    return(Convert(error));
                }
            }
            catch
            {
                contextAttr = 0;
                timeStamp   = 0;
                return(SecurityStatus.SecEUnknowError);
            }
            finally
            {
                input.Free();
                output.Free();
            }
        }
示例#2
0
        public static unsafe SecurityStatus SafeAcceptSecurityContext(
            ref SafeCredHandle credential,
            ref SafeCtxtHandle context,
            ref SecBufferDescEx input,
            int contextReq,
            TargetDataRep targetDataRep,
            ref SafeCtxtHandle newContext,
            ref SecBufferDescEx output)
        {
            int  contextAttr;
            long timeStamp;

            return(SafeAcceptSecurityContext(
                       ref credential,
                       ref context,
                       ref input,
                       contextReq,
                       targetDataRep,
                       ref newContext,
                       ref output,
                       out contextAttr,
                       out timeStamp));
        }
示例#3
0
        public unsafe static SecurityStatus SafeAcceptSecurityContext(ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output, out int contextAttr, out long timeStamp)
        {
            SecurityStatus result;

            try
            {
                input.Pin();
                output.Pin();
                try
                {
                    fixed(IntPtr *ptr = (IntPtr *)(&context.Handle))
                    {
                        int error = Secur32Dll.AcceptSecurityContext(ref credential.Handle, context.IsInvalid ? null : ((void *)ptr), ref input.SecBufferDesc, contextReq, (int)targetDataRep, ref newContext.Handle, ref output.SecBufferDesc, out contextAttr, out timeStamp);

                        result = Sspi.Convert(error);
                    }
                }
                finally
                {
                    IntPtr *ptr = null;
                }
            }
            catch
            {
                contextAttr = 0;
                timeStamp   = 0L;
                result      = (SecurityStatus)4294967295u;
            }
            finally
            {
                input.Free();
                output.Free();
            }
            return(result);
        }
示例#4
0
        public static SecurityStatus SafeAcceptSecurityContext(ref SafeCredHandle credential, ref SafeCtxtHandle context, ref SecBufferDescEx input, int contextReq, TargetDataRep targetDataRep, ref SafeCtxtHandle newContext, ref SecBufferDescEx output)
        {
            int  num;
            long num2;

            return(Sspi.SafeAcceptSecurityContext(ref credential, ref context, ref input, contextReq, targetDataRep, ref newContext, ref output, out num, out num2));
        }