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.
This commit is contained in:
Jef Driesen 2008-12-04 15:10:25 +00:00
parent 6129164629
commit 0d30a07f5b
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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,