From c94c6a1a1604f24f8388463849094676dac49568 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 13 Oct 2010 03:10:49 +0000 Subject: * 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 --- ChangeLog | 6 ++++++ thread_win32.c | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94084e1233..09bfdb9a8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 13 12:10:02 2010 NAKAMURA Usaku + + * 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 * 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); } -- cgit v1.2.3