summaryrefslogtreecommitdiff
path: root/src/threadengines
diff options
context:
space:
mode:
authorAdam <adam@sigterm.info>2012-10-12 14:50:05 -0700
committerAdam <adam@sigterm.info>2012-10-12 14:50:05 -0700
commitc05ad37bfd03486475889485606ed5cffc7bf5a2 (patch)
treefe01825889769500a0f080371a0714aa15505b9a /src/threadengines
parente496d321efe3e9b27f2f116bd22a05ec44aec564 (diff)
parent5b9682275e384635a1fd9f7320cf4d9a604a43b4 (diff)
Merge pull request #320 from ChrisTX/insp20+cleanupwin
Windows: In-depth cleanup (see details)
Diffstat (limited to 'src/threadengines')
-rw-r--r--src/threadengines/threadengine_win32.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/threadengines/threadengine_win32.cpp b/src/threadengines/threadengine_win32.cpp
index 3e643c6f5..637a3e010 100644
--- a/src/threadengines/threadengine_win32.cpp
+++ b/src/threadengines/threadengine_win32.cpp
@@ -37,7 +37,16 @@ void ThreadEngine::Start(Thread* thread)
{
thread->state = NULL;
delete data;
- throw CoreException(std::string("Unable to create new thread: ") + dlerror());
+ std::string err = "Unable to create new thread: ";
+#ifdef _WIN32
+ CHAR errdetail[100];
+ FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errdetail, 100, 0);
+ SetLastError(ERROR_SUCCESS);
+ err += errdetail;
+#else
+ err += dlerror();
+#endif
+ throw CoreException(err);
}
}