From 0d30a07f5b3e81152e5f229d05a1ba671de6a454 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 4 Dec 2008 15:10:25 +0000 Subject: [PATCH] Always use the ANSI variant of the Windows functions. The current api is not compatible with the wide character data type that is required for the unicode variant. --- src/irda.c | 2 +- src/serial_win32.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/irda.c b/src/irda.c index 1ade311..833aaed 100644 --- a/src/irda.c +++ b/src/irda.c @@ -89,7 +89,7 @@ const char* irda_errmsg () unsigned int size = sizeof (buffer) / sizeof (char); DWORD errcode = WSAGetLastError (); - DWORD rc = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + DWORD rc = FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, 0, buffer, size, NULL); // Remove certain characters ('\r', '\n' and '.') // at the end of the error message. diff --git a/src/serial_win32.c b/src/serial_win32.c index b46898f..89e9819 100644 --- a/src/serial_win32.c +++ b/src/serial_win32.c @@ -63,7 +63,7 @@ const char* serial_errmsg () unsigned int size = sizeof (buffer) / sizeof (char); DWORD errcode = GetLastError (); - DWORD rc = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + DWORD rc = FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errcode, 0, buffer, size, NULL); // Remove certain characters ('\r', '\n' and '.') // at the end of the error message. @@ -99,7 +99,7 @@ serial_open (serial** out, const char* name) } // Open the device. - device->hFile = CreateFile (name, + device->hFile = CreateFileA (name, GENERIC_READ | GENERIC_WRITE, 0, NULL, // No security attributes. OPEN_EXISTING,