Index: exceptions.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/src/exceptions.cpp,v
retrieving revision 1.10.10.2
diff -u -r1.10.10.2 exceptions.cpp
--- exceptions.cpp	14 Sep 2006 21:51:00 -0000	1.10.10.2
+++ exceptions.cpp	27 Sep 2006 21:34:40 -0000
@@ -37,16 +37,23 @@
     std::string str;
 # ifdef BOOST_WINDOWS
     LPVOID lpMsgBuf;
-    ::FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+    ::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
         FORMAT_MESSAGE_FROM_SYSTEM |
         FORMAT_MESSAGE_IGNORE_INSERTS,
         NULL,
         sys_err_code,
         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
-        (LPSTR)&lpMsgBuf,
+        (LPTSTR)&lpMsgBuf,
         0,
         NULL);
+#ifdef BOOST_NO_ANSI_APIS
+    int numChars = (_tcslen((LPTSTR)lpMsgBuf) + 1) * 2;
+    LPSTR narrowMsg = (LPSTR)_alloca( numChars );
+    ::WideCharToMultiByte(CP_ACP, 0, (LPTSTR)lpMsgBuf, -1, narrowMsg, numChars, NULL, NULL);
+    str += narrowMsg;
+#else
     str += static_cast<LPCSTR>(lpMsgBuf);
+#endif
     ::LocalFree(lpMsgBuf); // free the buffer
     while (str.size() && (str[str.size()-1] == '\n' ||
                str[str.size()-1] == '\r'))
