2003-01-28 Patrik Torstensson
authorPatrik Torstensson <totte@mono-cvs.ximian.com>
Tue, 28 Jan 2003 12:10:08 +0000 (12:10 -0000)
committerPatrik Torstensson <totte@mono-cvs.ximian.com>
Tue, 28 Jan 2003 12:10:08 +0000 (12:10 -0000)
* ObjRef.cs: Fixed Objref marshalling flags

svn path=/trunk/mcs/; revision=10973

mcs/class/corlib/System.Runtime.Remoting/ObjRef.cs

index 8bd577f3c9d6e12f2c6a673a40d5bb1f6b212d67..c37466467d2ed0eed79415723649e325542982db 100644 (file)
@@ -5,6 +5,7 @@
 //   Miguel de Icaza (miguel@ximian.com)
 //   Dietmar Maurer (dietmar@ximian.com)
 //   Lluis Sanchez Gual (lluis@ideary.com)
+//   Patrik Torstensson
 //
 // (C) Ximian, Inc.  http://www.ximian.com
 //
@@ -24,7 +25,7 @@ namespace System.Runtime.Remoting {
                string uri;
                IRemotingTypeInfo typeInfo;
                IEnvoyInfo envoyInfo;
-               [NonSerialized] bool marshalledValue = false;
+               [NonSerialized] bool marshalledValue = true;
                
                public ObjRef ()
                {
@@ -56,7 +57,7 @@ namespace System.Runtime.Remoting {
                        SerializationInfoEnumerator en = si.GetEnumerator();
                        // Info to serialize: uri, objrefFlags, typeInfo, envoyInfo, channelInfo
 
-                       marshalledValue = false;
+                       marshalledValue = true;
 
                        while (en.MoveNext ()) {
                                switch (en.Name) {
@@ -73,7 +74,15 @@ namespace System.Runtime.Remoting {
                                        envoyInfo = (IEnvoyInfo)en.Value;
                                        break;
                                case "fIsMarshalled":
-                                       marshalledValue = true;
+                                       int status;
+                                       Object o = en.Value;
+                                       if (o.GetType().Equals(typeof(String)))\r
+                                               status = ((IConvertible) o).ToInt32(null);\r
+                                       else\r
+                                               status = (int) o;\r
+
+                                       if (status == 0)
+                                               marshalledValue = false;
                                        break;
                                case "objrefFlags":             // FIXME: do something with this
                                        break;