Example #1
0
 internal static int DetermineClientVersion()
 {
     if (_clientVersion == 0)
     {
         int  num             = 0;
         MODE environmentMode = MODE.OCI_DATA_AT_EXEC | MODE.OCI_BATCH_MODE;
         try
         {
             System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0L, 0L, 0L);
             num = 0x65;
         }
         catch (EntryPointNotFoundException exception6)
         {
             System.Data.Common.ADP.TraceException(exception6);
             try
             {
                 OciHandle handle = new OciNlsEnvironmentHandle(environmentMode);
                 if (!handle.IsInvalid)
                 {
                     num = 0x5c;
                     OciHandle.SafeDispose(ref handle);
                 }
             }
             catch (EntryPointNotFoundException exception5)
             {
                 System.Data.Common.ADP.TraceException(exception5);
                 try
                 {
                     environmentMode |= MODE.OCI_UTF16;
                     OciHandle handle2 = new OciEnvironmentHandle(environmentMode, true);
                     num = 90;
                     OciHandle.SafeDispose(ref handle2);
                 }
                 catch (EntryPointNotFoundException exception4)
                 {
                     System.Data.Common.ADP.TraceException(exception4);
                     num = 80;
                 }
                 catch (Exception exception)
                 {
                     if (!System.Data.Common.ADP.IsCatchableExceptionType(exception))
                     {
                         throw;
                     }
                     System.Data.Common.ADP.TraceException(exception);
                     num = 0x51;
                 }
             }
         }
         catch (DllNotFoundException exception3)
         {
             System.Data.Common.ADP.TraceException(exception3);
             num = 0x49;
         }
         catch (BadImageFormatException exception2)
         {
             throw System.Data.Common.ADP.BadOracleClientImageFormat(exception2);
         }
         if (0x51 > num)
         {
             throw System.Data.Common.ADP.BadOracleClientVersion();
         }
         _clientVersion = num;
     }
     return(_clientVersion);
 }
 internal static int DetermineClientVersion()
 {
     if (_clientVersion == 0)
     {
         int num = 0;
         MODE environmentMode = MODE.OCI_DATA_AT_EXEC | MODE.OCI_BATCH_MODE;
         try
         {
             System.Data.Common.UnsafeNativeMethods.OCILobCopy2(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0L, 0L, 0L);
             num = 0x65;
         }
         catch (EntryPointNotFoundException exception6)
         {
             System.Data.Common.ADP.TraceException(exception6);
             try
             {
                 OciHandle handle = new OciNlsEnvironmentHandle(environmentMode);
                 if (!handle.IsInvalid)
                 {
                     num = 0x5c;
                     OciHandle.SafeDispose(ref handle);
                 }
             }
             catch (EntryPointNotFoundException exception5)
             {
                 System.Data.Common.ADP.TraceException(exception5);
                 try
                 {
                     environmentMode |= MODE.OCI_UTF16;
                     OciHandle handle2 = new OciEnvironmentHandle(environmentMode, true);
                     num = 90;
                     OciHandle.SafeDispose(ref handle2);
                 }
                 catch (EntryPointNotFoundException exception4)
                 {
                     System.Data.Common.ADP.TraceException(exception4);
                     num = 80;
                 }
                 catch (Exception exception)
                 {
                     if (!System.Data.Common.ADP.IsCatchableExceptionType(exception))
                     {
                         throw;
                     }
                     System.Data.Common.ADP.TraceException(exception);
                     num = 0x51;
                 }
             }
         }
         catch (DllNotFoundException exception3)
         {
             System.Data.Common.ADP.TraceException(exception3);
             num = 0x49;
         }
         catch (BadImageFormatException exception2)
         {
             throw System.Data.Common.ADP.BadOracleClientImageFormat(exception2);
         }
         if (0x51 > num)
         {
             throw System.Data.Common.ADP.BadOracleClientVersion();
         }
         _clientVersion = num;
     }
     return _clientVersion;
 }