mirror of
https://github.com/JochenKalmbach/StackWalker
synced 2026-06-08 11:24:59 +00:00
Fixed Bug of not working on XP anymore... now only uses GetThreadId, if SDK supports it
This commit is contained in:
@@ -1032,9 +1032,13 @@ BOOL StackWalker::ShowCallstack(HANDLE hThread, const CONTEXT *context, PReadPro
|
||||
if (context == NULL)
|
||||
{
|
||||
// If no context is provided, capture the context
|
||||
// if (hThread == GetCurrentThread())
|
||||
// See: https://stackwalker.codeplex.com/discussions/446958
|
||||
#if _WIN32_WINNT <= 0x0501
|
||||
// If we need to support XP, we need to use the "old way", because "GetThreadId" is not available!
|
||||
if (hThread == GetCurrentThread())
|
||||
#else
|
||||
if (GetThreadId(hThread) == GetCurrentThreadId())
|
||||
#endif
|
||||
{
|
||||
GET_CURRENT_CONTEXT_STACKWALKER_CODEPLEX(c, USED_CONTEXT_FLAGS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user