summaryrefslogtreecommitdiff
path: root/src/threadengines/threadengine_win32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/threadengines/threadengine_win32.cpp')
-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);
}
}