https://bugzilla.novell.com/show_bug.cgi?id=431304
Summary: reverse invoke via COM when marshaling a BSTR by ref
[retval] fails to convert MonoString to native string.
Product: Mono: Runtime
Version: SVN
Platform: x86
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: interop
AssignedTo: [email protected]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
reverse invoke via COM when marshaling a BSTR by ref [retval] fails to convert
MonoString to native string.
Example of the IDL.
HRESULT GetNextStyle(
[in] BSTR bstrName,
[out, retval] BSTR * pbstrNext);
C# implementation of GetNextStyle
public string GetNextStyle(string sName)
{
....
return someString;
}
Interop defined like:
[return: MarshalAs(UnmanagedType.BStr)]
[MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType=MethodCodeType.Runtime)]
string GetNextStyle([MarshalAs(UnmanagedType.BStr)] string bstrName);
When GetNextStyle is called from C++
..->GetNextStyle(bstr1, &bstr2)
bstr2 contains an invalid BSTR. (a MonoString*)
A patch with a suggested fix to follow.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs