public static unsafe bool GetTransactionProxyOrTransaction(ref object ppTx, TxInfo pTxInfo)
        {
            IObjectContext *contextPtr = null;

            pTxInfo.isDtcTransaction = false;
            bool flag = false;

            ppTx = null;
            int modopt(IsLong) context = GetContext(&IID_IObjectContext, (void **)&contextPtr);

            if ((context < 0) || (null == contextPtr))
            {
                if (context == -2147467262)
                {
                    return(flag);
                }
                goto Label_019C;
            }
            if (**(((int *)contextPtr))[0x20](contextPtr) != 0)
            {
                flag = true;
            }
            else
            {
                flag = false;
                goto Label_0186;
            }
            IContextTransactionInfoPrivate *privatePtr = null;

            context = **(*((int *)contextPtr))(contextPtr, &_GUID_7d40fcc8_f81e_462e_bba1_8a99ebdc826c, &privatePtr);
            switch (context)
            {
            case 0:
                try
                {
                    IUnknown *unknownPtr = null;
                    context = **(((int *)privatePtr))[12](privatePtr, &unknownPtr);
                    if (context >= 0)
                    {
                        if (unknownPtr == null)
                        {
                            uint modopt(IsLong) num2;
                            int modopt(IsLong) num3;

                            pTxInfo.isDtcTransaction = false;
                            context = **(((int *)privatePtr))[20](privatePtr, &num3, &num2);
                            if (context >= 0)
                            {
                                pTxInfo.IsolationLevel = num3;
                                pTxInfo.timeout        = num2;
                            }
                            break;
                        }
                        IUnknown *unknownPtr3 = null;
                        context = **(*((int *)unknownPtr))(unknownPtr, &_GUID_0fb15084_af41_11ce_bd2b_204c4f4f5020, &unknownPtr3);
                        switch (context)
                        {
                        case 0:
                            pTxInfo.isDtcTransaction = true;
                            * *(((int *)unknownPtr3))[8](unknownPtr3);
                            break;

                        case -2147467262:
                            context = 0;
                            break;
                        }
                        try
                        {
                            if (context >= 0)
                            {
                                IntPtr pUnk = new IntPtr((void *)unknownPtr);
                                ppTx = Marshal.GetObjectForIUnknown(pUnk);
                            }
                        }
                        finally
                        {
                            * *(((int *)unknownPtr))[8](unknownPtr);
                        }
                    }
                    break;
                }
                finally
                {
                    * *(((int *)privatePtr))[8](privatePtr);
                }
                break;

            case -2147467262:
            {
                IObjectContextInfo *infoPtr     = null;
                IUnknown *          unknownPtr2 = null;
                context = **(*((int *)contextPtr))(contextPtr, &IID_IObjectContextInfo, &infoPtr);
                if (context >= 0)
                {
                    try
                    {
                        context = **(((int *)infoPtr))[0x10](infoPtr, &unknownPtr2);
                        if (context >= 0)
                        {
                            pTxInfo.isDtcTransaction = true;
                            try
                            {
                                IntPtr ptr = new IntPtr((void *)unknownPtr2);
                                ppTx = Marshal.GetObjectForIUnknown(ptr);
                            }
                            finally
                            {
                                * *(((int *)unknownPtr2))[8](unknownPtr2);
                            }
                        }
                    }
                    finally
                    {
                        * *(((int *)infoPtr))[8](infoPtr);
                    }
                }
                break;
            }
            }
Label_0186:
            **(((int *)contextPtr))[8](contextPtr);
Label_019C:
            if (context < 0)
            {
                Marshal.ThrowExceptionForHR(context);
            }
            return(flag);
        }
        public static unsafe bool GetTransactionProxyOrTransaction(ref object ppTx, TxInfo pTxInfo)
        {
            IObjectContext* contextPtr = null;
            pTxInfo.isDtcTransaction = false;
            bool flag = false;
            ppTx = null;
            int modopt(IsLong) context = GetContext(&IID_IObjectContext, (void**) &contextPtr);
            if ((context < 0) || (null == contextPtr))
            {
                if (context == -2147467262)
                {
                    return flag;
                }
                goto Label_019C;
            }
            if (**(((int*) contextPtr))[0x20](contextPtr) != 0)
            {
                flag = true;
            }
            else
            {
                flag = false;
                goto Label_0186;
            }
            IContextTransactionInfoPrivate* privatePtr = null;
            context = **(*((int*) contextPtr))(contextPtr, &_GUID_7d40fcc8_f81e_462e_bba1_8a99ebdc826c, &privatePtr);
            switch (context)
            {
                case 0:
                    try
                    {
                        IUnknown* unknownPtr = null;
                        context = **(((int*) privatePtr))[12](privatePtr, &unknownPtr);
                        if (context >= 0)
                        {
                            if (unknownPtr == null)
                            {
                                uint modopt(IsLong) num2;
                                int modopt(IsLong) num3;
                                pTxInfo.isDtcTransaction = false;
                                context = **(((int*) privatePtr))[20](privatePtr, &num3, &num2);
                                if (context >= 0)
                                {
                                    pTxInfo.IsolationLevel = num3;
                                    pTxInfo.timeout = num2;
                                }
                                break;
                            }
                            IUnknown* unknownPtr3 = null;
                            context = **(*((int*) unknownPtr))(unknownPtr, &_GUID_0fb15084_af41_11ce_bd2b_204c4f4f5020, &unknownPtr3);
                            switch (context)
                            {
                                case 0:
                                    pTxInfo.isDtcTransaction = true;
                                    **(((int*) unknownPtr3))[8](unknownPtr3);
                                    break;

                                case -2147467262:
                                    context = 0;
                                    break;
                            }
                            try
                            {
                                if (context >= 0)
                                {
                                    IntPtr pUnk = new IntPtr((void*) unknownPtr);
                                    ppTx = Marshal.GetObjectForIUnknown(pUnk);
                                }
                            }
                            finally
                            {
                                **(((int*) unknownPtr))[8](unknownPtr);
                            }
                        }
                        break;
                    }
                    finally
                    {
                        **(((int*) privatePtr))[8](privatePtr);
                    }
                    break;

                case -2147467262:
                {
                    IObjectContextInfo* infoPtr = null;
                    IUnknown* unknownPtr2 = null;
                    context = **(*((int*) contextPtr))(contextPtr, &IID_IObjectContextInfo, &infoPtr);
                    if (context >= 0)
                    {
                        try
                        {
                            context = **(((int*) infoPtr))[0x10](infoPtr, &unknownPtr2);
                            if (context >= 0)
                            {
                                pTxInfo.isDtcTransaction = true;
                                try
                                {
                                    IntPtr ptr = new IntPtr((void*) unknownPtr2);
                                    ppTx = Marshal.GetObjectForIUnknown(ptr);
                                }
                                finally
                                {
                                    **(((int*) unknownPtr2))[8](unknownPtr2);
                                }
                            }
                        }
                        finally
                        {
                            **(((int*) infoPtr))[8](infoPtr);
                        }
                    }
                    break;
                }
            }
        Label_0186:
            **(((int*) contextPtr))[8](contextPtr);
        Label_019C:
            if (context < 0)
            {
                Marshal.ThrowExceptionForHR(context);
            }
            return flag;
        }