diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | thread_win32.c | 21 |
2 files changed, 20 insertions, 7 deletions
@@ -1,3 +1,9 @@ +Wed Oct 13 12:10:02 2010 NAKAMURA Usaku <[email protected]> + + * thread_win32.c (w32_error): get English message first, instead + of system default. see [ruby-core:32765]. + [experimental] + Wed Oct 13 11:04:03 2010 Nobuyoshi Nakada <[email protected]> * debug.c (ruby_set_debug_option): define always for binary diff --git a/thread_win32.c b/thread_win32.c index 1b15baed81..46764f0988 100644 --- a/thread_win32.c +++ b/thread_win32.c @@ -67,13 +67,20 @@ static void w32_error(const char *func) { LPVOID lpMsgBuf; - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + (LPTSTR) & lpMsgBuf, 0, NULL) == 0) + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) & lpMsgBuf, 0, NULL); rb_bug("%s: %s", func, (char*)lpMsgBuf); } |