[Mono-dev] FileStream Exception
Hi, i was trying implement something for System.IO.Ports on windows, but i have found a issue. The following code compiles on mcs and works fine in ms.net runtime: StreamReader sr; StreamWriter sw; Console.WriteLine("1"); MSystem.IO.Ports.SerialPort.WindowsPortManager.Open("COM1", 9600, 8, 0, 1, out sr, out sw); Console.WriteLine("2"); sw.WriteLine("hi"); Console.WriteLine("3"); sw.Flush(); Console.WriteLine("4"); Console.WriteLine(sr.ReadLine()); Console.WriteLine("5"); Console.ReadLine(); Compiled by MCS: ms.net runtime: 1 2 3 4 hi 5 but using mono runtime... 1 2 3 Invalid parameter in <0x0009d> System.IO.FileStream:WriteInternal (System.Byte[] src, Int32 src_offset, Int32 count) in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_byte[]_int_int (byte[],int,int) Extra information: both streamreader and streamwriter has been created with a filestream whose handle has been got using the system call CreateFile in kernel32.dll -- No hay viento favorable para el que no sabe donde va.Pablo Iñigo Blasco - GeuS- www.geus.es.vg ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] FileStream Exception
Hi, i was trying implement something for System.IO.Ports on windows, but i have found a issue. The following code compiles on mcs and works fine in ms.net runtime: StreamReader sr; StreamWriter sw; Console.WriteLine("1"); MSystem.IO.Ports.SerialPort.WindowsPortManager.Open("COM1", 9600, 8, 0, 1, out sr, out sw); Console.WriteLine("2"); sw.WriteLine("hi"); Console.WriteLine("3"); sw.Flush(); Console.WriteLine("4"); Console.WriteLine(sr.ReadLine()); Console.WriteLine("5"); Console.ReadLine(); Compiled by MCS: ms.net runtime: 1 2 3 4 hi 5 but using mono runtime... 1 2 3 Invalid parameter in <0x0009d> System.IO.FileStream:WriteInternal (System.Byte[] src, Int32 src_offset, Int32 count) in (wrapper delegate-invoke) System.MulticastDelegate:invoke_void_byte[]_int_int (byte[],int,int) Extra information: both streamreader and streamwriter has been created with a filestream whose handle has been got using the system call CreateFile in kernel32.dll -- No hay viento favorable para el que no sabe donde va. Pablo Iñigo Blasco - GeuS- www.geus.es.vg ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list