[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mono-bugs
Subject:    [Mono-bugs] [Bug 661917] New: UnmanagedType.VBByRefStr marshalling
From:       bugzilla_noreply () novell ! com
Date:       2010-12-30 21:44:00
Message-ID: bug-661917-28286 () http ! bugzilla ! novell ! com/
[Download RAW message or body]


https://bugzilla.novell.com/show_bug.cgi?id=661917

https://bugzilla.novell.com/show_bug.cgi?id=661917#c0


           Summary: UnmanagedType.VBByRefStr marshalling is unimplemented
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.6.x
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: interop
        AssignedTo: mono-bugs@lists.ximian.com
        ReportedBy: madewokherd@gmail.com
         QAContact: mono-bugs@lists.ximian.com
          Found By: ---
           Blocker: ---


Created an attachment (id=406630)
 --> (http://bugzilla.novell.com/attachment.cgi?id=406630)
test case

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13)
Gecko/20101206 Ubuntu/10.10 (maverick) Firefox/3.6.13

Attempting to call a platform invoke with UnmanagedType.VBByRefStr raises a
NotImplementedExceptin: string marshalling conversion 34 not implemented

AFAICT, this should do the following when given a string reference:
* Create a buffer large enough to hold an ANSI string copy of the given string
(and probably a null terminator).
* Copy the string to that buffer.
* Call the function.
* Create a new string based on the contents of the buffer.
* Assign that new string to the given reference.

This is apparently intended to duplicate the behavior of VB6, which would do
roughly the same thing, except that it could modify strings in place. (Oddly
enough, VB6 Declare statements only natively supported functions expecting ANSI
strings, even though VB6 strings were wide strings internally.)

I'm attaching a test program.

Reproducible: Always

Steps to Reproduce:
Run the test program.
Actual Results:  
** (vbbyrefstr.exe:14277): WARNING **: string marshalling conversion 34 not
implemented

Unhandled Exception: System.NotImplementedException: string marshalling
conversion 34 not implemented

Expected Results:  
False

40
source str
40
False
True
System.AccessViolationException: Attempted to read or write protected memory.
Th
is is often an indication that other memory is corrupt.
   at VBByRefStrTest.CopyMemory(String& dest, String& src, Int32 length)
   at VBByRefStrTest.Main(String[] argv)
True

-- 
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  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic