Hi,

Windows wants large COM ports (COM10 and higher) to be given in UPC
notation, ie. \\.\COM10

To aid the user, the Win32 code now rewrites all devices with COM prefix
(case insensitive) to UPC. Tested with both high and low COM port.

Signed-off-by: Patrick Georgi <[email protected]>
Index: serial.c
===================================================================
--- serial.c    (Revision 882)
+++ serial.c    (Arbeitskopie)
@@ -105,7 +105,15 @@
 {
 #ifdef _WIN32
        HANDLE fd;
-       fd = CreateFile(dev, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
OPEN_EXISTING, 0, NULL);
+       char* dev2 = dev;
+       if ((strlen(dev) > 3) && (tolower(dev[0])=='c') && 
(tolower(dev[1])=='o') && (tolower(dev[2])=='m')) {
+               dev2 = malloc(strlen(dev)+5);
+               strcpy(dev2, "\\\\.\\");
+               strcpy(dev2+4, dev);
+       }
+       fd = CreateFile(dev2, GENERIC_READ | GENERIC_WRITE, 0, NULL, 
OPEN_EXISTING, 0, NULL);
+       if (dev2 != dev)
+               free(dev2);
        if (fd == INVALID_HANDLE_VALUE) {
                sp_die("Error: cannot open serial port");
        }
_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to