Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamesB7 <jfb@zer7.com>2012-04-24 20:33:16 +0400
committerJamesB7 <jfb@zer7.com>2012-04-24 20:33:16 +0400
commitcaadb775079bda48e9ada535c64662a26366f6b6 (patch)
tree850997eea925759bda276d39c042b76743f42584 /mcs/class/System/System.IO.Ports
parentd8cc1eabbd7da13c41edd1bc11f677917fcac235 (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/class/System/System.IO.Ports')
-rw-r--r--mcs/class/System/System.IO.Ports/WinSerialStream.cs4
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)