Author: joncham
Date: 2006-07-15 09:13:55 -0400 (Sat, 15 Jul 2006)
New Revision: 62639

Added:
   trunk/mcs/class/corlib/Mono.Interop/
   trunk/mcs/class/corlib/Mono.Interop/ChangeLog
   trunk/mcs/class/corlib/Mono.Interop/ComInteropProxy.cs
Modified:
   trunk/mcs/class/corlib/ChangeLog
   trunk/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
   trunk/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
   
trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs
   trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog
   trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
   trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
   trunk/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
   trunk/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
   trunk/mcs/class/corlib/System/ChangeLog
   trunk/mcs/class/corlib/System/Environment.cs
   trunk/mcs/class/corlib/System/__ComObject.cs
   trunk/mcs/class/corlib/corlib.dll.sources
Log:
2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>

        Begin implementing COM Interop.


Modified: trunk/mcs/class/corlib/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/ChangeLog    2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/ChangeLog    2006-07-15 13:13:55 UTC (rev 62639)
@@ -1,3 +1,7 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * corlib.dll.sources: Added Mono.Interop/ComInteropProxy.cs
+       
 2006-07-09  Gert Driesen  <[EMAIL PROTECTED]>
 
        * corlib_test.dll.sources: Added DynamicMethodTest.cs from

Added: trunk/mcs/class/corlib/Mono.Interop/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Mono.Interop/ChangeLog       2006-07-15 11:21:55 UTC 
(rev 62638)
+++ trunk/mcs/class/corlib/Mono.Interop/ChangeLog       2006-07-15 13:13:55 UTC 
(rev 62639)
@@ -0,0 +1,4 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * ComInteropProxy.cs: Added.
+

