From 555cf97cbe3d94332e3d28a765c49539b8e4a41c Mon Sep 17 00:00:00 2001 From: wsoltys Date: Fri, 26 Apr 2013 19:45:31 +0200 Subject: [WIN32] fixed: use wide string methods to create the dump file and the stacktrace. --- xbmc/threads/platform/win/Win32Exception.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xbmc/threads/platform/win/Win32Exception.cpp b/xbmc/threads/platform/win/Win32Exception.cpp index a709244c9f..756b42eb3a 100644 --- a/xbmc/threads/platform/win/Win32Exception.cpp +++ b/xbmc/threads/platform/win/Win32Exception.cpp @@ -24,6 +24,7 @@ #include "Util.h" #include "WIN32Util.h" #include "utils/StringUtils.h" +#include "utils/CharsetConverter.h" #define LOG if(logger) logger->Log @@ -115,6 +116,7 @@ bool win32_exception::write_minidump(EXCEPTION_POINTERS* pEp) // Create the dump file where the xbmc.exe resides bool returncode = false; CStdString dumpFileName; + CStdStringW dumpFileNameW; SYSTEMTIME stLocalTime; GetLocalTime(&stLocalTime); @@ -125,7 +127,8 @@ bool win32_exception::write_minidump(EXCEPTION_POINTERS* pEp) dumpFileName.Format("%s\\%s", CWIN32Util::GetProfilePath().c_str(), CUtil::MakeLegalFileName(dumpFileName)); - HANDLE hDumpFile = CreateFile(dumpFileName.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); + g_charsetConverter.utf8ToW(dumpFileName, dumpFileNameW, false); + HANDLE hDumpFile = CreateFileW(dumpFileNameW.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); if (hDumpFile == INVALID_HANDLE_VALUE) { @@ -186,6 +189,7 @@ bool win32_exception::write_stacktrace(EXCEPTION_POINTERS* pEp) #define STACKWALK_MAX_NAMELEN 1024 std::string dumpFileName, strOutput; + CStdStringW dumpFileNameW; CHAR cTemp[STACKWALK_MAX_NAMELEN]; DWORD dwBytes; SYSTEMTIME stLocalTime; @@ -223,7 +227,8 @@ bool win32_exception::write_stacktrace(EXCEPTION_POINTERS* pEp) dumpFileName = StringUtils::Format("%s\\%s", CWIN32Util::GetProfilePath().c_str(), CUtil::MakeLegalFileName(dumpFileName)); - HANDLE hDumpFile = CreateFile(dumpFileName.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); + g_charsetConverter.utf8ToW(dumpFileName, dumpFileNameW, false); + HANDLE hDumpFile = CreateFileW(dumpFileNameW.c_str(), GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0); if (hDumpFile == INVALID_HANDLE_VALUE) { -- cgit v1.2.3