com port name trasnlation for the special windows feature
diff --git a/pyserial/CHANGES.txt b/pyserial/CHANGES.txt
index 0d2eeb9..7daa819 100644
--- a/pyserial/CHANGES.txt
+++ b/pyserial/CHANGES.txt
@@ -244,6 +244,9 @@
 
 - ``sendBreak()`` accepts a ``duration`` argument. Default duration increased.
 
+- win32 handles \\.\COMx format automatically for com ports of higher number
+  (COM10 is internally translated to \\.\COM10 etc.)
+
 - update wxSerialConfigDialog.py and wxTerminal.py compatibility with
   wxPythoon 2.8 (Peleg)
 
diff --git a/pyserial/serial/serialwin32.py b/pyserial/serial/serialwin32.py
index 004c3d1..b44331c 100644
--- a/pyserial/serial/serialwin32.py
+++ b/pyserial/serial/serialwin32.py
@@ -11,7 +11,7 @@
 import win32con   # constants.
 from serialutil import *
 
-VERSION = "$Revision: 1.36 $".split()[1]     #extract CVS version
+VERSION = "$Revision: 1.37 $".split()[1]     #extract CVS version
 
 #from winbase.h. these should realy be in win32con
 MS_CTS_ON  = 16
@@ -21,13 +21,7 @@
 
 def device(portnum):
     """Turn a port number into a device name"""
-    #the "//./COMx" format is required for devices >= 9
-    #not all versions of windows seem to support this propperly
-    #so that the first few ports are used with the DOS device name
-    if portnum < 9:
-        return 'COM%d' % (portnum+1) #numbers are transformed to a string
-    else:
-        return r'\\.\COM%d' % (portnum+1)
+    return 'COM%d' % (portnum+1) #numbers are transformed to a string
 
 class Serial(SerialBase):
     """Serial port implemenation for Win32. This implemenatation requires a 
@@ -43,7 +37,7 @@
             raise SerialException("Port must be configured before it can be used.")
         self.hComPort = None
         try:
-            self.hComPort = win32file.CreateFile(self.portstr,
+            self.hComPort = win32file.CreateFile(self.makeDeviceName(self.portstr),
                    win32con.GENERIC_READ | win32con.GENERIC_WRITE,
                    0, # exclusive access
                    None, # no security
@@ -52,7 +46,7 @@
                    None)
         except Exception, msg:
             self.hComPort = None    #'cause __del__ is called anyway
-            raise SerialException("could not open port %s: %s" % (self._port, msg))
+            raise SerialException("could not open port %s: %s" % (self._portstr, msg))
         # Setup a 4k buffer
         win32file.SetupComm(self.hComPort, 4096, 4096)
 
@@ -180,7 +174,12 @@
             self._isOpen = False
 
     def makeDeviceName(self, port):
-        return device(port)
+        # the "\\.\COMx" format is required for devices other than COM1-COM8
+        # not all versions of windows seem to support this properly
+        # so that the first few ports are used with the DOS device name
+        if port.upper().startswith('COM') and int(port[3:]) <= 8:
+            return port
+        return '\\\\.\\' + port
 
     #  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -