dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/InteropService


From: Gopal.V <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnetlib/runtime/System/Runtime/InteropServices Marshal.cs,1.2,1.3
Date: Thu, 05 Dec 2002 13:49:49 -0500

Update of /cvsroot/dotgnu-pnet/pnetlib/runtime/System/Runtime/InteropServices
In directory 
subversions:/tmp/cvs-serv6995/runtime/System/Runtime/InteropServices

Modified Files:
        Marshal.cs 
Log Message:
PtrToStructure() patches


Index: Marshal.cs
===================================================================
RCS file: 
/cvsroot/dotgnu-pnet/pnetlib/runtime/System/Runtime/InteropServices/Marshal.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** Marshal.cs  28 Jun 2002 04:45:37 -0000      1.2
--- Marshal.cs  5 Dec 2002 18:49:46 -0000       1.3
***************
*** 549,560 ****
                                throw new NotImplementedException();
                        }
        public static void PtrToStructure(IntPtr ptr, Object structure)
!                       {
!                               throw new NotImplementedException();
!                       }
        public static Object PtrToStructure(IntPtr ptr, Type structureType)
!                       {
!                               throw new NotImplementedException();
!                       }
        public static IntPtr StringToBSTR(String s)
                        {
--- 549,572 ----
                                throw new NotImplementedException();
                        }
+ 
+       [MethodImpl(MethodImplOptions.InternalCall)]
+       extern public static void PtrToStructureInternal(IntPtr ptr, 
+                                       Object structure);
        public static void PtrToStructure(IntPtr ptr, Object structure)
!       {
!               if(structure.GetType().IsValueType)
!               {
!                       throw new ArgumentException("Object must be of type 
class.");
!               }
!               PtrToStructureInternal(ptr,structure);
!       }
! 
        public static Object PtrToStructure(IntPtr ptr, Type structureType)
!       {
!               Object obj=Activator.CreateInstance(structureType);
!               PtrToStructureInternal(ptr,obj);
!               return obj;
!       }
! 
        public static IntPtr StringToBSTR(String s)
                        {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]