private static int GetSecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle safeHandle)
        {
            int  num     = -2146893055;
            bool success = false;

            safeHandle = null;
            RuntimeHelpers.PrepareConstrainedRegions();
            try
            {
                phContext.DangerousAddRef(ref success);
            }
            catch (Exception exception)
            {
                if (success)
                {
                    phContext.DangerousRelease();
                    success = false;
                }
                if (!(exception is ObjectDisposedException))
                {
                    throw;
                }
            }
            finally
            {
                if (success)
                {
                    num = UnsafeNclNativeMethods.SafeNetHandles.QuerySecurityContextToken(ref phContext._handle, out safeHandle);
                    phContext.DangerousRelease();
                }
            }
            return(num);
        }
Exemplo n.º 2
0
        private static int GetSecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle safeHandle)
        {
            int  status = (int)SecurityStatus.InvalidHandle;
            bool b      = false;

            safeHandle = null;

            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                phContext.DangerousAddRef(ref b);
            }
            catch (Exception e) {
                if (b)
                {
                    phContext.DangerousRelease();
                    b = false;
                }
                if (!(e is ObjectDisposedException))
                {
                    throw;
                }
            }
            finally {
                if (b)
                {
                    status = UnsafeNclNativeMethods.SafeNetHandles.QuerySecurityContextToken(ref phContext._handle, out safeHandle);
                    phContext.DangerousRelease();
                }
            }

            return(status);
        }
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken)
 {
     if (ComNetOS.IsWin9x)
     {
         throw new NotSupportedException();
     }
     return(GetSecurityContextToken(phContext, out phToken));
 }
        internal SafeCloseHandle GetContextToken(out SecurityStatus status)
        {
            if (!this.IsValidContext)
            {
                throw new Win32Exception(-2146893055);
            }
            SafeCloseHandle token = null;

            status = (SecurityStatus)SSPIWrapper.QuerySecurityContextToken(GlobalSSPI.SSPIAuth, this.m_SecurityContext, out token);
            return(token);
        }
        internal SafeCloseHandle GetContextToken()
        {
            SecurityStatus  status;
            SafeCloseHandle contextToken = this.GetContextToken(out status);

            if (status != SecurityStatus.OK)
            {
                throw new Win32Exception((int)status);
            }
            return(contextToken);
        }
 public static int QuerySecurityContextToken(SSPIInterface SecModule, SafeDeleteContext context, out SafeCloseHandle token)
 {
     return(SecModule.QuerySecurityContextToken(context, out token));
 }
Exemplo n.º 7
0
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken)
 {
     return(GetSecurityContextToken(phContext, out phToken));
 }
Exemplo n.º 8
0
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken)
 {
     throw new NotSupportedException();
 }
Exemplo n.º 9
0
        private static int GetSecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle safeHandle) {

            int status = (int)SecurityStatus.InvalidHandle;
            bool b = false;
            safeHandle = null;

            RuntimeHelpers.PrepareConstrainedRegions();
            try {
                phContext.DangerousAddRef(ref b);
            }
            catch (Exception e) {
                if (b) {
                    phContext.DangerousRelease();
                    b = false;
                }
                if (!(e is ObjectDisposedException))
                    throw;
            }
            finally {
                if (b) {
                    status = UnsafeNclNativeMethods.SafeNetHandles.QuerySecurityContextToken(ref phContext._handle, out safeHandle);
                    phContext.DangerousRelease();
                }
            }

            return status;
        }
Exemplo n.º 10
0
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken) {
     return GetSecurityContextToken(phContext, out phToken);
 }
Exemplo n.º 11
0
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken) {
     throw new NotSupportedException();
 }
 internal static extern int QuerySecurityContextToken(ref SSPIHandle phContext, out SafeCloseHandle handle);
 internal static extern uint HttpCreateHttpHandle(out SafeCloseHandle pReqQueueHandle, uint options);
Exemplo n.º 14
0
 public static int QuerySecurityContextToken(SSPIInterface SecModule, SafeDeleteContext context, out SafeCloseHandle token) {
     return SecModule.QuerySecurityContextToken(context, out token);
 }
 public int QuerySecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle phToken)
 {
     if (ComNetOS.IsWin9x)
     {
         throw new NotSupportedException();
     }
     return GetSecurityContextToken(phContext, out phToken);
 }
 private static int GetSecurityContextToken(SafeDeleteContext phContext, out SafeCloseHandle safeHandle)
 {
     int num = -2146893055;
     bool success = false;
     safeHandle = null;
     RuntimeHelpers.PrepareConstrainedRegions();
     try
     {
         phContext.DangerousAddRef(ref success);
     }
     catch (Exception exception)
     {
         if (success)
         {
             phContext.DangerousRelease();
             success = false;
         }
         if (!(exception is ObjectDisposedException))
         {
             throw;
         }
     }
     finally
     {
         if (success)
         {
             num = UnsafeNclNativeMethods.SafeNetHandles.QuerySecurityContextToken(ref phContext._handle, out safeHandle);
             phContext.DangerousRelease();
         }
     }
     return num;
 }