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

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

[Dotgnu-pnet-commits] CVS: pnet/image marshal.c,1.8,1.9


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/image marshal.c,1.8,1.9
Date: Thu, 30 Jan 2003 22:03:49 -0500

Update of /cvsroot/dotgnu-pnet/pnet/image
In directory subversions:/tmp/cvs-serv22187/image

Modified Files:
        marshal.c 
Log Message:


Parse custom marshaling cookies.


Index: marshal.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/image/marshal.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** marshal.c   31 Jan 2003 02:00:29 -0000      1.8
--- marshal.c   31 Jan 2003 03:03:46 -0000      1.9
***************
*** 65,71 ****
  }
  
  ILUInt32 ILPInvokeGetMarshalType(ILPInvoke *pinvoke, ILMethod *method,
                                                                 unsigned long 
param, char **customName,
!                                                                int 
*customNameLen)
  {
        ILType *type = ILTypeGetParam(method->member.signature, param);
--- 65,84 ----
  }
  
+ /*
+  * Extract a string from a custom marshaling declaration.
+  */
+ #define       ExtractCustomString(name,namelen)       \
+                       do { \
+                               unsigned long size = 
ILMetaUncompressData(&reader); \
+                               *(name) = (char *)(reader.data); \
+                               *(namelen) = (int)size; \
+                               reader.data += size; \
+                               reader.len -= size; \
+                       } while (0)
+ 
  ILUInt32 ILPInvokeGetMarshalType(ILPInvoke *pinvoke, ILMethod *method,
                                                                 unsigned long 
param, char **customName,
!                                                                int 
*customNameLen, char **customCookie,
!                                                                int 
*customCookieLen)
  {
        ILType *type = ILTypeGetParam(method->member.signature, param);
***************
*** 104,107 ****
--- 117,122 ----
        *customName = 0;
        *customNameLen = 0;
+       *customCookie = 0;
+       *customCookieLen = 0;
  
        /* If the native type is "interface", then always marshal directly.
***************
*** 117,121 ****
           ILTypeIsReference(type))
        {
!               return IL_META_MARSHAL_CUSTOM;
        }
  
--- 132,151 ----
           ILTypeIsReference(type))
        {
!               ILMetaDataRead reader;
!               reader.data = nativeType + 1;
!               reader.len = nativeTypeLen - 1;
!               reader.error = 0;
!               ExtractCustomString(customName, customNameLen); /* Unused GUID 
*/
!               ExtractCustomString(customName, customNameLen); /* Unused 
native name */
!               ExtractCustomString(customName, customNameLen);
!               ExtractCustomString(customCookie, customCookieLen);
!               if(customNameLen > 0)
!               {
!                       return IL_META_MARSHAL_CUSTOM;
!               }
!               else
!               {
!                       return IL_META_MARSHAL_DIRECT;
!               }
        }
  





reply via email to

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