Example #1
0
        public override IntPtr GetCOMIUnknown(bool fIsBeingMarshalled)
        {
            IntPtr result           = IntPtr.Zero;
            object transparentProxy = this.GetTransparentProxy();
            bool   flag             = RemotingServices.IsObjectOutOfProcess(transparentProxy);

            if (flag)
            {
                if (fIsBeingMarshalled)
                {
                    result = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy);
                }
                else
                {
                    result = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy);
                }
            }
            else
            {
                bool flag2 = RemotingServices.IsObjectOutOfAppDomain(transparentProxy);
                if (flag2)
                {
                    result = ((MarshalByRefObject)transparentProxy).GetComIUnknown(fIsBeingMarshalled);
                }
                else
                {
                    result = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy);
                }
            }
            return(result);
        }
Example #2
0
        public override IntPtr GetCOMIUnknown(bool fIsBeingMarshalled)
        {
            object transparentProxy = this.GetTransparentProxy();

            if (RemotingServices.IsObjectOutOfProcess(transparentProxy))
            {
                if (fIsBeingMarshalled)
                {
                    return(MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy));
                }
                return(MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy));
            }
            if (RemotingServices.IsObjectOutOfAppDomain(transparentProxy))
            {
                return(((MarshalByRefObject)transparentProxy).GetComIUnknown(fIsBeingMarshalled));
            }
            return(MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy));
        }
        // interop methods
        public override IntPtr GetCOMIUnknown(bool fIsBeingMarshalled)
        {
            IntPtr pUnk        = IntPtr.Zero;
            Object otp         = GetTransparentProxy();
            bool   fIsXProcess = RemotingServices.IsObjectOutOfProcess(otp);

            if (fIsXProcess)
            {
                // we are in a different process
                if (fIsBeingMarshalled)
                {
                    // we need to go to the server to get the real IUnknown
                    pUnk = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)otp);
                    //
                    // byte[] b = ((MarshalByRefObject)otp).GetDCOMBuffer();
                    // IntPtr pUnk = ComponentServices.GetIUnknownFromDCOMUnmarshalBuffer(b);
                    // return pUnk;;
                }
                else
                {
                    // create an IUnknown here
                    pUnk = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)otp);
                }
            }
            else
            {
                bool fIsXAppDomain = RemotingServices.IsObjectOutOfAppDomain(otp);
                // we are in the same proces, ask the object for its IUnknown
                if (fIsXAppDomain)
                {
                    // do an appdomain switch
                    pUnk = ((MarshalByRefObject)otp).GetComIUnknown(fIsBeingMarshalled);
                }
                else
                {
                    // otherwise go ahead and create a CCW here
                    pUnk = MarshalByRefObject.GetComIUnknown((MarshalByRefObject)otp);
                }
            }

            int i = pUnk.ToInt32();

            return(pUnk);
        }
Example #4
0
        public override IntPtr GetCOMIUnknown(bool fIsBeingMarshalled)
        {
            IntPtr num = IntPtr.Zero;
            object transparentProxy = this.GetTransparentProxy();

            return(!RemotingServices.IsObjectOutOfProcess(transparentProxy) ? (!RemotingServices.IsObjectOutOfAppDomain(transparentProxy) ? MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy) : ((MarshalByRefObject)transparentProxy).GetComIUnknown(fIsBeingMarshalled)) : (!fIsBeingMarshalled ? MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy) : MarshalByRefObject.GetComIUnknown((MarshalByRefObject)transparentProxy)));
        }
Example #5
0
 public virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
 {
     return(MarshalByRefObject.GetComIUnknown((MarshalByRefObject)this.GetTransparentProxy()));
 }
Example #6
0
 [System.Security.SecurityCritical]  // auto-generated
 public virtual IntPtr GetCOMIUnknown(bool fIsMarshalled)
 {
     // sub -class should override
     return(MarshalByRefObject.GetComIUnknown((MarshalByRefObject)GetTransparentProxy()));
 }