comments written to minidump file as ANSI string
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 30 Oct 2017 13:07:01 +0000 (15:07 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 30 Oct 2017 14:35:40 +0000 (16:35 +0200)
src/libnetxms/seh.cpp
src/server/netxmsd/netxmsd.cpp

index d37709e..d9d81fa 100644 (file)
@@ -344,11 +344,11 @@ BOOL LIBNETXMS_EXPORTABLE SEHServiceExceptionHandler(EXCEPTION_POINTERS *pInfo)
                mei.ExceptionPointers = pInfo;
                mei.ClientPointers = FALSE;
 
-      static const TCHAR *comments = _T("Version: ") NETXMS_VERSION_STRING _T("\nBuild tag: ") NETXMS_BUILD_TAG;
+      static const char *comments = "Version=" NETXMS_VERSION_STRING_A "; BuildTag=" NETXMS_BUILD_TAG_A;
       MINIDUMP_USER_STREAM us;
-      us.Type = CommentStreamW;
+      us.Type = CommentStreamA;
       us.Buffer = (void*)comments;
-      us.BufferSize = static_cast<ULONG>(_tcslen(comments) * sizeof(TCHAR));
+      us.BufferSize = static_cast<ULONG>(strlen(comments) + 1);
 
       MINIDUMP_USER_STREAM_INFORMATION usi;
       usi.UserStreamCount = 1;
index 8992b54..93053dc 100644 (file)
@@ -133,11 +133,11 @@ static void CreateMiniDump(DWORD pid)
                                                                 CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
                if (hFile != INVALID_HANDLE_VALUE)
                {
-         static const TCHAR *comments = _T("Version: ") NETXMS_VERSION_STRING _T("\nBuild tag: ") NETXMS_BUILD_TAG;
+         static const char *comments = "Version=" NETXMS_VERSION_STRING_A "; BuildTag=" NETXMS_BUILD_TAG_A;
          MINIDUMP_USER_STREAM us;
-         us.Type = CommentStreamW;
+         us.Type = CommentStreamA;
          us.Buffer = (void*)comments;
-         us.BufferSize = static_cast<ULONG>(_tcslen(comments) * sizeof(TCHAR));
+         us.BufferSize = static_cast<ULONG>(strlen(comments) + 1);
 
          MINIDUMP_USER_STREAM_INFORMATION usi;
          usi.UserStreamCount = 1;