diff options
author | Craig Tiller <craig.tiller@gmail.com> | 2016-03-16 14:57:29 -0700 |
---|---|---|
committer | Craig Tiller <craig.tiller@gmail.com> | 2016-03-16 14:57:29 -0700 |
commit | c9c0b8bf42e2fe41ff55318eb45d2716bcf0fc68 (patch) | |
tree | 17338d57b7a5b573391cf5138858df4838eba867 /test | |
parent | ae2283d3dd504d796b8f846da077dc22b097ef4e (diff) |
Review feedback
Diffstat (limited to 'test')
-rw-r--r-- | test/core/util/test_config.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/core/util/test_config.c b/test/core/util/test_config.c index 94ef1be6ce..ede9118ac5 100644 --- a/test/core/util/test_config.c +++ b/test/core/util/test_config.c @@ -54,15 +54,20 @@ static unsigned seed(void) { return _getpid(); } #endif #if GPR_WINDOWS_CRASH_HANDLER -#include "DbgHelp.h" +#include <windows.h> +#include <tchar.h> +#define DBGHELP_TRANSLATE_TCHAR +#include <dbghelp.h> +#ifdef _MSC_VER #pragma comment(lib, "dbghelp.lib") +#endif static void print_current_stack() { typedef USHORT(WINAPI * CaptureStackBackTraceType)( __in ULONG, __in ULONG, __out PVOID *, __out_opt PULONG); CaptureStackBackTraceType func = (CaptureStackBackTraceType)( - GetProcAddress(LoadLibrary(L"kernel32.dll"), "RtlCaptureStackBackTrace")); + GetProcAddress(LoadLibrary(_T("kernel32.dll")), "RtlCaptureStackBackTrace")); if (func == NULL) return; // WOE 29.SEP.2010 @@ -79,7 +84,7 @@ static void print_current_stack() { process = GetCurrentProcess(); SymInitialize(process, NULL, TRUE); frames = (func)(0, MAX_CALLERS, callers_stack, NULL); - symbol = (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(char), 1); + symbol = (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1); symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof(SYMBOL_INFOW); @@ -133,7 +138,7 @@ static void print_stack_from_context(CONTEXT c) { HANDLE thread = GetCurrentThread(); SYMBOL_INFOW *symbol = - (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(char), 1); + (SYMBOL_INFOW *)calloc(sizeof(SYMBOL_INFOW) + 256 * sizeof(wchar_t), 1); symbol->MaxNameLen = 255; symbol->SizeOfStruct = sizeof(SYMBOL_INFOW); |