[Mono-bugs] [Bug 21042] New - Missing parameter names in PInvoke methods.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
26 Feb 2002 00:56:42 -0000

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by miguel@ximian.com.


--- shadow/21042	Mon Feb 25 19:56:42 2002
+++ shadow/21042.tmp.16301	Mon Feb 25 19:56:42 2002
@@ -0,0 +1,37 @@
+Bug#: 21042
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Severity: 002 Two hours
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: Missing parameter names in PInvoke methods.
+This is from Paolo:
+Compile any test with a p/invoke method and disassemble the output:
+you'll note that, the parameter info table is not filled, so you don't
+get the name of the arguments, for example. The problem with marshaling
+is that the param attributes may have set the PARAM_ATTRIBUTE_HAS_FIELD_MARSHAL
+bit to signal that there is marshaling info in the FieldMarshal table
+for the argument, but since mcs doesn't output the info in the Param
+table (where the param attributes are stored) we lost the info and we
+won't be able to marshal the argument correctly.
+There isin't support yet in mcs for the MarshalAs attribute, so that
+needs to be done, too.
+I tracked down the bug to the Emit() method in class.cs:2345: you'll
+note that if the method is a P/Invoke one the LabelParameters() method
+is not called, hence no output to the Param table. I guess it's not done
+because LabelParameters requires an EmitContext and the EmitContext
+requires an ILGenerator and that doesn't make sense for a P/Invoke
+method. But I don't know the reason for that requirement, so I didn't
+try to get rid of it and fix the bug myself.