]> sigrok.org Git - libserialport.git/blobdiff - windows.c
windows: Use correct variant of CreateFile.
[libserialport.git] / windows.c
index 0521716549272d558418e3f826cf10870c271672..bc07e234c341ebf8cdec4d34aa1344ae2fe4429a 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -467,9 +467,9 @@ SP_PRIV enum sp_return get_port_details(struct sp_port *port)
                        if (!(escaped_port_name = malloc(strlen(port->name) + 5)))
                                RETURN_ERROR(SP_ERR_MEM, "Escaped port name malloc failed");
                        sprintf(escaped_port_name, "\\\\.\\%s", port->name);
-                       handle = CreateFile(escaped_port_name, GENERIC_READ, 0, 0,
-                                           OPEN_EXISTING,
-                                           FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
+                       handle = CreateFileA(escaped_port_name, GENERIC_READ, 0, 0,
+                                            OPEN_EXISTING,
+                                            FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0);
                        free(escaped_port_name);
                        CloseHandle(handle);