Added: trunk/mcs/class/corlib/Mono.Interop/ComInteropProxy.cs
===================================================================
--- trunk/mcs/class/corlib/Mono.Interop/ComInteropProxy.cs      2006-07-15 
11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/Mono.Interop/ComInteropProxy.cs      2006-07-15 
13:13:55 UTC (rev 62639)
@@ -0,0 +1,87 @@
+//
+// Mono.Interop.ComInteropProxy
+//
+// Authors:
+//   Jonathan Chambers <[EMAIL PROTECTED]>
+//
+// Copyright (C) 2006 Novell (http://www.novell.com)
+//
+
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.Remoting;
+using System.Runtime.Remoting.Messaging;
+using System.Runtime.Remoting.Proxies;
+
+
+namespace Mono.Interop
+{
+       internal class ComInteropProxy : RealProxy, IRemotingTypeInfo
+    {
+        #region Sync with object-internals.h
+               private __ComObject com_object;
+        #endregion
+        private string type_name;
+               public ComInteropProxy (Type t)
+                       : base (t)
+               {
+                       com_object = __ComObject.CreateRCW (t);
+               }
+
+        internal ComInteropProxy (IntPtr pUnk)
+            : base (typeof (__ComObject))
+        {
+            com_object = new __ComObject(pUnk);
+        }
+
+               public override IMessage Invoke (IMessage msg)
+               {
+                       Console.WriteLine ("Invoke");
+
+                       throw new Exception ("The method or operation is not 
implemented.");
+               }
+
+               public string TypeName
+               {
+                       get { return type_name; }
+                       set { type_name = value; }
+               }
+
+               public bool CanCastTo (Type fromType, object o)
+               {
+            __ComObject co = o as __ComObject;
+            if (co == null)
+                throw new NotSupportedException ("Only RCWs are currently 
supported");
+
+            if ((fromType.Attributes & TypeAttributes.Import) == 0)
+                return false;
+
+            if (co.GetInterface (fromType) == IntPtr.Zero)
+                return false;
+            
+            return true;
+               }
+       }
+}

Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog     2006-07-15 11:21:55 UTC (rev 
62638)
+++ trunk/mcs/class/corlib/System/ChangeLog     2006-07-15 13:13:55 UTC (rev 
62639)
@@ -1,3 +1,8 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * __ComObject.cs: Begin implementing COM Interop.
+       * Environment.cs: Increment corlib version.
+       
 2006-07-12  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * Delegate.cs (DynamicInvokeImpl): Add support for bound delegates in 
Net 2.0.

Modified: trunk/mcs/class/corlib/System/Environment.cs
===================================================================
--- trunk/mcs/class/corlib/System/Environment.cs        2006-07-15 11:21:55 UTC 
(rev 62638)
+++ trunk/mcs/class/corlib/System/Environment.cs        2006-07-15 13:13:55 UTC 
(rev 62639)
@@ -59,7 +59,7 @@
                 * Changes which are already detected at runtime, like the 
addition
                 * of icalls, do not require an increment.
                 */
-               private const int mono_corlib_version = 53;
+               private const int mono_corlib_version = 54;
                
                [MonoTODO]
                public enum SpecialFolder

Modified: trunk/mcs/class/corlib/System/__ComObject.cs
===================================================================
--- trunk/mcs/class/corlib/System/__ComObject.cs        2006-07-15 11:21:55 UTC 
(rev 62638)
+++ trunk/mcs/class/corlib/System/__ComObject.cs        2006-07-15 13:13:55 UTC 
(rev 62639)
@@ -4,6 +4,7 @@
 // Authors:
 //   Sebastien Pouliot <[EMAIL PROTECTED]>
 //   Korn�l P�l <http://www.kornelpal.hu/>
+//   Jonathan Chambers <[EMAIL PROTECTED]>
 //
 // Copyright (C) 2004 Novell (http://www.novell.com)
 // Copyright (C) 2005 Korn�l P�l
@@ -30,6 +31,10 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
 namespace System
 {
        // This is a private class that is used as a generic wrapper class
@@ -45,8 +50,125 @@
 
        internal class __ComObject : MarshalByRefObject
        {
-               private __ComObject ()
+               #region Sync with object-internals.h
+               IntPtr hash_table;
+               #endregion
+
+               // this is used internally and for the the methods
+               // Marshal.GetComObjectData and Marshal.SetComObjectData
+               Hashtable hashtable;
+
+               [ThreadStatic]
+               static bool coinitialized;
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern void Finalizer ();
+
+               ~__ComObject ()
                {
+                       Finalizer ();
                }
+
+               public __ComObject ()
+               {
+                       // call CoInitialize once per thread
+                       if (!coinitialized) {
+                               CoInitialize (IntPtr.Zero);
+                               coinitialized = true;
+                       }
+
+                       hashtable = new Hashtable ();
+
+                       IntPtr ppv;
+                       int hr = CoCreateInstance (GetType ().GUID, 
IntPtr.Zero, 0x1 | 0x4 | 0x10, IID_IUnknown, out ppv);
+                       Marshal.ThrowExceptionForHR (hr);
+
+                       SetIUnknown (ppv);
+               }
+
+        public __ComObject (IntPtr pItf)
+        {
+            hashtable = new Hashtable ();
+
+            IntPtr ppv;
+            Guid iid = IID_IUnknown;
+                       int hr = Marshal.QueryInterface (pItf, ref iid, out 
ppv);
+                       Marshal.ThrowExceptionForHR (hr);
+
+                       SetIUnknown (ppv);
+        }
+
+               public Hashtable Hashtable
+               {
+                       get
+                       {
+                               return hashtable;
+                       }
+               }
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               internal static extern __ComObject CreateRCW (Type t);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern void SetIUnknown (IntPtr t);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern IntPtr GetIUnknown ();
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern IntPtr FindInterface (Type t);
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               extern void CacheInterface (Type t, IntPtr pItf);
+
+               internal IntPtr GetInterface(Type t)
+               {
+                       IntPtr pItf = FindInterface (t);
+                       if (pItf != IntPtr.Zero) {
+                               return pItf;
+                       }
+
+                       Guid iid = t.GUID;
+                       IntPtr ppv;
+                       int hr = Marshal.QueryInterface (GetIUnknown(), ref 
iid, out ppv);
+                       Marshal.ThrowExceptionForHR (hr);
+                       CacheInterface (t, ppv);
+                       return ppv;
+               }
+
+               internal IntPtr IUnknown
+               {
+                       get
+                       {
+                               return GetIUnknown();
+                       }
+               }
+
+               internal static Guid IID_IUnknown
+               {
+                       get
+                       {
+                               return new 
Guid("00000000-0000-0000-C000-000000000046");
+                       }
+               }
+
+               internal static Guid IID_IDispatch
+               {
+                       get
+                       {
+                               return new Guid 
("00020400-0000-0000-C000-000000000046");
+                       }
+               }
+
+               [DllImport ("ole32.dll", CallingConvention = 
CallingConvention.StdCall)]
+               static extern int CoInitialize (IntPtr pvReserved);
+
+               [DllImport ("ole32.dll", CallingConvention = 
CallingConvention.StdCall, ExactSpelling = true, PreserveSig = true)]
+               static extern int CoCreateInstance (
+                  [In, MarshalAs (UnmanagedType.LPStruct)] Guid rclsid,
+                  IntPtr pUnkOuter,
+                  uint dwClsContext,
+                 [In, MarshalAs (UnmanagedType.LPStruct)] Guid riid,
+                       out IntPtr pUnk);
        }
 }

Modified: trunk/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog     
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.InteropServices/ChangeLog     
2006-07-15 13:13:55 UTC (rev 62639)
@@ -1,3 +1,10 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * Marshal.cs: Begin implementing COM Interop. Implemented
+       AddRef, GetComInterfaceForObject, GetComObjectData, 
GetIUnknownForObject,
+       GetObjectForIUnknown, GetTypedObjectForIUnknown, IsComObject, 
QueryInterface
+       Release, SetComObjectData, and ThrowExceptionForHR.
+       
 2006-06-07  Jonathan Chambers  <[EMAIL PROTECTED]>
 
        * Marshal.cs: Implement GetComSlotForMethodInfo

Modified: trunk/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs    
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.InteropServices/Marshal.cs    
2006-07-15 13:13:55 UTC (rev 62639)
@@ -3,6 +3,7 @@
 // Sean MacIsaac ([EMAIL PROTECTED])
 // Paolo Molaro ([EMAIL PROTECTED])
 // Dietmar Maurer ([EMAIL PROTECTED])
+// Jonathan Chambers ([EMAIL PROTECTED])
 //
 // (C) 2001-2002 Ximian, Inc.
 
@@ -29,6 +30,7 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
+using Mono.Interop;
 using System.Runtime.CompilerServices;
 using System;
 using System.Security;
@@ -58,10 +60,8 @@
                private Marshal () {}
 #endif
 
-               [MonoTODO]
-               public static int AddRef (IntPtr pUnk) {
-                       throw new NotImplementedException ();
-               }
+        [MethodImplAttribute (MethodImplOptions.InternalCall)]
+        public extern static int AddRef (IntPtr pUnk);
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static IntPtr AllocCoTaskMem (int cb);
@@ -222,7 +222,13 @@
 
                [MonoTODO]
                public static IntPtr GetComInterfaceForObject (object o, Type 
T) {
-                       throw new NotImplementedException ();
+            __ComObject co = o as __ComObject;
+            if (co == null)
+                           throw new NotSupportedException ("Only RCWs are 
currently supported");
+
+                       IntPtr pUnk = co.GetInterface (T);
+                       AddRef (pUnk);
+                       return pUnk;
                }
 
 #if NET_2_0
@@ -232,9 +238,17 @@
                }
 #endif
 
-               [MonoTODO]
                public static object GetComObjectData (object obj, object key) {
-                       throw new NotImplementedException ();
+                       if (obj == null)
+                               throw new ArgumentNullException ("obj");
+                       if (key == null)
+                               throw new ArgumentNullException ("key");
+
+                       __ComObject com_object = obj as __ComObject;
+                       if (com_object == null)
+                               throw new ArgumentException ("obj is not a COM 
object", "obj");
+
+                       return com_object.Hashtable[key];
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -300,6 +314,13 @@
 
                [MonoTODO]
                public static IntPtr GetIUnknownForObject (object o) {
+                       // only handle case of RCW objects for now
+                       __ComObject co = o as __ComObject;
+                       if (co != null) {
+                               IntPtr pUnk = co.IUnknown;
+                               AddRef (pUnk);
+                               return pUnk;
+                       }
                        throw new NotImplementedException ();
                }
 
@@ -332,9 +353,9 @@
                        Marshal.StructureToPtr(vt, pDstNativeVariant, false);
                }
 
-               [MonoTODO]
                public static object GetObjectForIUnknown (IntPtr pUnk) {
-                       throw new NotImplementedException ();
+            ComInteropProxy proxy = new ComInteropProxy (pUnk);
+            return proxy.GetTransparentProxy ();
                }
 
                public static object GetObjectForNativeVariant (IntPtr 
pSrcNativeVariant) {
@@ -357,10 +378,18 @@
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
-               public static object GetTypedObjectForIUnknown (IntPtr pUnk, 
Type t) {
-                       throw new NotImplementedException ();
-               }
+        public static object GetTypedObjectForIUnknown (IntPtr pUnk, Type t)
+        {
+            ComInteropProxy proxy = new ComInteropProxy (pUnk);
+            __ComObject co = (__ComObject)proxy.GetTransparentProxy ();
+            foreach (Type itf in t.GetInterfaces ()) {
+                if ((itf.Attributes & TypeAttributes.Import) == 
TypeAttributes.Import) {
+                    if (co.GetInterface (itf) == IntPtr.Zero)
+                        return null;
+                }
+            }
+            return co;
+        }
 
                [MonoTODO]
                public static Type GetTypeForITypeInfo (IntPtr piTypeInfo) {
@@ -416,9 +445,10 @@
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public static bool IsComObject (object o) {
-                       throw new NotImplementedException ();
+                       Type t = o.GetType ();
+                       object[] attrs = t.GetCustomAttributes (typeof 
(ComImportAttribute), true);
+                       return (attrs != null && attrs.Length > 0);
                }
 
                [MonoTODO]
@@ -467,10 +497,8 @@
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static object PtrToStructure (IntPtr ptr, Type 
structureType);
 
-               [MonoTODO]
-               public static int QueryInterface (IntPtr pUnk, ref Guid iid, 
out IntPtr ppv) {
-                       throw new NotImplementedException ();
-               }
+        [MethodImplAttribute (MethodImplOptions.InternalCall)]
+        public extern static int QueryInterface (IntPtr pUnk, ref Guid iid, 
out IntPtr ppv);
 
                public static byte ReadByte (IntPtr ptr) {
                        return ReadByte (ptr, 0);
@@ -570,10 +598,8 @@
 #if NET_2_0
                [ReliabilityContractAttribute (Consistency.WillNotCorruptState, 
Cer.Success)]
 #endif
-               [MonoTODO]
-               public static int Release (IntPtr pUnk) {
-                       throw new NotImplementedException ();
-               }
+        [MethodImplAttribute (MethodImplOptions.InternalCall)]
+        public extern static int Release (IntPtr pUnk);
 
                [MonoTODO]
                public static int ReleaseComObject (object o) {
@@ -588,9 +614,18 @@
                        throw new NotImplementedException ();
                }
 
-               [MonoTODO]
                public static bool SetComObjectData (object obj, object key, 
object data) {
-                       throw new NotImplementedException ();
+                       if (obj == null)
+                               throw new ArgumentNullException ("obj");
+                       if (key == null)
+                               throw new ArgumentNullException ("key");
+
+                       __ComObject com_object = obj as __ComObject;
+                       if (com_object == null)
+                               throw new ArgumentException ("obj is not a COM 
object", "obj");
+
+                       com_object.Hashtable[key] = data;
+                       return true;
                }
 
                public static int SizeOf (object structure) {
@@ -690,9 +725,9 @@
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
                public extern static void StructureToPtr (object structure, 
IntPtr ptr, bool fDeleteOld);
 
-               [MonoTODO]
                public static void ThrowExceptionForHR (int errorCode) {
-                       throw new NotImplementedException ();
+            if (errorCode < 0)
+                           throw new COMException ("", errorCode);
                }
 
                [MonoTODO]

Modified: trunk/mcs/class/corlib/System.Runtime.Remoting/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.Remoting/ChangeLog    2006-07-15 
11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.Remoting/ChangeLog    2006-07-15 
13:13:55 UTC (rev 62639)
@@ -1,3 +1,7 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * RemotingServices.cs: Begin implementing COM Interop.
+
 2006-04-27  Robert Jordan  <[EMAIL PROTECTED]>
 
        * RemotingServices.cs (IsObjectOutOfAppDomain, IsObjectOutOfContext):

Modified: trunk/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs  
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.Remoting/RemotingServices.cs  
2006-07-15 13:13:55 UTC (rev 62639)
@@ -529,6 +529,12 @@
                        RemotingProxy proxy = new RemotingProxy (type, 
ChannelServices.CrossContextUrl, activationAttributes);
                        return proxy.GetTransparentProxy();
                }
+
+               internal static object CreateClientProxyForComInterop (Type 
type)
+               {
+                       Mono.Interop.ComInteropProxy proxy = new 
Mono.Interop.ComInteropProxy (type);
+                       return proxy.GetTransparentProxy ();
+               }
        
                internal static Identity GetIdentityForUri (string uri)
                {

Modified: 
trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs
===================================================================
--- 
trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs 
    2006-07-15 11:21:55 UTC (rev 62638)
+++ 
trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ActivationServices.cs 
    2006-07-15 13:13:55 UTC (rev 62639)
@@ -67,14 +67,14 @@
 
                public static IMessage RemoteActivate (IConstructionCallMessage 
ctorCall)
                {
-                       try 
+                       try 
                        {
                                return ctorCall.Activator.Activate (ctorCall);
                        }
-                       catch (Exception ex) 
+                       catch (Exception ex) 
                        {
                                return new ReturnMessage (ex, ctorCall);
-                       }               
+                       }               
                }
 
                public static object CreateProxyFromAttributes (Type type, 
object[] activationAttributes)
@@ -204,6 +204,9 @@
                        if (type.IsContextful)
                                return 
RemotingServices.CreateClientProxyForContextBound (type, null);
 
+            if (type.IsImport)
+                return RemotingServices.CreateClientProxyForComInterop (type);
+
                        return null;
                }
 

Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog 
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.Remoting.Activation/ChangeLog 
2006-07-15 13:13:55 UTC (rev 62639)
@@ -1,3 +1,7 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * ActivationServices.cs: Begin implementing COM Interop.
+       
 2004-09-22  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
 
        * ActivationServices.cs: In Activate, assign the proxy to the ctor

Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog    
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/ChangeLog    
2006-07-15 13:13:55 UTC (rev 62639)
@@ -1,3 +1,8 @@
+2006-07-15  Jonathan Chambers  <[EMAIL PROTECTED]>
+
+       * RealProxy.cs: Indicate that all fields need keep in sync
+       with definition in object-internals.h for COM Interop.
+       
 2006-06-18  Zoltan Varga  <[EMAIL PROTECTED]>
 
        * RealProxy.cs (ProcessResponse): Use t.GetElementType 
().IsInstanceOfType () when the type is a byref.

Modified: trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs
===================================================================
--- trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs 
2006-07-15 11:21:55 UTC (rev 62638)
+++ trunk/mcs/class/corlib/System.Runtime.Remoting.Proxies/RealProxy.cs 
2006-07-15 13:13:55 UTC (rev 62639)
@@ -51,18 +51,20 @@
        }
        
        public abstract class RealProxy {
-
+               // other classes visible to the runtime 
+               // derive from this class so keep these locals
+               // in sync with the definition RealProxy 
+               // in object-internals.h
                #region Sync with object-internals.h
                Type class_to_proxy;
                internal Context _targetContext;
                MarshalByRefObject _server;
                int _targetDomainId = -1;
                internal string _targetUri;
-               #endregion
-               
                internal Identity _objectIdentity;
-               Object _objTP;
-               object _stubData;
+               Object _objTP;
+               object _stubData;
+        #endregion
 
                protected RealProxy ()
                {

Modified: trunk/mcs/class/corlib/corlib.dll.sources
===================================================================
--- trunk/mcs/class/corlib/corlib.dll.sources   2006-07-15 11:21:55 UTC (rev 
62638)
+++ trunk/mcs/class/corlib/corlib.dll.sources   2006-07-15 13:13:55 UTC (rev 
62639)
@@ -17,6 +17,7 @@
 Mono.Globalization.Unicode/SortKey.cs
 Mono.Globalization.Unicode/SortKeyBuffer.cs
 Mono/Runtime.cs
+Mono.Interop/ComInteropProxy.cs
 Mono.Math/BigInteger.cs
 Mono.Math.Prime/ConfidenceFactor.cs
 Mono.Math.Prime/PrimalityTests.cs

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to