diff options
author | JamesB7 <jfb@zer7.com> | 2012-04-24 20:33:16 +0400 |
---|---|---|
committer | JamesB7 <jfb@zer7.com> | 2012-04-24 20:33:16 +0400 |
commit | caadb775079bda48e9ada535c64662a26366f6b6 (patch) | |
tree | 850997eea925759bda276d39c042b76743f42584 /mcs | |
parent | d8cc1eabbd7da13c41edd1bc11f677917fcac235 (diff) |
This fixes Mono's Windows serial support for COM10+, while also not breaking compatibility with Mono for Windows programs that rely on the earlier incorrect behavior.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System/System.IO.Ports/WinSerialStream.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mcs/class/System/System.IO.Ports/WinSerialStream.cs b/mcs/class/System/System.IO.Ports/WinSerialStream.cs index e29aca4722f..280082a706a 100644 --- a/mcs/class/System/System.IO.Ports/WinSerialStream.cs +++ b/mcs/class/System/System.IO.Ports/WinSerialStream.cs @@ -78,7 +78,9 @@ namespace System.IO.Ports bool dtr_enable, bool rts_enable, Handshake hs, int read_timeout, int write_timeout, int read_buffer_size, int write_buffer_size) { - handle = CreateFile (port_name, GenericRead | GenericWrite, 0, 0, OpenExisting, + handle = CreateFile (port_name != null && !port_name.StartsWith(@"\\.\") + ? @"\\.\" + port_name : port_name, + GenericRead | GenericWrite, 0, 0, OpenExisting, FileFlagOverlapped, 0); if (handle == -1) |