diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-13 03:10:49 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-10-13 03:10:49 +0000 |
commit | c94c6a1a1604f24f8388463849094676dac49568 (patch) | |
tree | 31843f9f334af69f1f19ea6e9e39b06e4212cdb6 | |
parent | 8022385ba4d7031031372846d62d686422c108ed (diff) |
* thread_win32.c (w32_error): get English message first, instead
of system default. see [ruby-core:32765].
[experimental]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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); } |