summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-04 20:43:25 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-07 11:41:32 +0000
commit8ab4d2f29fdd2c058db23f6ee7b2200655d4c6f6 (patch)
tree27239b59958edbe97faa9d3d72bc172a0af32d36
parent0d44e98d6aa2c390fd9bcdd97290f463b136ddb6 (diff)
drop crashrep unused since start of LibreOffice
Change-Id: I3df1216054c133314b2317849744a0a37e9fbc8f Reviewed-on: https://gerrit.libreoffice.org/13733 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--Repository.mk7
-rw-r--r--RepositoryFixes.mk1
-rw-r--r--RepositoryModule_host.mk1
-rwxr-xr-xbin/find-german-comments1
-rw-r--r--config_host/config_features.h.in3
-rw-r--r--configure.ac16
-rw-r--r--cppuhelper/source/bootstrap.cxx1
-rw-r--r--crashrep/CustomTarget_crashrep_res.mk41
-rw-r--r--crashrep/Executable_crashrep.mk67
-rw-r--r--crashrep/Makefile14
-rw-r--r--crashrep/Module_crashrep.mk27
-rw-r--r--crashrep/README1
-rw-r--r--crashrep/WinResTarget_crashrep.mk25
-rw-r--r--crashrep/source/unx/main.cxx1068
-rw-r--r--crashrep/source/win32/base64.cxx75
-rw-r--r--crashrep/source/win32/base64.h38
-rw-r--r--crashrep/source/win32/crashrep.rc12
-rw-r--r--crashrep/source/win32/crashrep.ulf221
-rw-r--r--crashrep/source/win32/ctrylnglist.txt29
-rw-r--r--crashrep/source/win32/rcfooter.txt1
-rw-r--r--crashrep/source/win32/rcheader.txt75
-rw-r--r--crashrep/source/win32/rctemplate.txt209
-rw-r--r--crashrep/source/win32/resource.h115
-rw-r--r--crashrep/source/win32/soreport.cxx2875
-rw-r--r--desktop/Executable_crashrep_com.mk26
-rw-r--r--desktop/Module_desktop.mk6
-rw-r--r--desktop/win32/source/guistdio/guistdio.cxx23
-rw-r--r--distro-configs/OxygenOfficeLinux.conf1
-rw-r--r--framework/qa/complex/api_internal/CheckAPI.props2
-rw-r--r--framework/qa/complex/framework/recovery/RecoveryTools.java6
-rw-r--r--javaunohelper/com/sun/star/comp/helper/Bootstrap.java1
-rw-r--r--reportdesign/qa/complex/reportdesign/runner.props4
-rw-r--r--sal/osl/unx/signal.cxx515
-rw-r--r--sal/osl/w32/signal.cxx132
-rw-r--r--scp2/AutoInstall.mk1
-rw-r--r--scp2/InstallModule_crashrep.mk20
-rw-r--r--scp2/InstallScript_setup_osl.mk3
-rw-r--r--scp2/Module_scp2.mk3
-rw-r--r--scp2/source/crashrep/file_crashrep.scp32
-rw-r--r--scp2/source/ooo/common_brand.scp5
40 files changed, 9 insertions, 5694 deletions
diff --git a/Repository.mk b/Repository.mk
index 8b4e62e5ad17..aa9224fd4c32 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -159,13 +159,6 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,quickstart, \
))
endif
-ifneq ($(ENABLE_CRASHDUMP),)
-$(eval $(call gb_Helper_register_executables_for_install,OOO,crashrep, \
- crashrep \
- $(if $(filter WNT,$(OS)),crashrep_com) \
-))
-endif
-
$(eval $(call gb_Helper_register_executables_for_install,OOO,python, \
$(if $(filter WNT,$(OS)), \
python \
diff --git a/RepositoryFixes.mk b/RepositoryFixes.mk
index 6023b04c1ef0..bbffb96a153b 100644
--- a/RepositoryFixes.mk
+++ b/RepositoryFixes.mk
@@ -27,7 +27,6 @@ gb_Executable_FILENAMES := $(patsubst uno:uno,uno:uno.bin,$(gb_Executable_FILENA
endif
gb_Executable_FILENAMES := $(patsubst unopkg_bin:unopkg_bin%,unopkg_bin:unopkg.bin,$(gb_Executable_FILENAMES))
gb_Executable_FILENAMES := $(patsubst unopkg_com:unopkg_com%,unopkg_com:unopkg.com,$(gb_Executable_FILENAMES))
-gb_Executable_FILENAMES := $(patsubst crashrep_com:crashrep_com%,crashrep_com:crashrep.com,$(gb_Executable_FILENAMES))
gb_Executable_FILENAMES := $(patsubst gengal:gengal,gengal:gengal.bin,$(gb_Executable_FILENAMES))
ifeq ($(OS),MACOSX)
diff --git a/RepositoryModule_host.mk b/RepositoryModule_host.mk
index 0a9f428e171d..76bcea27151a 100644
--- a/RepositoryModule_host.mk
+++ b/RepositoryModule_host.mk
@@ -46,7 +46,6 @@ $(eval $(call gb_Module_add_moduledirs,libreoffice,\
cppu \
cppuhelper \
cpputools \
- $(call gb_Helper_optional,CRASHREP,crashrep) \
cui \
$(call gb_Helper_optional,DBCONNECTIVITY,dbaccess) \
desktop \
diff --git a/bin/find-german-comments b/bin/find-german-comments
index 3100f2d06995..27a7018d81a9 100755
--- a/bin/find-german-comments
+++ b/bin/find-german-comments
@@ -253,7 +253,6 @@ class Parser:
"cppu" : 1,
"cppuhelper" : 1,
"cpputools" : 1,
- "crashrep" : 1,
"cui" : 1,
"dbaccess" : 1,
"desktop" : 1,
diff --git a/config_host/config_features.h.in b/config_host/config_features.h.in
index 886542ec461d..74ce2347c6b1 100644
--- a/config_host/config_features.h.in
+++ b/config_host/config_features.h.in
@@ -146,7 +146,4 @@
*/
#define HAVE_FEATURE_COLLADA 0
-/* see --enable-crashdump: */
-#define HAVE_FEATURE_CRASHDUMP 0
-
#endif
diff --git a/configure.ac b/configure.ac
index df3b179fb3a9..9ab1ef383989 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4527,22 +4527,6 @@ dnl Check for syslog header
dnl ===================================================================
AC_CHECK_HEADER(syslog.h, AC_DEFINE(HAVE_SYSLOG_H))
-dnl ===================================================================
-dnl Set the ENABLE_CRASHDUMP variable.
-dnl ===================================================================
-AC_MSG_CHECKING([whether to enable crashdump feature])
-if test "$enable_crashdump" = "yes"; then
- ENABLE_CRASHDUMP="TRUE"
- BUILD_TYPE="$BUILD_TYPE CRASHREP"
- AC_MSG_RESULT([yes])
- AC_DEFINE(HAVE_FEATURE_CRASHDUMP)
-else
- ENABLE_CRASHDUMP=""
- AC_MSG_RESULT([no])
-fi
-AC_SUBST(ENABLE_CRASHDUMP)
-
-
dnl Set the ENABLE_WERROR variable. (Activate --enable-werror)
dnl ===================================================================
AC_MSG_CHECKING([whether to turn warnings to errors])
diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx
index e81f4147f346..d5130b9a2eaa 100644
--- a/cppuhelper/source/bootstrap.cxx
+++ b/cppuhelper/source/bootstrap.cxx
@@ -152,7 +152,6 @@ Reference< XComponentContext > SAL_CALL bootstrap()
OUString("--nologo"),
OUString("--nodefault"),
OUString("--norestore"),
- OUString("--nocrashreport"),
OUString("--nolockcheck"),
OUString("--accept=pipe,name=" + sPipeName + ";urp;")
};
diff --git a/crashrep/CustomTarget_crashrep_res.mk b/crashrep/CustomTarget_crashrep_res.mk
deleted file mode 100644
index 613043264be8..000000000000
--- a/crashrep/CustomTarget_crashrep_res.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_CustomTarget_CustomTarget,crashrep/source/win32))
-
-$(eval $(call gb_CustomTarget_register_targets,crashrep/source/win32, \
- crashrep.ulf \
- crashrep_impl.rc \
-))
-
-$(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep_impl.rc : \
- $(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep.ulf \
- $(SRCDIR)/crashrep/source/win32/rcfooter.txt \
- $(SRCDIR)/crashrep/source/win32/rcheader.txt \
- $(SRCDIR)/crashrep/source/win32/rctemplate.txt \
- $(call gb_Executable_get_runtime_dependencies,lngconvex)
-
-$(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep_impl.rc :
- $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),LCX,1)
- $(call gb_Helper_abbreviate_dirs,\
- cd $(SRCDIR)/crashrep/source/win32 && \
- $(call gb_Executable_get_command,lngconvex) \
- -ulf $< \
- -rc $@ \
- -rct rctemplate.txt \
- -rch rcheader.txt \
- -rcf rcfooter.txt)
-
-$(eval $(call gb_CustomTarget_ulfex_rule,\
- $(call gb_CustomTarget_get_workdir,crashrep/source/win32)/crashrep.ulf,\
- $(SRCDIR)/crashrep/source/win32/crashrep.ulf,\
- $(foreach lang,$(gb_TRANS_LANGS),\
- $(gb_POLOCATION)/$(lang)/crashrep/source/win32.po)))
-
-# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/crashrep/Executable_crashrep.mk b/crashrep/Executable_crashrep.mk
deleted file mode 100644
index 9d9377f64064..000000000000
--- a/crashrep/Executable_crashrep.mk
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Executable_Executable,crashrep))
-
-$(eval $(call gb_Executable_add_defs,crashrep,\
- -D_INPATH=\"$(OS)_$(CPUNAME)\" \
-))
-
-$(eval $(call gb_Executable_use_external,crashrep,boost_headers))
-
-ifeq ($(OS),WNT)
-
-$(eval $(call gb_Executable_add_exception_objects,crashrep,\
- crashrep/source/win32/soreport \
- crashrep/source/win32/base64 \
-))
-
-$(eval $(call gb_Executable_use_libraries,crashrep,\
- sal \
-))
-
-$(eval $(call gb_Executable_use_system_win32_libs,crashrep,\
- gdi32 \
- comctl32 \
- comdlg32 \
- advapi32 \
- ws2_32 \
- shell32 \
- dbghelp \
- psapi \
-))
-
-$(eval $(call gb_Executable_set_targettype_gui,crashrep,YES))
-
-$(eval $(call gb_Executable_add_nativeres,crashrep,crashrep))
-
-else
-
-$(eval $(call gb_Executable_add_exception_objects,crashrep,\
- crashrep/source/unx/main \
-))
-
-ifeq ($(filter FREEBSD NETBSD DRAGONFLY MACOSX,$(OS)),)
-$(eval $(call gb_Executable_add_libs,crashrep,\
- -ldl \
- -lnsl \
-))
-endif
-
-ifeq ($(OS),SOLARIS)
-$(eval $(call gb_Executable_add_libs,crashrep,\
- -lsocket \
-))
-endif
-
-endif
-
-
-
-# vim: set noet sw=4 ts=4:
diff --git a/crashrep/Makefile b/crashrep/Makefile
deleted file mode 100644
index 0997e628485b..000000000000
--- a/crashrep/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-module_directory:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
-
-include $(module_directory)/../solenv/gbuild/partial_build.mk
-
-# vim: set noet sw=4 ts=4:
diff --git a/crashrep/Module_crashrep.mk b/crashrep/Module_crashrep.mk
deleted file mode 100644
index 334dab0444e9..000000000000
--- a/crashrep/Module_crashrep.mk
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Module_Module,crashrep))
-
-ifeq ($(ENABLE_CRASHDUMP),TRUE)
-
-ifeq ($(OS),WNT)
-$(eval $(call gb_Module_add_targets,crashrep,\
- CustomTarget_crashrep_res \
- WinResTarget_crashrep \
-))
-endif # WNT
-
-$(eval $(call gb_Module_add_targets,crashrep,\
- Executable_crashrep \
-))
-
-endif # ENABLE_CRASHDUMP
-
-# vim: set noet sw=4 ts=4:
diff --git a/crashrep/README b/crashrep/README
deleted file mode 100644
index 515f81ac4127..000000000000
--- a/crashrep/README
+++ /dev/null
@@ -1 +0,0 @@
-Reports crashes (currently disabled).
diff --git a/crashrep/WinResTarget_crashrep.mk b/crashrep/WinResTarget_crashrep.mk
deleted file mode 100644
index c4c44ada5a72..000000000000
--- a/crashrep/WinResTarget_crashrep.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_WinResTarget_WinResTarget,crashrep))
-
-$(eval $(call gb_WinResTarget_use_custom_headers,crashrep,\
- crashrep/source/win32 \
-))
-
-$(eval $(call gb_WinResTarget_add_defs,crashrep,\
- -DRES_APP_NAME=crashrep \
- -DRES_APP_FILEDESC="$(PRODUCTNAME) Crashreporter" \
- -DVERVARIANT=$(LIBO_VERSION_PATCH) \
- -DRES_APP_VENDOR="$(OOO_VENDOR)" \
-))
-
-$(eval $(call gb_WinResTarget_set_rcfile,crashrep,crashrep/source/win32/crashrep))
-
-# vim: set noet sw=4 ts=4:
diff --git a/crashrep/source/unx/main.cxx b/crashrep/source/unx/main.cxx
deleted file mode 100644
index 173e98e66997..000000000000
--- a/crashrep/source/unx/main.cxx
+++ /dev/null
@@ -1,1068 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <cstdio>
-#include <stdlib.h>
-#include <sys/utsname.h>
-#include <errno.h>
-#include <string.h>
-#include <assert.h>
-
-#include <sys/socket.h>
-#include <netdb.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <pthread.h>
-#include <limits.h>
-
-#include <boost/unordered_map.hpp>
-#include <vector>
-#include <string>
-
-#if defined (LINUX) || defined (FREEBSD)
-#include <netinet/in.h>
-#endif
-
-typedef int SOCKET;
-
-#define closesocket close
-#define SOCKET_ERROR -1
-
-#ifdef SOLARIS
-const char *basename( const char *filename )
-{
- const char *pSlash = strrchr( filename, '/' );
-
- return pSlash ? pSlash + 1 : pSlash;
-}
-#endif
-
-using namespace std;
-
-static bool g_bNoUI = false;
-static bool g_bSendReport = false;
-static bool g_bLoadReport = false;
-
-static bool g_bDebugMode = false;
-static int g_signal = 0;
-
-static string g_strProductKey;
-static string g_strReportServer;
-static unsigned short g_uReportPort = 80;
-static string g_buildid;
-static string g_strDefaultLanguage;
-static string g_strXMLFileName;
-static string g_strPStackFileName;
-static string g_strChecksumFileName;
-static string g_strProgramDir;
-
-//static char g_szStackFile[L_tmpnam] = "";
-
-#define REPORT_SERVER (g_strReportServer.c_str())
-#define REPORT_PORT g_uReportPort
-
-static string getprogramdir()
-{
- return g_strProgramDir;
-}
-
-static const char *getlocale()
-{
- const char * locale = getenv( "LC_ALL" );
-
- if( NULL == locale )
- locale = getenv( "LC_CTYPE" );
-
- if( NULL == locale )
- locale = getenv( "LANG" );
-
- if( NULL == locale )
- locale = "C";
-
- return locale;
-}
-
-static const char *get_home_dir()
-{
- struct passwd *ppwd = getpwuid( getuid() );
-
- return ppwd ? (ppwd->pw_dir ? ppwd->pw_dir : "/") : "/";
-}
-
-static string trim_string( const string& rString )
-{
- string temp = rString;
-
- while ( temp.length() && (temp[0] == ' ' || temp[0] == '\t') )
- temp.erase( 0, 1 );
-
- string::size_type len = temp.length();
-
- while ( len && (temp[len-1] == ' ' || temp[len-1] == '\t') )
- {
- temp.erase( len - 1, 1 );
- len = temp.length();
- }
-
- return temp;
-}
-
-static string xml_encode( const string &rString )
-{
- string temp = rString;
- string::size_type pos = 0;
-
- // First replace all occurrences of '&' because it may occur in further
- // encoded chardters too
-
- for( pos = 0; (pos = temp.find( '&', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&amp;" );
-
- for( pos = 0; (pos = temp.find( '<', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&lt;" );
-
- for( pos = 0; (pos = temp.find( '>', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&gt;" );
-
- return temp;
-}
-
-static size_t fcopy( FILE *fpout, FILE *fpin )
-{
- char buffer[1024];
- size_t nBytes;
- size_t nBytesWritten = 0;
-
- while ( 0 != (nBytes = fread( buffer, 1, sizeof(buffer), fpin )) )
- {
- nBytesWritten += fwrite( buffer, 1, nBytes, fpout );
- }
-
- return nBytesWritten;
-}
-
-/*
- writes the report to a temp-file
- from which it can be reviewed and sent
-*/
-
-char* write_report( const boost::unordered_map< string, string >& rSettings )
-{
- char * report_filename;
-
- report_filename = (char*)calloc(1, 2048);
-
- if(!report_filename)
- {
- return NULL;
- }
- strncpy( report_filename, P_tmpdir, 2047 );
- strncat( report_filename, "/crashreport.XXXXXX", 2047 - strlen(report_filename));
-
- int fd = mkstemp(report_filename);
- if(fd == -1)
- {
- free(report_filename);
- return NULL;
- }
- else
- {
- FILE* fp = fdopen(fd, "w");
-
- const char* pszUserType = getenv( "STAROFFICE_USERTYPE" );
-
- fprintf( fp,
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE errormail:errormail PUBLIC \"-//OpenOffice.org//DTD ErrorMail 1.0//EN\" \"errormail.dtd\">\n"
- "<errormail:errormail xmlns:errormail=\"http://openoffice.org/2002/errormail\" usertype=\"%s\">\n"
- "<reportmail:mail xmlns:reportmail=\"http://openoffice.org/2002/reportmail\" version=\"1.1\" feedback=\"%s\" email=\"%s\">\n"
- "<reportmail:title>%s</reportmail:title>\n"
- "<reportmail:attachment name=\"description.txt\" media-type=\"text/plain\" class=\"UserComment\"/>\n"
- "<reportmail:attachment name=\"stack.txt\" media-type=\"text/plain\" class=\"pstack output\"/>\n"
- "</reportmail:mail>\n"
- "<officeinfo:officeinfo xmlns:officeinfo=\"http://openoffice.org/2002/officeinfo\" build=\"%s\" platform=\"%s\" language=\"%s\" exceptiontype=\"%d\" product=\"%s\" procpath=\"%s\"/>\n"
- ,
- pszUserType ? xml_encode( pszUserType ).c_str() : "",
- xml_encode(rSettings.find( "CONTACT" )->second).c_str(),
- xml_encode(rSettings.find( "EMAIL" )->second).c_str(),
- xml_encode(rSettings.find( "TITLE" )->second).c_str(),
- g_buildid.length() ? xml_encode( g_buildid ).c_str() : "unknown",
- _INPATH,
- g_strDefaultLanguage.c_str(),
- g_signal,
- g_strProductKey.length() ? xml_encode(g_strProductKey).c_str() : "unknown",
- xml_encode(getprogramdir()).c_str()
- );
-
- struct utsname info;
-
- memset( &info, 0, sizeof(info) );
- uname( &info );
-
- fprintf( fp,
- "<systeminfo:systeminfo xmlns:systeminfo=\"http://openoffice.org/2002/systeminfo\">\n"
- "<systeminfo:System name=\"%s\" version=\"%s\" build=\"%s\" locale=\"%s\"/>\n"
- ,
- xml_encode( info.sysname ).c_str(),
- xml_encode( info.version ).c_str(),
- xml_encode( info.release ).c_str(),
- xml_encode( getlocale() ).c_str()
- );
- fprintf( fp, "<systeminfo:CPU type=\"%s\"/>\n", xml_encode( info.machine ).c_str() );
- fprintf( fp, "</systeminfo:systeminfo>\n" );
-
- FILE *fpxml = fopen( g_strXMLFileName.c_str(), "r" );
- if ( fpxml )
- {
- fcopy( fp, fpxml );
- fclose( fpxml );
- }
-
- FILE *fpchk = fopen( g_strChecksumFileName.c_str(), "r" );
- if ( fpchk )
- {
- fcopy( fp, fpchk );
- fclose( fpchk );
- }
-
- fprintf( fp, "</errormail:errormail>\n" );
-
- fclose( fp );
- }
- return report_filename;
-}
-
-
-char* write_description( const boost::unordered_map< string, string >& rSettings )
-{
- char * description_filename;
-
- description_filename = (char*)calloc(1, 2048);
-
- if(!description_filename)
- {
- return NULL;
- }
- strncpy( description_filename, P_tmpdir, 2047 );
- strncat( description_filename, "/crashreport.XXXXXX", 2047 - strlen(description_filename));
-
- int fd = mkstemp(description_filename);
- if(fd == -1)
- {
- free(description_filename);
- return NULL;
- }
- else
- {
- FILE* fp = fdopen(fd, "w");
-
- if ( fp )
- {
- fprintf( fp, "\xEF\xBB\xBF" );
- fprintf( fp, "%s\n", rSettings.find( "DESCRIPTION" )->second.c_str() );
- fclose( fp );
- }
- }
- return description_filename;
-}
-
-#if 0
-// unused
-static void printSettings( const boost::unordered_map<string,string>& rSettings )
-{
- printf( "Settings:\n" );
- for( boost::unordered_map<string,string>::const_iterator it = rSettings.begin(); it != rSettings.end(); ++it )
- {
- printf( "%s=\"%s\"\n", it->first.c_str(), it->second.c_str() );
- }
-}
-#endif
-
-bool SendHTTPRequest(
- FILE *fp,
- const char *pszServer,
- unsigned short uPort = 80,
- const char *pszProxyServer = NULL,
- unsigned short uProxyPort = 8080 )
-{
- bool success = false;
-
- struct hostent *hp;
-
- if ( pszProxyServer )
- hp = gethostbyname( pszProxyServer );
- else
- hp = gethostbyname( pszServer );
-
- if ( hp )
- {
- SOCKET s = socket( AF_INET, SOCK_STREAM, 0 );
-
- if ( s )
- {
- struct sockaddr_in address;
-
- memcpy(&(address.sin_addr.s_addr), *(hp->h_addr_list),sizeof(struct in_addr));
- address.sin_family = AF_INET;
-
- if ( pszProxyServer )
- address.sin_port = ntohs( uProxyPort );
- else
- address.sin_port = ntohs( uPort );
-
- if ( 0 == connect( s, (struct sockaddr *)&address, sizeof(struct sockaddr_in)) )
- {
- fseek( fp, 0, SEEK_END );
- size_t length = ftell( fp );
- fseek( fp, 0, SEEK_SET );
-
- char buffer[2048];
-
- if ( pszProxyServer )
- sprintf( buffer,
- "POST http://%s:%u/soap/servlet/rpcrouter HTTP/1.0\r\n"
- "Content-Type: text/xml; charset=\"utf-8\"\r\n"
- "Content-Length: %d\r\n"
- "SOAPAction: \"\"\r\n\r\n",
- pszServer,
- uPort,
- static_cast<int>(length)
- );
- else
- sprintf( buffer,
- "POST /soap/servlet/rpcrouter HTTP/1.0\r\n"
- "Content-Type: text/xml; charset=\"utf-8\"\r\n"
- "Content-Length: %d\r\n"
- "SOAPAction: \"\"\r\n\r\n",
- static_cast<int>(length)
- );
-
- if ( g_bDebugMode )
- {
- printf( "*** Sending HTTP request ***\n\n" );
- printf( "%s", buffer );
- }
-
- if ( SOCKET_ERROR != send( s, buffer, strlen(buffer), 0 ) )
- {
- size_t nBytes;
-
- do
- {
- nBytes = fread( buffer, 1, sizeof(buffer), fp );
-
- if ( nBytes )
- {
- if ( g_bDebugMode )
- fwrite( buffer, 1, nBytes, stdout );
- success = SOCKET_ERROR != send( s, buffer, nBytes, 0 );
- }
- } while( nBytes && success );
-
- if ( success )
- {
- if ( g_bDebugMode )
- printf( "*** Receiving HTTP response ***\n\n" );
-
- memset( buffer, 0, sizeof(buffer) );
- success = SOCKET_ERROR != recv( s, buffer, sizeof(buffer), 0 );
- if ( success )
- {
- char szHTTPSignature[sizeof(buffer)] = "";
- unsigned uHTTPReturnCode = 0;
-
- sscanf( buffer, "%s %d ", szHTTPSignature, &uHTTPReturnCode );
- success = uHTTPReturnCode == 200;
- }
- if ( g_bDebugMode )
- do
- {
- printf( "%s", buffer );
- memset( buffer, 0, sizeof(buffer) );
- } while ( 0 < recv( s, buffer, sizeof(buffer), 0 ) );
- }
- }
-
- }
-
- closesocket( s );
- }
- }
-
- return success;
-}
-
-static void WriteSOAPRequest( FILE *fp, char* report_filename, char* description_filename )
-{
- fprintf( fp,
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n"
- "xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n"
- "xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"\n"
- "xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\"\n"
- "xmlns:rds=\"urn:ReportDataService\"\n"
- "xmlns:apache=\"http://xml.apache.org/xml-soap\"\n"
- "SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
- "<SOAP-ENV:Body>\n"
- );
-
- fprintf( fp, "<rds:submitReport>\n" );
- fprintf( fp, "<body xsi:type=\"xsd:string\">This is an autogenerated crash report mail.</body>\n" );
- fprintf( fp, "<hash xsi:type=\"apache:Map\">\n" );
-
- FILE *fpin = fopen( report_filename, "r" );
- if ( fpin )
- {
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">reportmail.xml</key>\n"
- "<value xsi:type=\"xsd:string\"><![CDATA[" );
- fcopy( fp, fpin );
- fprintf( fp, "]]></value></item>\n" );
- fclose( fpin );
- }
-
- fpin = fopen( description_filename, "r" );
- if ( fpin )
- {
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">description.txt</key>\n"
- "<value xsi:type=\"xsd:string\"><![CDATA[" );
- fcopy( fp, fpin );
- fprintf( fp, "]]></value></item>\n" );
- fclose( fpin );
- }
-
-// nowhere g_szStackfile is actually populated with something
-// so this ends up trying to open "" which is going to fail
-// so what's the point ?
-#if 0
- fpin = fopen( g_szStackFile, "r" );
- if ( fpin )
- {
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">stack.txt</key>\n"
- "<value xsi:type=\"xsd:string\"><![CDATA[" );
- fcopy( fp, fpin );
- fprintf( fp, "]]></value></item>\n" );
- fclose( fpin );
- }
-#endif
- fprintf( fp,
- "</hash>\n"
- "</rds:submitReport>\n"
- "</SOAP-ENV:Body>\n"
- "</SOAP-ENV:Envelope>\n"
- );
-}
-
-struct RequestParams
-{
- FILE *fpin;
- const char *pServer;
- const char *pProxyServer;
-};
-
-
-bool send_crash_report( const boost::unordered_map< string, string >& rSettings )
-{
- if ( 0 == strcasecmp( rSettings.find( "CONTACT" )->second.c_str(), "true" ) &&
- !trim_string(rSettings.find( "EMAIL" )->second).length() )
- {
- return false;
- }
-
- char *endptr = NULL;
-
- const char *pProxyServer = rSettings.find( "SERVER" )->second.c_str();
- unsigned short uProxyPort = (unsigned short)strtoul( rSettings.find( "PORT" )->second.c_str(), &endptr, 10 );
-
- bool bUseProxy = !strcasecmp( "true", rSettings.find( "USEPROXY" )->second.c_str() );
-
-
- char* description_filename = write_description( rSettings );
- char* report_filename = write_report( rSettings );
- bool bSuccess = false;
-
- if(description_filename && report_filename)
- {
- FILE* fptemp = tmpfile();
- if ( fptemp )
- {
- WriteSOAPRequest( fptemp, report_filename, description_filename );
- fseek( fptemp, 0, SEEK_SET );
-
- bSuccess = SendHTTPRequest(
- fptemp,
- REPORT_SERVER, REPORT_PORT,
- bUseProxy ? pProxyServer : NULL,
- uProxyPort ? uProxyPort : 8080
- );
-
- fclose( fptemp );
- }
- }
- if(description_filename)
- {
- unlink( description_filename);
- free( description_filename);
- }
- if(report_filename)
- {
- unlink( report_filename);
- free( report_filename);
- }
-
- return bSuccess;
-}
-
-
-// ensure validity of program relative paths
-static void setup_program_dir( const char* progname )
-{
- char szCanonicProgPath[PATH_MAX];
-
-
- if ( realpath( progname, szCanonicProgPath ) )
- {
- string aDir = szCanonicProgPath;
-
- size_t pos = aDir.rfind( '/' );
- // FIXME: search PATH if necessary
- assert( pos != string::npos );
-
- g_strProgramDir = aDir.substr( 0, pos + 1 );
- aDir.erase( pos );
- int ret = chdir( aDir.c_str() );
- if (!ret)
- {
- return;
- }
- }
-}
-
-
-
-static long setup_commandline_arguments( int argc, char** argv, int *pSignal )
-{
- long pid = 0;
- int signal = 0;
-
- for ( int n = 1; n < argc; n++ )
- {
- if ( 0 == strcmp( argv[n], "-p" ) )
- {
- if ( ++n < argc )
- pid = strtol( argv[n], NULL, 0 );
- }
- else if ( 0 == strcmp( argv[n], "-s" ) )
- {
- if ( ++n < argc )
- signal = strtol( argv[n], NULL, 0 );
- }
- else if ( 0 == strcmp( argv[n], "-debug" ) )
- {
- g_bDebugMode = true;
- }
- else if ( 0 == strcmp( argv[n], "-xml" ) )
- {
- if ( ++n < argc )
- g_strXMLFileName = argv[n];
- }
- else if ( 0 == strcmp( argv[n], "-stack" ) )
- {
- if ( ++n < argc )
- g_strPStackFileName = argv[n];
- }
- else if ( 0 == strcmp( argv[n], "-chksum" ) )
- {
- if ( ++n < argc )
- g_strChecksumFileName = argv[n];
- }
- else if ( 0 == strcmp( argv[n], "-noui" ) )
- {
- g_bNoUI = true;
- }
- else if ( 0 == strcmp( argv[n], "-send" ) )
- {
- g_bSendReport = true;
- }
- else if ( 0 == strcmp( argv[n], "-load" ) )
- {
- g_bLoadReport = true;
- }
- else if ( argv[n] && strlen(argv[n]) )
- {
- printf(
- "\n%s crash_report %s\n\n" \
- "/?, -h[elp] %s\n\n" \
- "%-20s %s\n\n",
- "%MSG_CMDLINE_USAGE%",
- "%MSG_PARAM_PROCESSID%",
- "%MSG_PARAM_HELP_DESCRIPTION%",
- "%MSG_PARAM_PROCESSID%",
- "%MSG_PARAM_PROCESSID_DESCRIPTION%"
- );
- break;
- }
- }
-
- *pSignal = signal;
-
- return pid;
-}
-
-
-
-static bool read_line( FILE *fp, string& rLine )
-{
- char szBuffer[1024];
- bool bSuccess = false;
- bool bEOL = false;
- string line;
-
-
- while ( !bEOL && fgets( szBuffer, sizeof(szBuffer), fp ) )
- {
- int len = strlen(szBuffer);
-
- bSuccess = true;
-
- while ( len && szBuffer[len - 1] == '\n' )
- {
- szBuffer[--len] = 0;
- bEOL = true;
- }
-
- line.append( szBuffer );
- }
-
- rLine = line;
- return bSuccess;
-}
-
-static string get_script_string( const char *pFileName, const char *pKeyName )
-{
- FILE *fp = fopen( pFileName, "r" );
- string retValue;
-
- if ( fp )
- {
- string line;
-
- while ( read_line( fp, line ) )
- {
- line = trim_string( line );
-
-
- string::size_type iEqualSign = line.find( '=', 0 );
-
- if ( iEqualSign != string::npos )
- {
- string keyname = line.substr( 0, iEqualSign );
- keyname = trim_string( keyname );
-
- string value = line.substr( iEqualSign + 1, string::npos );
- value = trim_string( value );
-
- if ( value.length() && '\"' == value[0] )
- {
- value.erase( 0, 1 );
-
- string::size_type iQuotes = value.find( '"', 0 );
-
- if ( iQuotes != string::npos )
- value.erase( iQuotes );
- }
-
- if ( 0 == strcasecmp( keyname.c_str(), pKeyName ) )
- {
- retValue = value;
- break;
- }
- }
- }
-
- fclose( fp );
- }
-
- return retValue;
-}
-
-static string get_profile_string( const char *pFileName, const char *pSectionName, const char *pKeyName, const char *pDefault = NULL )
-{
- FILE *fp = fopen( pFileName, "r" );
- string retValue = pDefault ? pDefault : "";
-
- if ( fp )
- {
- string line;
- string section;
-
- while ( read_line( fp, line ) )
- {
- line = trim_string( line );
-
- if ( line.length() && line[0] == '[' )
- {
- line.erase( 0, 1 );
- string::size_type end = line.find( ']', 0 );
-
- if ( string::npos != end )
- section = trim_string( line.substr( 0, end ) );
- }
- else
- {
-
- string::size_type iEqualSign = line.find( '=', 0 );
-
- if ( iEqualSign != string::npos )
- {
- string keyname = line.substr( 0, iEqualSign );
- keyname = trim_string( keyname );
-
- string value = line.substr( iEqualSign + 1, string::npos );
- value = trim_string( value );
-
- if (
- 0 == strcasecmp( section.c_str(), pSectionName ) &&
- 0 == strcasecmp( keyname.c_str(), pKeyName )
- )
- {
- retValue = value;
- break;
- }
- }
- }
- }
-
- fclose( fp );
- }
-
- return retValue;
-}
-
-static string get_environment_string( const char *pEnvName )
-{
- const char *pEnvValue = getenv( pEnvName );
-
- if ( pEnvValue )
- return pEnvValue;
- else
- return "";
-}
-
-static string read_from_file( const string& rFileName )
-{
- string content;
- FILE *fp = fopen( rFileName.c_str(), "r" );
-
- if ( fp )
- {
- char buffer[256 + 1];
- size_t nBytesRead;
-
- while( 0 != ( nBytesRead = fread( buffer, 1, sizeof(buffer) - 1, fp ) ) )
- {
- buffer[nBytesRead] = 0;
- content += buffer;
- }
-
- fclose( fp );
- }
-
- return content;
-}
-
-#define RCFILE ".crash_reportrc"
-#define XMLFILE ".crash_report_frames"
-#define CHKFILE ".crash_report_checksum"
-#define LCKFILE ".crash_report_unsent"
-#define PRVFILE ".crash_report_preview"
-
-static void load_crash_data()
-{
- g_strXMLFileName = get_home_dir();
- g_strXMLFileName += "/";
- g_strXMLFileName += string(XMLFILE);
-
- g_strChecksumFileName = get_home_dir();
- g_strChecksumFileName += "/";
- g_strChecksumFileName += string(CHKFILE);
-}
-
-static bool write_crash_data()
-{
- bool success = true;
- string sFile = get_home_dir();
-
- sFile += "/";
- sFile += string(XMLFILE);
-
- FILE *fp = fopen( sFile.c_str(), "w" );
-
- if ( fp )
- {
- FILE *fpin = fopen( g_strXMLFileName.c_str(), "r" );
-
- if ( fpin )
- {
- fcopy( fp, fpin );
- fclose( fpin );
- }
-
- fclose( fp );
- }
-
- sFile = get_home_dir();
-
- sFile += "/";
- sFile += string(CHKFILE);
-
- fp = fopen( sFile.c_str(), "w" );
-
- if ( fp )
- {
- FILE *fpin = fopen( g_strChecksumFileName.c_str(), "r" );
-
- if ( fpin )
- {
- fcopy( fp, fpin );
- fclose( fpin );
- }
-
- fclose( fp );
- }
-
- sFile = get_home_dir();
-
- sFile += "/";
- sFile += string(LCKFILE);
-
- fp = fopen( sFile.c_str(), "w" );
-
- if ( fp )
- {
- fprintf( fp, "Unsent\n" );
- fclose( fp );
- }
-
- return success;
-}
-
-#if 0
-// unused
-static bool write_settings( const boost::unordered_map< string, string >& rSettings )
-{
- bool success = false;
- string sRCFile = get_home_dir();
-
- sRCFile += "/";
- sRCFile += string(RCFILE);
-
- FILE *fp = fopen( sRCFile.c_str(), "w" );
-
- if ( fp )
- {
- fprintf( fp, "[Options]\n" );
- fprintf( fp, "UseProxy=%s\n", rSettings.find( "USEPROXY" )->second.c_str() );
- fprintf( fp, "ProxyServer=%s\n", rSettings.find( "SERVER" )->second.c_str() );
- fprintf( fp, "ProxyPort=%s\n", rSettings.find( "PORT" )->second.c_str() );
- fprintf( fp, "ReturnAddress=%s\n", rSettings.find( "EMAIL" )->second.c_str() );
- fprintf( fp, "AllowContact=%s\n", rSettings.find( "CONTACT" )->second.c_str() );
- fclose( fp );
- }
-
- return success;
-}
-#endif
-
-static void read_settings( boost::unordered_map< string, string >& rSettings )
-{
- string sRCFile = get_home_dir();
-
- sRCFile += "/";
- sRCFile += string(RCFILE);
-
- rSettings[ "EMAIL" ] = get_profile_string( sRCFile.c_str(), "Options", "ReturnAddress" );
- rSettings[ "SERVER" ] = get_profile_string( sRCFile.c_str(), "Options", "ProxyServer" );
- rSettings[ "PORT" ] = get_profile_string( sRCFile.c_str(), "Options", "ProxyPort" );
- rSettings[ "USEPROXY" ] = get_profile_string( sRCFile.c_str(), "Options", "UseProxy" );
- rSettings[ "CONTACT" ] = get_profile_string( sRCFile.c_str(), "Options", "AllowContact" );
- rSettings[ "DESCRIPTION" ] = "";
- rSettings[ "TITLE" ] = "";
-}
-
-static void read_settings_from_environment( boost::unordered_map< string, string >& rSettings )
-{
- string strEnv;
-
- strEnv = get_environment_string( "ERRORREPORT_RETURNADDRESS" );
- if ( strEnv.length() )
- {
- rSettings[ "EMAIL" ] = strEnv;
- if ( !(rSettings.find( "CONTACT" )->second).length() )
- rSettings[ "CONTACT" ] = "true";
- }
- else if ( !(rSettings.find( "CONTACT" )->second).length() )
- rSettings[ "CONTACT" ] = "false";
-
-
- strEnv = get_environment_string( "ERRORREPORT_HTTPPROXYSERVER" );
- if ( strEnv.length() )
- rSettings[ "SERVER" ] = strEnv;
-
- strEnv = get_environment_string( "ERRORREPORT_HTTPPROXYPORT" );
- if ( strEnv.length() )
- rSettings[ "PORT" ] = strEnv;
-
- strEnv = get_environment_string( "ERRORREPORT_HTTPCONNECTIONTYPE" );
- if ( strEnv.length() )
- rSettings[ "USEPROXY" ] = 0 == strcasecmp( strEnv.c_str(), "MANUALPROXY" ) ? "true" : "false";
-
- strEnv = get_environment_string( "ERRORREPORT_BODYFILE" );
- if ( strEnv.length() )
- rSettings[ "DESCRIPTION" ] = read_from_file( strEnv );
-
- strEnv = get_environment_string( "ERRORREPORT_SUBJECT" );
- if ( strEnv.length() )
- rSettings[ "TITLE" ] = strEnv;
-}
-
-static bool setup_version()
-{
- if ( !getenv( "PRODUCTNAME" ) )
- {
- string productkey = get_profile_string( "bootstraprc", "Bootstrap", "ProductKey" );
-
- g_strProductKey = productkey;
-
- if ( productkey.length() )
- {
- static string productname;
- static string productversion;
- string::size_type iSpace = productkey.find( ' ', 0 );
-
- if ( string::npos != iSpace )
- {
- productname = productkey.substr( 0, iSpace );
- productversion = productkey.substr( iSpace + 1, string::npos );
- }
- else
- productname = productkey;
-
- productname.insert( 0, "PRODUCTNAME=" );
- putenv( (char *)productname.c_str() );
-
- productversion.insert( 0, "PRODUCTVERSION=" );
- putenv( (char *)productversion.c_str() );
- }
- }
-
- g_buildid = get_profile_string( "versionrc", "Version", "BuildId" );
- g_strDefaultLanguage = get_script_string( "instdb.ins", "DefaultLanguage" );
-
- g_strReportServer = get_profile_string( "bootstraprc", "ErrorReport", "ErrorReportServer" );
-
- string strReportPort = get_profile_string( "bootstraprc", "ErrorReport", "ErrorReportPort", "80" );
- char *endptr = NULL;
- unsigned short uReportPort = (unsigned short)strtoul( strReportPort.c_str(), &endptr, 10 );
- g_uReportPort = uReportPort ? uReportPort : 80;
-
- return 0 != g_strReportServer.length();
-}
-
-int main( int argc, char** argv )
-{
- FILE *fin = freopen( "/dev/null", "w", stderr );
- if (!fin)
- {
- return -1;
- }
-
- setup_program_dir( argv[0] );
-
- // Don't start if report server is not given
-
- if ( setup_version() )
- {
- /*long pid =*/ setup_commandline_arguments( argc, argv, &g_signal );
-
- if ( g_bLoadReport )
- {
- load_crash_data();
- }
-
- if ( g_bSendReport )
- {
- boost::unordered_map< string, string > aDialogSettings;
-
- read_settings( aDialogSettings );
- read_settings_from_environment( aDialogSettings );
-
- send_crash_report( aDialogSettings );
- }
- else
- {
- boost::unordered_map< string, string > aDialogSettings;
-
- read_settings( aDialogSettings );
- read_settings_from_environment( aDialogSettings );
-
- write_crash_data();
- char* report_filename = write_report( aDialogSettings );
- if(report_filename)
- {
- string sPreviewFile = get_home_dir();
- sPreviewFile += "/";
- sPreviewFile += string(PRVFILE);
-
- FILE *fpout = fopen( sPreviewFile.c_str(), "w+" );
- if ( fpout )
- {
- FILE *fpin = fopen( report_filename, "r" );
- if ( fpin )
- {
- fcopy( fpout, fpin );
- fclose( fpin );
- }
- fclose( fpout );
- }
-
- unlink( report_filename );
- free(report_filename);
- }
- }
-
- if ( g_bLoadReport )
- {
- unlink( g_strXMLFileName.c_str() );
- unlink( g_strChecksumFileName.c_str() );
- }
-
-// unlink( g_szStackFile );
-
- return 0;
- }
-
- return -1;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/win32/base64.cxx b/crashrep/source/win32/base64.cxx
deleted file mode 100644
index a0b8769f6bc5..000000000000
--- a/crashrep/source/win32/base64.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <stdio.h>
-#include <string.h>
-#include "base64.h"
-
-static const char base64_tab[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-extern "C" size_t base64_encode( FILE *fin, FILE *fout )
-{
- size_t nLineLength = 0;
- size_t nBytesWritten = 0;
-
- size_t nBytes = 0;
-
- do
- {
- unsigned char in_buffer[3];
-
- memset( in_buffer, 0, sizeof(in_buffer) );
- nBytes = fread( in_buffer, 1, sizeof(in_buffer), fin );
-
- if ( nBytes )
- {
- unsigned long value =
- ((unsigned long)in_buffer[0]) << 16 |
- ((unsigned long)in_buffer[1]) << 8 |
- ((unsigned long)in_buffer[2]) << 0;
-
- unsigned char out_buffer[4];
-
- memset( out_buffer, '=', sizeof(out_buffer) );
-
- out_buffer[0] = base64_tab[(value >> 18) & 0x3F];
- out_buffer[1] = base64_tab[(value >> 12) & 0x3F];
-
- if ( nBytes > 1 )
- {
- out_buffer[2] = base64_tab[(value >> 6) & 0x3F];
- if ( nBytes > 2 )
- out_buffer[3] = base64_tab[(value >> 0) & 0x3F];
- }
-
- if ( nLineLength >= 76 )
- {
- fputs( "\n", fout );
- nLineLength = 0;
- }
-
- nBytesWritten += fwrite( out_buffer, 1, sizeof(out_buffer), fout );
- nLineLength += sizeof(out_buffer);
- }
- } while ( nBytes );
-
- return nBytesWritten;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/win32/base64.h b/crashrep/source/win32/base64.h
deleted file mode 100644
index 5f6c26e1902c..000000000000
--- a/crashrep/source/win32/base64.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_CRASHREP_SOURCE_WIN32_BASE64_H
-#define INCLUDED_CRASHREP_SOURCE_WIN32_BASE64_H
-
-#ifndef _INC_STDIO
-#include <stdio.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-size_t base64_encode( FILE *fin, FILE *fout );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // INCLUDED_CRASHREP_SOURCE_WIN32_BASE64_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/win32/crashrep.rc b/crashrep/source/win32/crashrep.rc
deleted file mode 100644
index 250ed92d7e85..000000000000
--- a/crashrep/source/win32/crashrep.rc
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "crashrep_impl.rc"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/win32/crashrep.ulf b/crashrep/source/win32/crashrep.ulf
deleted file mode 100644
index 12ef7e75c246..000000000000
--- a/crashrep/source/win32/crashrep.ulf
+++ /dev/null
@@ -1,221 +0,0 @@
-
-[%WELCOME_CAPTION%]
-en-US = "%PRODUCTNAME% %PRODUCTVERSION% Error Report"
-
-
-[%WELCOME_HEADER%]
-en-US = "Welcome to the %PRODUCTNAME% %PRODUCTVERSION% Error Report"
-
-
-[%WELCOME_BODY1%]
-en-US = "This error report tool gathers information about how %PRODUCTNAME% is working and sends it to The Document Foundation to help improve future versions.\n\n"
-
-
-[%WELCOME_BODY2%]
-en-US = "It's easy - just send the report without any further effort on your part by clicking 'Send' in the next dialog, or you can briefly describe how the error occurred and then click 'Send'. If you want to see the report, click the 'Show Report' button. No data will be sent if you click 'Do Not Send'.\n\n"
-
-
-[%WELCOME_BODY3%]
-en-US = "Customer Privacy\nThe information gathered is limited to data concerning the state of %PRODUCTNAME% %PRODUCTVERSION% when the error occurred. Other information about passwords or document contents is not collected.\n\nThe information will only be used to improve the quality of %PRODUCTNAME% and will not be shared with third parties.\nFor more information on The Document Foundation's privacy policy, visit\n"
-
-
-[%PRIVACY_URL%]
-en-US = "http://www.documentfoundation.org/privacy"
-
-
-[%NEXT_BUTTON%]
-en-US = "~Next >>"
-
-
-[%CANCEL_BUTTON%]
-en-US = "Cancel"
-
-
-[%OK_BUTTON%]
-en-US = "OK"
-
-
-[%REPORT_CAPTION%]
-en-US = "%PRODUCTNAME% %PRODUCTVERSION% Error Report"
-
-
-[%REPORT_HEADER%]
-en-US = "An error occurred while running %PRODUCTNAME% %PRODUCTVERSION%"
-
-
-[%REPORT_BODY%]
-en-US = "The %PRODUCTNAME% %PRODUCTVERSION% Error Report has gathered information that could help The Document Foundation improve %PRODUCTNAME%.\nIn the spaces below, you can enter a title for your crash report and describe the action you were trying to carry out when the error occurred. Then click 'Send'.\n"
-
-
-[%ENTER_TITLE%]
-en-US = "Which type of document (e.g. presentation) were you using when the error occurred?"
-
-
-[%ALLOW_CONTACT%]
-en-US = "~I allow The Document Foundation to contact me regarding this report."
-
-
-[%ENTER_EMAIL%]
-en-US = "Please enter your e-mail address."
-
-
-[%ENTER_DESCRIPTION%]
-en-US = "~How were you using %PRODUCTNAME% when the error occurred ?"
-
-
-[%BACK_BUTTON%]
-en-US = " << ~Back"
-
-
-[%SEND_BUTTON%]
-en-US = "S~end"
-
-
-[%DONOT_SEND_BUTTON%]
-en-US = "Do ~Not Send"
-
-
-[%SHOW_REPORT_BUTTON%]
-en-US = "Show ~Report..."
-
-
-[%SAVE_REPORT_BUTTON%]
-en-US = "~Save Report..."
-
-
-[%SAVE_REPORT_TITLE%]
-en-US = "Save Report to"
-
-
-[%ERROR_MSG_SIMPLE_MAPI%]
-en-US = "The error report could not be sent because the default e-mail program does not support MAPI.\n Please use a MAPI-compatible e-mail program."
-
-
-[%ERROR_MSG_DISK_FULL%]
-en-US = "The error report could not be temporarily saved and could therefore not be sent."
-
-
-
-[%ERROR_MSG_SENDMAIL%]
-en-US = "The error report could not be sent because 'sendmail' could not be started.\nPlease check the 'sendmail' settings."
-
-
-[%ERROR_MSG_PROXY%]
-en-US = "The error report could not be sent. Please check the proxy settings under 'Options' in the Error Report Tool."
-
-
-[%ERROR_MSG_NOCONNECT%]
-en-US = "The error report could not be sent because there is no Internet connection. Please check your Internet settings."
-
-
-[%OPTIONS_BUTTON%]
-en-US = "~Options..."
-
-
-[%OPTIONS_TITLE%]
-en-US = "Options"
-
-
-[%PROXY_SETTINGS_HEADER%]
-en-US = "Proxy settings"
-
-
-[%PROXY_SETTINGS_SYSTEM%]
-en-US = "Use ~system settings"
-
-
-[%PROXY_SETTINGS_DIRECT%]
-en-US = "Use ~direct connection to the Internet"
-
-
-[%PROXY_SETTINGS_MANUAL%]
-en-US = "Use ~manual settings"
-
-
-[%PROXY_SETTINGS_ADDRESS%]
-en-US = "HT~TP Proxy"
-
-
-[%PROXY_SETTINGS_PORT%]
-en-US = "~Port"
-
-
-[%PROXY_SETTINGS_DESCRIPTION%]
-en-US = "The %PRODUCTNAME% Error Report tool needs to be connected to the Internet to be able to send error reports.\n\nCompanies often use proxy servers in conjunction with a firewall to protect the network.\n\nIf this applies to your situation, you have to specify the address and port for the server."
-
-
-[%SENDING_REPORT_HEADER%]
-en-US = "Sending Error Report"
-
-
-[%SENDING_REPORT_STATUS%]
-en-US = "Status: Sending error report"
-
-
-[%SENDING_REPORT_STATUS_FINISHED%]
-en-US = "Status: The error report has been sent successfully."
-
-
-[%ERROR_MSG_NOEMAILADDRESS%]
-en-US = "You have marked the option 'I allow The Document Foundation to contact me regarding this report.'\nPlease enter your e-mail address."
-
-
-[%MSG_CMDLINE_USAGE%]
-en-US = "Usage:"
-
-
-[%MSG_PARAM_PROCESSID%]
-en-US = "-p <process ID>"
-
-
-[%MSG_PARAM_PROCESSID_DESCRIPTION%]
-en-US = "Assigns the %PRODUCTNAME% process ID (PID) to the Error Report Tool"
-
-
-[%MSG_PARAM_HELP_DESCRIPTION%]
-en-US = "Shows this help text.\nDetailed information can be found in the Setup Guide."
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/crashrep/source/win32/ctrylnglist.txt b/crashrep/source/win32/ctrylnglist.txt
deleted file mode 100644
index ec2196e4da43..000000000000
--- a/crashrep/source/win32/ctrylnglist.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-1 LANG_ENGLISH SUBLANG_ENGLISH_US
-3 LANG_PORTUGUESE SUBLANG_PORTUGUESE
-4 LANG_GERMAN SUBLANG_GERMAN
-7 LANG_RUSSIAN SUBLANG_DEFAULT
-30 LANG_GREEK SUBLANG_DEFAULT
-31 LANG_DUTCH SUBLANG_DUTCH
-33 LANG_FRENCH SUBLANG_FRENCH
-34 LANG_SPANISH SUBLANG_SPANISH
-35 LANG_FINNISH SUBLANG_DEFAULT
-36 LANG_HUNGARIAN SUBLANG_DEFAULT
-39 LANG_ITALIAN SUBLANG_ITALIAN
-42 LANG_CZECH SUBLANG_DEFAULT
-43 LANG_SLOVAK SUBLANG_DEFAULT
-44 LANG_ENGLISH SUBLANG_ENGLISH_UK
-45 LANG_DANISH SUBLANG_DEFAULT
-46 LANG_SWEDISH SUBLANG_SWEDISH
-47 LANG_NORWEGIAN SUBLANG_NORWEGIAN_BOKMAL
-48 LANG_POLISH SUBLANG_DEFAULT
-49 LANG_GERMAN SUBLANG_DEFAULT
-55 LANG_PORTUGUESE SUBLANG_PORTUGUESE_BRAZILIAN
-81 LANG_JAPANESE SUBLANG_DEFAULT
-82 LANG_KOREAN SUBLANG_KOREAN
-86 LANG_CHINESE SUBLANG_CHINESE_SIMPLIFIED
-88 LANG_CHINESE SUBLANG_CHINESE_TRADITIONAL
-90 LANG_TURKISH SUBLANG_DEFAULT
-96 LANG_ARABIC SUBLANG_DEFAULT
-97 LANG_HEBREW SUBLANG_DEFAULT
-37 LANG_CATALAN SUBLANG_DEFAULT
-66 LANG_THAI SUBLANG_DEFAULT
diff --git a/crashrep/source/win32/rcfooter.txt b/crashrep/source/win32/rcfooter.txt
deleted file mode 100644
index 43c268ca97d4..000000000000
--- a/crashrep/source/win32/rcfooter.txt
+++ /dev/null
@@ -1 +0,0 @@
-// Footer \ No newline at end of file
diff --git a/crashrep/source/win32/rcheader.txt b/crashrep/source/win32/rcheader.txt
deleted file mode 100644
index a94e4bee204f..000000000000
--- a/crashrep/source/win32/rcheader.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-// Header
-#include "resource.h"
-#include <winresrc.h>
-#define LB_ADDSTRING (WM_USER+1)
-#define CB_ADDSTRING (WM_USER+3)
-#define IDC_STATIC (-1)
-
-#include "version.hrc"
-
-#ifdef FONTSIZE
-#undef FONTSIZE
-#endif
-#define LANG_KOREAN 82
-#define LANG_CHINESE 86
-#define LANG_JAPANESE 81
-#define PLACEHOLDER LANGUAGE
-
-
-// version information
-
-
-VS_VERSION_INFO versioninfo
- fileversion VERSION, SUBVERSION, MICROVERSION, VERVARIANT
- productversion VERSION, SUBVERSION, MICROVERSION, VERVARIANT
- fileflagsmask 0x3F
- fileflags
-#if defined(DEBUG)
- VS_FF_DEBUG |
-#endif
-#ifdef VER_PREL
- VS_FF_PRERELEASE |
-#endif
- 0
- fileos VOS_NT_WINDOWS32
- filetype VFT_APP
- {
- block "StringFileInfo"
- {
- block "040904E4"
- {
- // International StringTable
- VALUE "CompanyName", PPS(RES_APP_VENDOR) "\0"
- VALUE "FileDescription", PPS(RES_APP_FILEDESC) "\0"
- VALUE "FileVersion", PPS(VER_LEVEL) "\0"
- VALUE "ProductVersion", PPS(VER_LEVEL) "\0"
- VALUE "ProductName", "LibreOffice\0"
- VALUE "OriginalFilename", PPS(RES_APP_NAME) ".exe\0"
- VALUE "InternalName", PPS(RES_APP_NAME) "\0"
- VALUE "LegalCopyright", S_CRIGHT " LibreOffice contributors. All rights reserved.\0"
- }
- }
-
- block "VarFileInfo"
- {
- value "Translation", 0x0409, 1252
- }
- }
diff --git a/crashrep/source/win32/rctemplate.txt b/crashrep/source/win32/rctemplate.txt
deleted file mode 100644
index 9c713560a4aa..000000000000
--- a/crashrep/source/win32/rctemplate.txt
+++ /dev/null
@@ -1,209 +0,0 @@
-
-// This file is part of the LibreOffice project.
-
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// This file incorporates work covered by the following license notice:
-
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed
-// with this work for additional information regarding copyright
-// ownership. The ASF licenses this file to you under the Apache
-// License, Version 2.0 (the "License"); you may not use this file
-// except in compliance with the License. You may obtain a copy of
-// the License at http://www.apache.org/licenses/LICENSE-2.0 .
-
-
-#ifdef FONTSIZE
-#undef FONTSIZE
-#endif
-
-//#if ( %PLACEHOLDER% == LANG_KOREAN ) || ( %PLACEHOLDER% == LANG_CHINESE ) || ( %PLACEHOLDER% == LANG_JAPANESE )
-//#define FONTSIZE 9
-//#define LANG_CJK
-//#else
-//#define FONTSIZE 8
-//#endif
-
-#define FONTSIZE 9
-
-
-
-// Dialog
-
-
-IDD_WELCOME_PAGE DIALOGEX 0, 41, 327, 195
-STYLE DS_SETFONT | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 0, 0, 0x0
-#endif
-BEGIN
- CONTROL "",IDC_RICHEDIT21,"RICHEDIT20W",TCS_RAGGEDRIGHT | ES_READONLY |
- TCS_MULTISELECT | WS_VSCROLL,7,7,313,151
-END
-
-IDD_REPORT_PAGE DIALOGEX 0, 41, 327, 195
-STYLE DS_SETFONT | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 0, 0, 0x0
-#endif
-BEGIN
- LTEXT "1",IDC_REPORT_INTRO,7,7,313,48
- LTEXT "2",IDC_ENTER_TITLE,7,58,320,8
- EDITTEXT IDC_EDIT_TITLE,7,68,235,14,ES_AUTOHSCROLL
- LTEXT "3",IDC_ENTER_DESCRIPTION,7,86,320,8
- EDITTEXT IDC_EDIT_DESCRIPTION,7,97,235,49,ES_MULTILINE |
- ES_WANTRETURN | WS_VSCROLL
- CONTROL "4",IDC_ALLOW_CONTACT,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,7,148,303,10
- LTEXT "4a",IDC_LABEL_EMAIL,18,162,226,
- 8
- EDITTEXT IDC_EDIT_EMAIL,17,173,224,14,ES_AUTOHSCROLL
- PUSHBUTTON "5",IDC_SHOW_REPORT,249,97,74,14
- PUSHBUTTON "6",IDC_OPTIONS,249,115,74,14
- PUSHBUTTON "7",IDC_SAVE_REPORT,249,134,74,14
-END
-
-IDD_DIALOG_FRAME DIALOGEX 0, 0, 331, 265
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND |
- DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "1"
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 400, 0, 0x1
-#endif
-BEGIN
- LTEXT "",IDC_STATIC,0,0,331,40
- CONTROL "",IDC_HEADER,"RICHEDIT20W",TCS_VERTICAL | TCS_MULTISELECT | ES_READONLY,
- 7,7,316,33
- PUSHBUTTON "1",IDBACK,125,244,60,14
- PUSHBUTTON "2",IDNEXT,194,244,60,14
- PUSHBUTTON "3",IDFINISH,194,244,60,14
- PUSHBUTTON "4",IDCANCEL,263,244,60,14
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,40,331,1
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,237,331,1
-END
-
-IDD_PREVIEW_FRAME DIALOGEX 0, 0, 251, 185
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND |
- DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU |
- WS_SIZEBOX
-CAPTION "1"
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 400, 0, 0x1
-#endif
-BEGIN
- CONTROL "",IDC_EDIT_PREVIEW,"RICHEDIT20W",ES_MULTILINE |
- ES_AUTOVSCROLL | WS_VSCROLL | ES_AUTOHSCROLL | WS_HSCROLL |
- TCS_MULTISELECT | ES_READONLY | TCS_RAGGEDRIGHT |
- WS_BORDER
- ,
- 7,7,237,150
- DEFPUSHBUTTON "4",IDOK,193,164,50,14
-END
-
-
-IDD_OPTIONS_FRAME DIALOGEX 0, 0, 295, 182
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION |
- WS_SYSMENU
-CAPTION "1"
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 400, 0, 0x1
-#endif
-BEGIN
- GROUPBOX "1",IDC_PROXY_SETTINGS,7,7,222,92
- CONTROL "2",IDC_RADIO_SYSTEM,"Button",BS_AUTORADIOBUTTON,15,27,
- 208,10
- CONTROL "3",IDC_RADIO_DIRECT,"Button",BS_AUTORADIOBUTTON,15,39,
- 208,10
- CONTROL "4",IDC_RADIO_MANUAL,"Button",BS_AUTORADIOBUTTON,15,51,
- 208,10
- LTEXT "5",IDC_LABEL_PROXYSERVER,27,64,148,8
- EDITTEXT IDC_EDIT_PROXYSERVER,27,76,148,14,ES_AUTOHSCROLL
- LTEXT ":",IDC_STATIC,178,78,8,8
- LTEXT "6",IDC_LABEL_PROXYPORT,184,64,40,8
- EDITTEXT IDC_EDIT_PROXYPORT,184,76,40,14,ES_AUTOHSCROLL |
- ES_NUMBER
- DEFPUSHBUTTON "7",IDOK,238,7,50,14
- PUSHBUTTON "8",IDCANCEL,238,26,50,14
- CONTROL "",IDC_PROXY_DESCRIPTION,"RichEdit20W",ES_MULTILINE |
- ES_READONLY | WS_VSCROLL,7,106,281,69
-END
-
-IDD_SENDING_STATUS DIALOGEX 0, 0, 216, 73
-STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION |
- WS_SYSMENU
-CAPTION "1"
-#ifndef LANG_CJK
-FONT FONTSIZE, "MS Shell Dlg", 400, 0, 0x1
-#endif
-BEGIN
- PUSHBUTTON "2",IDCANCEL,159,52,50,14
- LTEXT "3",IDC_SENDING_REPORT_STATUS,7,7,202,34
-END
-
-
-
-// String Table
-
-
-STRINGTABLE
-BEGIN
- IDS_WELCOME_CAPTION %WELCOME_CAPTION%
- IDS_WELCOME_HEADER %WELCOME_HEADER%
- IDS_WELCOME_BODY1 %WELCOME_BODY1%
- IDS_WELCOME_BODY2 %WELCOME_BODY2%
- IDS_WELCOME_BODY3 %WELCOME_BODY3%
- IDS_PRIVACY_URL %PRIVACY_URL%
- IDS_NEXT_BUTTON %NEXT_BUTTON%
- IDS_CANCEL_BUTTON %CANCEL_BUTTON%
- IDS_OK_BUTTON %OK_BUTTON%
-END
-
-STRINGTABLE
-BEGIN
- IDS_REPORT_CAPTION %REPORT_CAPTION%
- IDS_REPORT_HEADER %REPORT_HEADER%
- IDS_REPORT_INTRO %REPORT_BODY%
- IDS_ENTER_TITLE %ENTER_TITLE%
- IDS_ALLOW_CONTACT %ALLOW_CONTACT%
- IDS_ENTER_DESCRIPTION %ENTER_DESCRIPTION%
- IDS_BACK_BUTTON %BACK_BUTTON%
- IDS_SEND_BUTTON %SEND_BUTTON%
- IDS_DONOT_SEND_BUTTON %DONOT_SEND_BUTTON%
- IDS_SHOW_REPORT_BUTTON %SHOW_REPORT_BUTTON%
- IDS_SAVE_REPORT_BUTTON %SAVE_REPORT_BUTTON%
- IDS_OPTIONS_BUTTON %OPTIONS_BUTTON%
- IDS_LABEL_EMAIL %ENTER_EMAIL%
-END
-
-STRINGTABLE
-BEGIN
- IDS_ERROR_MSG_SIMPLE_MAPI %ERROR_MSG_SIMPLE_MAPI%
- IDS_ERROR_MSG_DISK_FULL %ERROR_MSG_DISK_FULL%
- IDS_ERROR_MSG_PROXY %ERROR_MSG_PROXY%
- IDS_ERROR_MSG_NOCONNECT %ERROR_MSG_NOCONNECT%
- IDS_ERROR_MSG_NOEMAILADDRESS %ERROR_MSG_NOEMAILADDRESS%
- IDS_SENDING_REPORT_HEADER %SENDING_REPORT_HEADER%
- IDS_SENDING_REPORT_STATUS %SENDING_REPORT_STATUS%
- IDS_SENDING_REPORT_STATUS_FINISHED %SENDING_REPORT_STATUS_FINISHED%
- IDS_MSG_CMDLINE_USAGE %MSG_CMDLINE_USAGE%
- IDS_MSG_PARAM_PROCESSID %MSG_PARAM_PROCESSID%
- IDS_MSG_PARAM_PROCESSID_DESCRIPTION %MSG_PARAM_PROCESSID_DESCRIPTION%
- IDS_MSG_PARAM_HELP_DESCRIPTION %MSG_PARAM_HELP_DESCRIPTION%
-END
-
-STRINGTABLE
-BEGIN
- IDS_OPTIONS_CAPTION %OPTIONS_TITLE%
- IDS_PROXY_SETTINGS_HEADER %PROXY_SETTINGS_HEADER%
- IDS_PROXY_SYSTEM %PROXY_SETTINGS_SYSTEM%
- IDS_PROXY_DIRECT %PROXY_SETTINGS_DIRECT%
- IDS_PROXY_MANUAL %PROXY_SETTINGS_MANUAL%
- IDS_LABEL_PROXYSERVER %PROXY_SETTINGS_ADDRESS%
- IDS_LABEL_PROXYPORT %PROXY_SETTINGS_PORT%
- IDS_PROXY_DESCRIPTION %PROXY_SETTINGS_DESCRIPTION%
-END
diff --git a/crashrep/source/win32/resource.h b/crashrep/source/win32/resource.h
deleted file mode 100644
index 83e4e3fe80d8..000000000000
--- a/crashrep/source/win32/resource.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by soreport.rc
-
-#define IDD_DIALOG_FRAME 101
-#define IDS_WELCOME_CAPTION 102
-#define IDS_WELCOME_HEADER 103
-#define IDS_WELCOME_BODY1 104
-#define IDS_PRIVACY_URL 105
-#define IDS_NEXT_BUTTON 106
-#define IDD_WELCOME_PAGE 107
-#define IDS_CANCEL_BUTTON 107
-#define IDD_REPORT_PAGE 108
-#define IDS_REPORT_CAPTION 108
-#define IDS_REPORT_HEADER 109
-#define IDS_DESCRIPTION 110
-#define IDS_REPORT_INTRO 110
-#define IDS_ENTER_TITLE 111
-#define IDS_ALLOW_CONTACT 112
-#define IDS_ENTER_DESCRIPTION 113
-#define IDS_BACK_BUTTON 114
-#define IDS_SEND_BUTTON 115
-#define IDS_DONOT_SEND_BUTTON 116
-#define IDS_SHOW_REPORT_BUTTON 117
-#define IDS_SAVE_REPORT_BUTTON 118
-#define IDD_PREVIEW_FRAME 119
-#define IDS_ERROR_MSG_SIMPLE_MAPI 120
-#define IDS_ERROR_MSG_DISK_FULL 121
-#define IDS_OK_BUTTON 122
-#define IDS_OPTIONS_BUTTON 123
-#define IDS_LABEL_EMAIL 124
-#define IDD_OPTIONS_FRAME 125
-#define IDS_OPTIONS_CAPTION 126
-#define IDS_PROXY_SETTINGS_HEADER 127
-#define IDS_PROXY_SYSTEM 128
-#define IDS_PROXY_DIRECT 129
-#define IDS_PROXY_MANUAL 130
-#define IDS_LABEL_PROXYSERVER 131
-#define IDS_LABEL_PROXYPORT 132
-#define IDS_PROXY_DESCRIPTION 133
-#define IDS_ERROR_MSG_PROXY 134
-#define IDS_ERROR_MSG_NOCONNECT 135
-#define IDS_SENDING_REPORT_HEADER 136
-#define IDS_SENDING_REPORT_STATUS 137
-#define IDS_SENDING_REPORT_STATUS_FINISHED 138
-#define IDD_SENDING_STATUS 139
-#define IDS_WELCOME_BODY2 140
-#define IDS_WELCOME_BODY3 141
-#define IDS_ERROR_MSG_NOEMAILADDRESS 142
-#define IDS_MSG_CMDLINE_USAGE 143
-#define IDS_MSG_PARAM_PROCESSID 144
-#define IDS_MSG_PARAM_PROCESSID_DESCRIPTION 145
-#define IDS_MSG_PARAM_HELP_DESCRIPTION 146
-#define IDC_RICHEDIT_HEADER 1005
-#define IDC_RICHEDIT21 1006
-#define IDC_ALLOW_CONTACT 1007
-#define IDC_EDIT_TITLE 1008
-#define IDC_EDIT_DESCRIPTION 1009
-#define IDC_SHOW_REPORT 1010
-#define IDC_SAVE_REPORT 1011
-#define IDNEXT 1012
-#define IDBACK 1014
-#define IDC_REPORT_INTRO 1015
-#define IDC_ENTER_TITLE 1016
-#define IDFINISH 1016
-#define IDC_ENTER_DESCRIPTION 1017
-#define IDC_EDIT3 1018
-#define IDC_HEADER 1019
-#define IDC_STATICBK 1020
-#define IDC_EDIT_PREVIEW 1021
-#define IDC_EDIT_EMAIL 1022
-#define IDC_OPTIONS 1023
-#define IDC_PROXY_SETTINGS 1024
-#define IDC_RADIO_SYSTEM 1025
-#define IDC_RADIO_DIRECT 1026
-#define IDC_RADIO_MANUAL 1027
-#define IDC_LABEL_PROXYSERVER 1028
-#define IDC_LABEL_PROXYPORT 1029
-#define IDC_EDIT_PROXYSERVER 1030
-#define IDC_EDIT_PROXYPORT 1031
-#define IDC_LABEL_EMAIL 1032
-#define IDC_PROXY_DESCRIPTION 1033
-#define IDC_SENDING_REPORT_STATUS 1034
-// Next default values for new objects
-
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 147
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1035
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/crashrep/source/win32/soreport.cxx b/crashrep/source/win32/soreport.cxx
deleted file mode 100644
index ee8b7d006a8f..000000000000
--- a/crashrep/source/win32/soreport.cxx
+++ /dev/null
@@ -1,2875 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <config_folders.h>
-
-#define UNICODE
-#define WIN32_LEAN_AND_MEAN
-#if defined _MSC_VER
-#pragma warning(push, 1)
-#pragma warning(disable:4917)
-#endif
-#include <windows.h>
-#include <windowsx.h>
-
-#include <mapi.h>
-#include <commctrl.h>
-#include <commdlg.h>
-#include <psapi.h>
-
-#include <shellapi.h>
-#include <shlobj.h>
-
-#define _UNICODE
-#include <tchar.h>
-
-#define _RICHEDIT_VER 0x0200
-#include <richedit.h>
-
-#if defined _MSC_VER
-#pragma warning(pop)
-#endif
-
-#if _RICHEDIT_VER >= 0x0200
-#define RICHEDIT TEXT("riched20.dll")
-#else
-#define RICHEDIT TEXT("riched32.dll")
-#endif
-
-#include <systools/win32/uwinapi.h>
-#include <rtl/digest.h>
-#include <rtl/bootstrap.hxx>
-#include <osl/file.hxx>
-#include <osl/process.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <io.h>
-#include <fcntl.h>
-#include <string>
-#include <boost/unordered_map.hpp>
-#include <winsock.h>
-#include <malloc.h>
-#include <process.h>
-
-#include "resource.h"
-#include "base64.h"
-
-#define FORMATBUFSIZE (8*1024)
-#define MAX_TEXT_BUFFER (32*1024-1)
-#define MAX_HOSTNAME (1024)
-
-#ifdef __MINGW32__
-#include <imagehlp.h>
-#else
-#include <dbghelp.h>
-#endif
-
-#ifdef _UNICODE
-#define tstring wstring
-#else
-#define tstring string
-#endif
-
-using namespace ::std;
-
-
-wstring g_wstrProductKey;
-string g_strDefaultLanguage;
-FILE *g_fpStackFile = NULL;
-FILE *g_fpChecksumFile = NULL;
-DWORD g_dwExceptionCode = 0;
-
-CHAR g_szReportServerA[MAX_HOSTNAME] = "";
-USHORT g_uReportPort = 80;
-
-TCHAR g_szBuildId[256] = TEXT("");
-
-TCHAR g_szDumpFileName[MAX_PATH] = TEXT("");
-
-CHAR g_szDumpFileNameA[MAX_PATH] = "";
-CHAR g_szCommentFileNameA[MAX_PATH] = "";
-CHAR g_szReportFileNameA[MAX_PATH] = "";
-
-
-bool g_bNoUserInterface = false;
-bool g_bSendReport = false;
-bool g_bLoadReport = false;
-
-#define REPORT_SERVER g_szReportServerA
-#define REPORT_PORT g_uReportPort
-
-
-
-// tmpfile from msvcrt creates the temporary file in the root of the current
-// volume and can fail.
-
-static FILE *_xfopen( const _TCHAR *file, const _TCHAR *mode )
-{
- return _tfopen( file, mode );
-}
-
-
-static FILE *_tmpfile(void)
-{
- FILE *fp = NULL;
-
- TCHAR szTempPath[MAX_PATH];
-
- if ( GetTempPath( SAL_N_ELEMENTS(szTempPath), szTempPath ) )
- {
- TCHAR szFileName[MAX_PATH];
-
- if ( GetTempFileName( szTempPath, TEXT("CRT"), 0, szFileName ) )
- {
- HANDLE hFile = CreateFile(
- szFileName,
- GENERIC_READ | GENERIC_WRITE,
- 0, NULL,
- OPEN_EXISTING,
- FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_NORMAL,
- NULL );
-
- if ( IsValidHandle( hFile ) )
- {
- int fd = _open_osfhandle( (int)hFile, 0 );
-
- fp = _fdopen( fd, "w+b" );
- }
- }
- }
-
- return fp;
-}
-
-
-static BOOL GetCrashDataPath( LPTSTR szBuffer )
-{
- OUString ustrValue("${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/bootstrap.ini:UserInstallation}");
- ::rtl::Bootstrap::expandMacros( ustrValue );
-
- if ( !ustrValue.isEmpty() )
- {
- ustrValue += "/user/crashdata";
-
- ::osl::FileBase::RC result = ::osl::Directory::createPath( ustrValue );
-
- if ( ::osl::FileBase::E_None == result || ::osl::FileBase::E_EXIST == result )
- {
- OUString ustrPath;
-
- result = ::osl::FileBase::getSystemPathFromFileURL( ustrValue, ustrPath );
- if ( ::osl::FileBase::E_None == result )
- {
- _tcsncpy( szBuffer, reinterpret_cast<LPCWSTR>(ustrPath.getStr()), MAX_PATH );
- return TRUE;
- }
- }
- }
-
- return FALSE;
-}
-
-
-static FILE *_open_reportfile( LPCTSTR lpExt, LPCTSTR lpMode )
-{
- FILE *fp = NULL;
- TCHAR szAppDataPath[MAX_PATH] = _T("");
-
- if ( GetCrashDataPath( szAppDataPath ) )
- {
- _tcscat( szAppDataPath, _T("\\crashdat") );
- _tcscat( szAppDataPath, lpExt );
-
- fp = _xfopen( szAppDataPath, lpMode );
- }
-
- return fp;
-}
-
-
-
-struct CrashReportParams
-{
- BOOL fAllowContact;
- tstring sEmail;
- tstring sTitle;
- tstring sComment;
- ULONG uInternetConnection;
- tstring sProxyServer;
- tstring sProxyPort;
-
- CrashReportParams();
-
- void WriteToRegistry();
- void ReadFromRegistry();
- void ReadFromEnvironment();
-};
-
-bool SendCrashReport( HWND hwndParent, const CrashReportParams &rParams );
-BOOL WriteCommentFile( LPCTSTR lpComment );
-
-
-
-LONG RegReadValue( HKEY hBaseKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPVOID lpData, DWORD cbData )
-{
- HKEY hKey = NULL;
- LONG lResult;
-
- lResult = RegOpenKeyEx( hBaseKey, lpSubKey, 0, KEY_QUERY_VALUE, &hKey );
-
- if ( ERROR_SUCCESS == lResult )
- {
- lResult = RegQueryValueEx( hKey, lpValueName, NULL, NULL, (LPBYTE)lpData, &cbData );
- RegCloseKey( hKey );
- }
-
- return lResult;
-}
-
-
-
-LONG RegWriteValue( HKEY hBaseKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, DWORD dwType, LPCVOID lpData, DWORD cbData )
-{
- HKEY hKey = NULL;
- LONG lResult;
-
- lResult = RegCreateKeyEx( hBaseKey, lpSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL );
-
- if ( ERROR_SUCCESS == lResult )
- {
- lResult = RegSetValueEx( hKey, lpValueName, NULL, dwType, (CONST BYTE *)lpData, cbData );
- RegCloseKey( hKey );
- }
-
- return lResult;
-}
-
-
-
-CrashReportParams::CrashReportParams()
-{
- fAllowContact = FALSE;
- sTitle = TEXT("");
- sComment = TEXT("");
- sEmail = TEXT("");
- uInternetConnection = 0;
- sProxyServer = TEXT("");
- sProxyPort = TEXT("");
-}
-
-
-
-void CrashReportParams::ReadFromRegistry()
-{
- TCHAR szBuffer[2048];
-
- if ( ERROR_SUCCESS == RegReadValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPProxyServer"),
- szBuffer,
- sizeof(szBuffer) ) )
- sProxyServer = szBuffer;
-
- DWORD dwProxyPort;
-
- if ( ERROR_SUCCESS == RegReadValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPProxyPort"),
- &dwProxyPort,
- sizeof(dwProxyPort) ) )
- {
- _stprintf( szBuffer, TEXT("%d"), dwProxyPort );
- sProxyPort = szBuffer;
- }
-
- if ( ERROR_SUCCESS == RegReadValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("ReturnAddress"),
- szBuffer,
- sizeof(szBuffer) ) )
- sEmail = szBuffer;
-
- RegReadValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("AllowContact"),
- &fAllowContact,
- sizeof(fAllowContact) );
-
- RegReadValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPConnection"),
- &uInternetConnection,
- sizeof(uInternetConnection) );
-}
-
-
-
-void CrashReportParams::WriteToRegistry()
-{
- RegWriteValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPProxyServer"), REG_SZ,
- sProxyServer.c_str(),
- sizeof(TCHAR) * (sProxyServer.length() + 1) );
-
- LPTSTR endptr = NULL;
- DWORD dwProxyPort = _tcstoul( sProxyPort.c_str(), &endptr, 10 );
-
- RegWriteValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPProxyPort"), REG_DWORD,
- &dwProxyPort,
- sizeof(DWORD) );
-
- RegWriteValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("AllowContact"), REG_DWORD,
- &fAllowContact,
- sizeof(DWORD) );
-
-
- RegWriteValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("HTTPConnection"), REG_DWORD,
- &uInternetConnection,
- sizeof(DWORD) );
-
- RegWriteValue(
- HKEY_CURRENT_USER,
- TEXT("SOFTWARE\\LibreOffice\\CrashReport"),
- TEXT("ReturnAddress"), REG_SZ,
- sEmail.c_str(),
- sizeof(TCHAR) * (sEmail.length() + 1) );
-}
-
-
-
-void CrashReportParams::ReadFromEnvironment()
-{
- TCHAR szBuffer[2048];
-
- DWORD dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_HTTPPROXYSERVER"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- sProxyServer = szBuffer;
-
- dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_HTTPPROXYPORT"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- sProxyPort = szBuffer;
-
- dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_RETURNADDRESS"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- {
- sEmail = szBuffer;
- // fAllowContact = TRUE;
- }
-
- dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_HTTPCONNECTIONTYPE"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- {
- if ( 0 == _tcsicmp( szBuffer, _T("DIRECT") ) )
- uInternetConnection = 1;
- else if ( 0 == _tcsicmp( szBuffer, _T("MANUALPROXY") ) )
- uInternetConnection = 2;
- else if ( 0 == _tcsicmp( szBuffer, _T("SYSTEMDEFAULT") ) )
- uInternetConnection = 0;
- }
-
- dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_SUBJECT"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- sTitle = szBuffer;
-
-
- dwResult = GetEnvironmentVariable( TEXT("ERRORREPORT_BODYFILE"), szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- if ( dwResult && dwResult < SAL_N_ELEMENTS(szBuffer) )
- {
- FILE *fp = _xfopen( szBuffer, _T("rb") );
-
- if ( fp )
- {
- CHAR aUTF8Buffer[256];
- size_t nBytesRead;
-
- sComment = TEXT("");
-
- while ( 0 != (nBytesRead = fread( aUTF8Buffer, sizeof(aUTF8Buffer[0]), SAL_N_ELEMENTS(aUTF8Buffer), fp )) )
- {
- TCHAR aBuffer[256+1];
-
- DWORD dwCharacters = MultiByteToWideChar( CP_UTF8, 0, aUTF8Buffer, nBytesRead, aBuffer, SAL_N_ELEMENTS(aBuffer) - 1 );
- aBuffer[dwCharacters] = 0;
- sComment += aBuffer;
- }
-
- fclose( fp );
- }
- }
-}
-
-
-
-typedef BOOL (WINAPI *MiniDumpWriteDump_PROC)(
- IN HANDLE hProcess,
- IN DWORD ProcessId,
- IN HANDLE hFile,
- IN MINIDUMP_TYPE DumpType,
- IN CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, OPTIONAL
- IN CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, OPTIONAL
- IN CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam OPTIONAL
- );
-
-
-
-static BOOL WINAPI InitRichEdit()
-{
- return (NULL != LoadLibrary( RICHEDIT ));
-}
-
-
-
-static BOOL WINAPI DeinitRichEdit()
-{
- return FreeLibrary( GetModuleHandle( RICHEDIT ) );
-}
-
-
-
-static string trim_string( const string& rString )
-{
- string temp = rString;
-
- while ( temp.length() && temp[0] == ' ' || temp[0] == '\t' )
- temp.erase( 0, 1 );
-
- string::size_type len = temp.length();
-
- while ( len && temp[len-1] == ' ' || temp[len-1] == '\t' )
- {
- temp.erase( len - 1, 1 );
- len = temp.length();
- }
-
- return temp;
-}
-
-
-
-static int LoadAndFormatString( HINSTANCE hInstance, UINT uID, LPTSTR lpBuffer, int nBufferMax )
-{
- TCHAR szBuffer[FORMATBUFSIZE];
- TCHAR szBuffer2[FORMATBUFSIZE];
-
- LoadString( hInstance, uID, szBuffer, SAL_N_ELEMENTS(szBuffer) );
-
- LPCTSTR src;
- LPTSTR dest;
- for ( dest = szBuffer2, src = szBuffer; *src; src++, dest++ )
- {
- switch ( *src )
- {
- case '~':
- *dest = '&';
- break;
- case '\\':
- switch ( *(++src) )
- {
- case 'n':
- *dest = '\n';
- break;
- case 'r':
- *dest = '\r';
- break;
- default:
- *dest = *src;
- break;
- }
- break;
- default:
- *dest = *src;
- break;
- }
- }
- *dest = *src;
- return ExpandEnvironmentStrings( szBuffer2, lpBuffer, nBufferMax );
-}
-
-
-
-
-static string wstring2utf8( const wstring &rString )
-{
- int nBufSize = WideCharToMultiByte( CP_UTF8, 0, rString.c_str(), -1, NULL, 0, NULL, FALSE );
-
- LPSTR pBuffer = (LPSTR)alloca( nBufSize );
-
- WideCharToMultiByte( CP_UTF8, 0, rString.c_str(), -1, pBuffer, nBufSize, NULL, FALSE );
-
- return string( pBuffer );
-}
-
-
-
-static string xml_encode( const string &rString )
-{
- string temp = rString;
- string::size_type pos = 0;
-
- // First replace all occurrences of '&' because it may occur in further
- // encoded chardters too
-
- for( pos = 0; (pos = temp.find( '&', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&amp;" );
-
- for( pos = 0; (pos = temp.find( '<', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&lt;" );
-
- for( pos = 0; (pos = temp.find( '>', pos )) != string::npos; pos += 4 )
- temp.replace( pos, 1, "&gt;" );
-
- return temp;
-}
-
-
-
-static size_t fcopy( FILE *fpin, FILE *fpout )
-{
- size_t nBytesWritten = 0;
-
- if ( fpin && fpout )
- {
- char buffer[1024];
- size_t nBytes;
- while ( 0 != (nBytes = fread( buffer, 1, sizeof(buffer), fpin )) )
- {
- nBytesWritten += fwrite( buffer, 1, nBytes, fpout );
- }
- }
-
- return nBytesWritten;
-}
-
-
-
-static string GetModuleDirectory( HMODULE hModule )
-{
- TCHAR szModuleName[MAX_PATH] = TEXT("");
- TCHAR szDrive[_MAX_DRIVE];
- TCHAR szDir[_MAX_DIR];
- TCHAR szFName[_MAX_FNAME];
- TCHAR szExt[_MAX_EXT];
-
- if ( GetModuleFileName( hModule, szModuleName, MAX_PATH ) )
- {
- _tsplitpath( szModuleName, szDrive, szDir, szFName, szExt );
- _tmakepath( szModuleName, szDrive, szDir, _T(""), _T("") );
- }
-
- CHAR szModuleNameUTF8[MAX_PATH] = "";
-
- WideCharToMultiByte( CP_UTF8, 0, szModuleName, -1, szModuleNameUTF8, SAL_N_ELEMENTS(szModuleNameUTF8), NULL, NULL );
- return string( szModuleNameUTF8 );
-}
-
-
-
-string GetFileDirectory( const string& rFilePath )
-{
- string aDir = rFilePath;
- size_t pos = aDir.rfind( '\\' );
-
- if ( string::npos != pos )
- aDir.erase( pos + 1 );
- else
- aDir = "";
-
- return aDir;
-}
-
-
-
-string GetFileName( const string& rFilePath )
-{
- string aName = rFilePath;
- size_t pos = aName.rfind( '\\' );
-
- if ( string::npos != pos )
- return aName.substr( pos + 1 );
- else
- return aName;
-}
-
-
-
-BOOL WriteReportFile( CrashReportParams *pParams )
-{
- BOOL fSuccess = FALSE;
- TCHAR szTempPath[MAX_PATH];
-
- if ( GetTempPath( SAL_N_ELEMENTS(szTempPath), szTempPath ) )
- {
- TCHAR szFileName[MAX_PATH];
-
- if ( GetTempFileName( szTempPath, TEXT("RPM"), 0, szFileName ) )
- {
- HANDLE hFile = CreateFile( szFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
-
- if ( hFile )
- {
- int fd = _open_osfhandle( (LONG)hFile, _O_TEXT );
- FILE *fp = _fdopen( fd, "w+t" );
- CHAR szTitle[1024] = "";
- CHAR szBuildId[1024] = "";
- CHAR szEmail[1024] = "";
- const char *pszUserType = getenv( "STAROFFICE_USERTYPE" );
-
- WideCharToMultiByte( CP_UTF8, 0, pParams->sTitle.c_str(), -1, szTitle, sizeof(szTitle), NULL, NULL );
- WideCharToMultiByte( CP_UTF8, 0, g_szBuildId, -1, szBuildId, sizeof(szBuildId), NULL, NULL );
- WideCharToMultiByte( CP_UTF8, 0, pParams->sEmail.c_str(), -1, szEmail, sizeof(szEmail), NULL, NULL );
-
- fprintf( fp,
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE errormail:errormail PUBLIC \"-//OpenOffice.org//DTD ErrorMail 1.0//EN\" \"errormail.dtd\">\n"
- "<errormail:errormail xmlns:errormail=\"http://openoffice.org/2002/errormail\" usertype=\"%s\">\n"
- "<reportmail:mail xmlns:reportmail=\"http://openoffice.org/2002/reportmail\" version=\"1.1\" feedback=\"%s\" email=\"%s\">\n",
- pszUserType ? pszUserType : "",
- pParams->fAllowContact ? "true" : "false",
- pParams->fAllowContact ? xml_encode(szEmail).c_str() : ""
- );
-
- fprintf( fp,
- "<reportmail:title>%s</reportmail:title>\n",
- xml_encode(szTitle).c_str() );
-
- fprintf( fp,
- "<reportmail:attachment name=\"description.txt\" media-type=\"text/plain;charset=UTF-8\" class=\"UserComment\"/>\n"
- "<reportmail:attachment name=\"user.dmp\" media-type=\"application/octet-stream\" class=\"UserDump\"/>\n"
- "</reportmail:mail>\n"
-
- "<officeinfo:officeinfo xmlns:officeinfo=\"http://openoffice.org/2002/officeinfo\" build=\"%s\" platform=\"%s\" language=\"%s\" procpath=\"%s\" exceptiontype=\"0x%08X\" product=\"%s\"/>\n",
- szBuildId,
- _INPATH,
- xml_encode(g_strDefaultLanguage).c_str(),
- xml_encode(GetModuleDirectory( NULL )).c_str(),
- g_dwExceptionCode,
- xml_encode(wstring2utf8(g_wstrProductKey)).c_str()
- );
-
- OSVERSIONINFO VersionInfo;
-
- ZeroMemory( &VersionInfo, sizeof(VersionInfo) );
- VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo );
-
- GetVersionEx( &VersionInfo );
-
- fprintf( fp,
- "<systeminfo:systeminfo xmlns:systeminfo=\"http://openoffice.org/2002/systeminfo\">\n"
- "<systeminfo:System name=\"%s\" version=\"%d.%d\" build=\"%d\" locale=\"0x%08x\"/>\n"
- ,
- VER_PLATFORM_WIN32_NT == VersionInfo.dwPlatformId ? "Windows NT" : "Windows",
- VersionInfo.dwMajorVersion, VersionInfo.dwMinorVersion,
- VersionInfo.dwBuildNumber,
- GetUserDefaultLangID()
-
- );
- fprintf( fp, "<systeminfo:CPU type=\"x86\"/>\n" );
- fprintf( fp, "</systeminfo:systeminfo>\n" );
-
- fseek( g_fpStackFile, 0, SEEK_SET );
- fcopy( g_fpStackFile, fp );
-
- fseek( g_fpChecksumFile, 0, SEEK_SET );
- fcopy( g_fpChecksumFile, fp );
-
- fprintf( fp, "</errormail:errormail>\n" );
-
- fclose( fp );
-
- fSuccess = TRUE;
-
- WideCharToMultiByte( CP_ACP, 0, szFileName, -1, g_szReportFileNameA, MAX_PATH, NULL, NULL );
- }
-
- if ( !fSuccess )
- DeleteFile( szFileName );
- }
- }
-
- return fSuccess;
-}
-
-
-
-static BOOL SaveDumpFile( HWND hwndOwner )
-{
- OPENFILENAME ofn;
- TCHAR szFileName[MAX_PATH] = TEXT("");
-
- ZeroMemory( &ofn, sizeof(ofn) );
- ofn.lStructSize = sizeof(ofn);
-
- ofn.hwndOwner = hwndOwner;
- ofn.lpstrFilter = TEXT("*.dmp\0*.dmp\0*.*\0*.*\0");
- ofn.lpstrFile = szFileName;
- ofn.nMaxFile = MAX_PATH;
- ofn.Flags = OFN_ENABLESIZING | OFN_LONGNAMES | OFN_OVERWRITEPROMPT;
- ofn.lpstrDefExt = TEXT("dmp");
-
- if ( GetSaveFileName( &ofn ) )
- {
- return CopyFile( g_szDumpFileName, szFileName, FALSE );
- }
- return FALSE;
-}
-
-
-
-static BOOL ScreenToClientRect( HWND hwnd, LPRECT lprc )
-{
- return ScreenToClient( hwnd, (LPPOINT)&lprc->left ) && ScreenToClient( hwnd, (LPPOINT)&lprc->right );
-}
-
-static BOOL SetWindowRect( HWND hwnd, const RECT *lprc, BOOL fRepaint )
-{
- return MoveWindow( hwnd, lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, fRepaint );
-}
-
-#define GM_LOX 0x01
-#define GM_HIX 0x02
-#define GM_LOY 0x04
-#define GM_HIY 0x08
-
-static BOOL SetGrowMode( HWND hwnd, DWORD dwGrowMode )
-{
- return SetProp( hwnd, TEXT("GrowMode"), (HANDLE)dwGrowMode );
-}
-
-static DWORD GetGrowMode( HWND hwnd )
-{
- return (DWORD)GetProp( hwnd, TEXT("GrowMode") );
-}
-
-static BOOL GrowWindow( HWND hwnd, LONG dxClient, LONG dyClient, BOOL fRepaint )
-{
- DWORD dwGrowMode = GetGrowMode( hwnd );
- RECT rc;
-
- GetWindowRect( hwnd, &rc );
-
- if ( dwGrowMode & GM_LOX )
- rc.left += dxClient;
- if ( dwGrowMode & GM_HIX )
- rc.right += dxClient;
- if ( dwGrowMode & GM_LOY )
- rc.top += dyClient;
- if ( dwGrowMode & GM_HIY )
- rc.bottom += dyClient;
-
- ScreenToClientRect( GetParent( hwnd ), &rc );
- SetWindowRect( hwnd, &rc, fRepaint );
-
- return TRUE;
-}
-
-BOOL CALLBACK GrowChildWindows(
- HWND hwnd, // handle to child window
- LPARAM lParam // application-defined value
-)
-{
- LONG cx = (SHORT)LOWORD( lParam );
- LONG cy = (SHORT)HIWORD( lParam );
-
- GrowWindow( hwnd, cx, cy, TRUE );
-
- return TRUE;
-}
-
-BOOL CALLBACK PreviewDialogProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
- )
-{
- static RECT rcClient;
-
- switch ( uMsg )
- {
- case WM_SIZE:
- {
- LONG cx = LOWORD( lParam );
- LONG cy = HIWORD( lParam );
- LONG dxClient, dyClient;
-
- dxClient = cx - rcClient.right;
- dyClient = cy - rcClient.bottom;
-
- EnumChildWindows( hwndDlg, GrowChildWindows, MAKELONG( (SHORT)dxClient, (SHORT)dyClient) );
-
- GetClientRect( hwndDlg, &rcClient );
- }
- break;
- case WM_INITDIALOG:
- {
- GetClientRect( hwndDlg, &rcClient );
- SetGrowMode( GetDlgItem(hwndDlg, IDC_EDIT_PREVIEW), GM_HIX | GM_HIY );
- SetGrowMode( GetDlgItem(hwndDlg, IDOK), GM_LOX | GM_HIX | GM_LOY | GM_HIY );
-
- CrashReportParams *pParams = (CrashReportParams *)lParam;
-
- TCHAR szBuffer[256] = TEXT("");
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong( hwndDlg, GWL_HINSTANCE );
- HWND hwndParent = (HWND)GetWindowLong( hwndDlg, GWL_HWNDPARENT );
-
- GetWindowText( hwndParent, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( hwndDlg, szBuffer );
-
- LoadAndFormatString( hInstance, IDS_OK_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDOK), szBuffer );
-
- basic_string<TCHAR> aString;
-
- aString.append( pParams->sTitle );
- aString.append( _T("\r\n\r\n") );
- aString.append( pParams->sComment );
- aString.append( _T("\r\n---------- report ----------\r\n") );
-
- FILE *fp = fopen( g_szReportFileNameA, "r" );
-
- if ( fp )
- {
- char buf[1024];
-
- while ( fgets( buf, SAL_N_ELEMENTS(buf), fp ) != NULL )
- {
- WCHAR bufW[1024];
-
- MultiByteToWideChar( CP_UTF8, 0, buf, -1, bufW, SAL_N_ELEMENTS(bufW) );
-
- aString.append( bufW );
- }
-
- fclose( fp );
- }
-
- aString.append( _T("\r\n---------- stack ----------\r\n") );
-
- fp = fopen( g_szDumpFileNameA, "rb" );
-
- if ( fp )
- {
- unsigned char buf[16];
- int count;
-
- do
- {
- int i;
-
- count = fread( buf, sizeof(buf[0]), SAL_N_ELEMENTS(buf), fp );
-
- for ( i = 0; i < count; i++ )
- {
- TCHAR output[16];
-
- _sntprintf( output, SAL_N_ELEMENTS(output), _T("%02X\x20"), buf[i] );
- aString.append( output );
- }
- for ( ; i < SAL_N_ELEMENTS(buf); i++ )
- {
- aString.append( _T("\x20\x20\x20") );
- }
-
- for ( i = 0; i < count; i++ )
- {
- TCHAR output[2];
-
- if ( (int)buf[i] >= 0x20 && (int)buf[i] <= 0x7F )
- output[0] = (TCHAR)buf[i];
- else
- output[0] = '.';
- output[1] = 0;
- aString.append( output );
- }
-
- aString.append( _T("\r\n") );
-
- } while ( count );
-
- fclose( fp );
- }
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_PREVIEW), aString.c_str() );
- SetWindowFont( GetDlgItem(hwndDlg, IDC_EDIT_PREVIEW), GetStockObject( SYSTEM_FIXED_FONT ), TRUE );
- }
- return TRUE;
- case WM_COMMAND:
- switch ( LOWORD(wParam) )
- {
- case IDOK:
- case IDCANCEL:
- EndDialog( hwndDlg, wParam );
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-static void PreviewReport( HWND hwndParent, CrashReportParams *pParams )
-{
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndParent, GWL_HINSTANCE );
-
- WriteReportFile( pParams );
-
- DialogBoxParam(
- hInstance,
- MAKEINTRESOURCE(IDD_PREVIEW_FRAME),
- hwndParent,
- PreviewDialogProc,
- (LPARAM)pParams
- );
-
- DeleteFileA( g_szReportFileNameA );
-}
-
-void UpdateOptionsDialogControls( HWND hwndDlg )
-{
- if ( Button_GetCheck( GetDlgItem(hwndDlg, IDC_RADIO_MANUAL) ) & BST_CHECKED )
- {
- EnableWindow( GetDlgItem(hwndDlg, IDC_EDIT_PROXYSERVER), TRUE );
- EnableWindow( GetDlgItem(hwndDlg, IDC_EDIT_PROXYPORT), TRUE );
- }
- else
- {
- EnableWindow( GetDlgItem(hwndDlg, IDC_EDIT_PROXYSERVER), FALSE );
- EnableWindow( GetDlgItem(hwndDlg, IDC_EDIT_PROXYPORT), FALSE );
- }
-}
-
-
-
-BOOL CALLBACK OptionsDialogProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
- )
-{
- static CrashReportParams *pParams;
-
- switch ( uMsg )
- {
- case WM_INITDIALOG:
- {
- TCHAR szBuffer[1024] = TEXT("");
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong( hwndDlg, GWL_HINSTANCE );
- //HWND hwndParent = (HWND)GetWindowLong( hwndDlg, GWL_HWNDPARENT );
-
- pParams = (CrashReportParams *)lParam;
-
- LoadAndFormatString( hInstance, IDS_OPTIONS_CAPTION, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( hwndDlg, szBuffer );
-
- LoadAndFormatString( hInstance, IDS_PROXY_SETTINGS_HEADER, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_PROXY_SETTINGS), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_PROXY_SYSTEM, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_RADIO_SYSTEM), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_PROXY_DIRECT, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_RADIO_DIRECT), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_PROXY_MANUAL, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_RADIO_MANUAL), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_LABEL_PROXYSERVER, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_LABEL_PROXYSERVER), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_LABEL_PROXYPORT, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_LABEL_PROXYPORT), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_OK_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDOK), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_CANCEL_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDCANCEL), szBuffer );
-
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_PROXYSERVER), pParams->sProxyServer.c_str() );
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_PROXYPORT), pParams->sProxyPort.c_str() );
-
- Button_SetCheck( GetDlgItem(hwndDlg, IDC_RADIO_SYSTEM + pParams->uInternetConnection), BST_CHECKED );
-
- SendMessage(
- GetDlgItem(hwndDlg, IDC_PROXY_DESCRIPTION),
- EM_SETBKGNDCOLOR,
- (WPARAM)FALSE,
- GetSysColor( COLOR_3DFACE ) );
- LoadAndFormatString( hInstance, IDS_PROXY_DESCRIPTION, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Edit_SetText( GetDlgItem(hwndDlg, IDC_PROXY_DESCRIPTION), szBuffer );
-
- UpdateOptionsDialogControls( hwndDlg );
- }
- return TRUE;
- case WM_COMMAND:
- switch ( LOWORD(wParam) )
- {
- case IDC_RADIO_SYSTEM:
- case IDC_RADIO_DIRECT:
- case IDC_RADIO_MANUAL:
- if ( BN_CLICKED == HIWORD(wParam) )
- UpdateOptionsDialogControls( hwndDlg );
- break;
- case IDOK:
- {
- TCHAR szBuffer[1024];
-
- Edit_GetText( GetDlgItem(hwndDlg, IDC_EDIT_PROXYSERVER), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sProxyServer = szBuffer;
-
- Edit_GetText( GetDlgItem(hwndDlg, IDC_EDIT_PROXYPORT), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sProxyPort = szBuffer;
-
- if ( Button_GetCheck( GetDlgItem(hwndDlg, IDC_RADIO_DIRECT) ) & BST_CHECKED )
- pParams->uInternetConnection = 1;
- else if ( Button_GetCheck( GetDlgItem(hwndDlg, IDC_RADIO_MANUAL) ) & BST_CHECKED )
- pParams->uInternetConnection = 2;
- else
- pParams->uInternetConnection = 0;
- }
- case IDCANCEL:
- EndDialog( hwndDlg, wParam );
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-
-static void OptionsDialog( HWND hwndParent, CrashReportParams *pParams )
-{
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndParent, GWL_HINSTANCE );
-
- if ( IDOK == DialogBoxParam(
- hInstance,
- MAKEINTRESOURCE(IDD_OPTIONS_FRAME),
- hwndParent,
- OptionsDialogProc,
- (LPARAM)pParams
- ) )
- pParams->WriteToRegistry();
-
-}
-
-
-void UpdateReportDialogControls( HWND hwndDlg )
-{
- EnableWindow(
- GetDlgItem(hwndDlg, IDC_EDIT_EMAIL),
- Button_GetCheck(GetDlgItem(hwndDlg, IDC_ALLOW_CONTACT)) & BST_CHECKED ? TRUE : FALSE );
- EnableWindow(
- GetDlgItem(hwndDlg, IDC_LABEL_EMAIL),
- Button_GetCheck(GetDlgItem(hwndDlg, IDC_ALLOW_CONTACT)) & BST_CHECKED ? TRUE : FALSE );
-}
-
-
-
-BOOL CALLBACK ReportDialogProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM
- )
-{
- switch ( uMsg )
- {
- case WM_INITDIALOG:
- {
- CrashReportParams *pParams = (CrashReportParams*)GetWindowLong( GetParent(hwndDlg), GWL_USERDATA );
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndDlg, GWL_HINSTANCE );
- TCHAR szBuffer[FORMATBUFSIZE];
-
- LoadAndFormatString( hInstance, IDS_REPORT_INTRO, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_REPORT_INTRO), szBuffer );
-
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT3), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_ENTER_TITLE, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_ENTER_TITLE), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_ENTER_DESCRIPTION, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_ENTER_DESCRIPTION), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_SHOW_REPORT_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_SHOW_REPORT), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_SAVE_REPORT_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_SAVE_REPORT), szBuffer );
-
- const char *pszUserType = getenv( "STAROFFICE_USERTYPE" );
- if ( pszUserType )
- ShowWindow( GetDlgItem(hwndDlg, IDC_SAVE_REPORT), SW_SHOW );
- else
- ShowWindow( GetDlgItem(hwndDlg, IDC_SAVE_REPORT), SW_HIDE );
-
- LoadAndFormatString( hInstance, IDS_OPTIONS_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_OPTIONS), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_ALLOW_CONTACT, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_ALLOW_CONTACT), szBuffer );
- Button_SetCheck( GetDlgItem(hwndDlg, IDC_ALLOW_CONTACT), pParams->fAllowContact ? BST_CHECKED : BST_UNCHECKED );
-
- LoadAndFormatString( hInstance, IDS_LABEL_EMAIL, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDC_LABEL_EMAIL), szBuffer );
-
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_EMAIL), pParams->sEmail.c_str() );
-
- UpdateReportDialogControls( hwndDlg );
- }
- return TRUE;
- case WM_SHOWWINDOW:
- if ( (BOOL)wParam )
- {
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndDlg, GWL_HINSTANCE );
- CrashReportParams *pParams = (CrashReportParams*)GetWindowLong( GetParent(hwndDlg), GWL_USERDATA );
- TCHAR szBuffer[FORMATBUFSIZE];
-
- LoadAndFormatString( hInstance, IDS_REPORT_CAPTION, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( GetParent(hwndDlg), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_REPORT_HEADER, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( GetDlgItem(GetParent(hwndDlg), IDC_HEADER), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_DONOT_SEND_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(GetParent(hwndDlg), IDCANCEL), szBuffer );
-
-
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDBACK), TRUE );
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDFINISH), TRUE );
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDNEXT), FALSE );
-
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_TITLE), pParams->sTitle.c_str() );
- Edit_SetText( GetDlgItem(hwndDlg, IDC_EDIT_DESCRIPTION), pParams->sComment.c_str() );
-
- SetFocus( GetDlgItem(hwndDlg,IDC_EDIT_TITLE) );
- }
- break;
- case WM_COMMAND:
- switch ( LOWORD(wParam) )
- {
- case IDC_SHOW_REPORT:
- {
- TCHAR szBuffer[32767];
-
- CrashReportParams *pParams = (CrashReportParams*)GetWindowLong( GetParent(hwndDlg), GWL_USERDATA );
-
- pParams->fAllowContact = Button_GetCheck( GetDlgItem(hwndDlg, IDC_ALLOW_CONTACT) ) ? TRUE : FALSE;
-
- Edit_GetText( GetDlgItem(hwndDlg, IDC_EDIT_TITLE), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sTitle = szBuffer;
-
- Edit_GetText( GetDlgItem(hwndDlg, IDC_EDIT_DESCRIPTION), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sComment = szBuffer;
-
- Edit_GetText( GetDlgItem(hwndDlg, IDC_EDIT_EMAIL), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sEmail = szBuffer;
-
- PreviewReport( GetParent(hwndDlg), pParams );
- }
- return TRUE;
- case IDC_SAVE_REPORT:
- SaveDumpFile( GetParent(hwndDlg) );
- return TRUE;
- case IDC_OPTIONS:
- {
- CrashReportParams *pParams = (CrashReportParams*)GetWindowLong( GetParent(hwndDlg), GWL_USERDATA );
- OptionsDialog( GetParent(hwndDlg), pParams );
- }
- return TRUE;
- case IDC_ALLOW_CONTACT:
- if ( BN_CLICKED == HIWORD(wParam) )
- UpdateReportDialogControls( hwndDlg );
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-BOOL CALLBACK WelcomeDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
-{
- switch ( uMsg )
- {
- case WM_INITDIALOG:
- {
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndDlg, GWL_HINSTANCE );
- HWND hwndRichEdit = GetDlgItem(hwndDlg, IDC_RICHEDIT21);
- TCHAR szBuffer[FORMATBUFSIZE];
- TCHAR szBuffer2[FORMATBUFSIZE];
- TCHAR szURL[256];
- TCHAR szCaption[256];
-
- SendMessage(
- hwndRichEdit,
- EM_SETBKGNDCOLOR,
- (WPARAM)FALSE,
- GetSysColor( COLOR_3DFACE ) );
-
- SendMessage( hwndRichEdit, EM_SETEVENTMASK, 0, ENM_LINK );
- SendMessage( hwndRichEdit, EM_AUTOURLDETECT, TRUE, 0 );
-
- LoadAndFormatString( hInstance, IDS_WELCOME_BODY1, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- LoadAndFormatString( hInstance, IDS_WELCOME_BODY2, szBuffer2, SAL_N_ELEMENTS(szBuffer2) );
- _tcsncat( szBuffer, szBuffer2, SAL_N_ELEMENTS(szBuffer) );
- LoadAndFormatString( hInstance, IDS_WELCOME_BODY3, szBuffer2, SAL_N_ELEMENTS(szBuffer2) );
- _tcsncat( szBuffer, szBuffer2, SAL_N_ELEMENTS(szBuffer) );
- LoadString( hInstance, IDS_PRIVACY_URL, szURL, SAL_N_ELEMENTS(szURL) );
- _tcsncat( szBuffer, szURL, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( hwndRichEdit, szBuffer );
-
- LoadAndFormatString( hInstance, IDS_WELCOME_CAPTION, szCaption, SAL_N_ELEMENTS(szCaption) );
- SetWindowText( GetParent(hwndDlg), szCaption );
-
- }
- return TRUE;
- case WM_SHOWWINDOW:
- if ( (BOOL)wParam )
- {
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndDlg, GWL_HINSTANCE );
- TCHAR szBuffer[FORMATBUFSIZE];
-
- LoadAndFormatString( hInstance, IDS_WELCOME_CAPTION, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( GetParent(hwndDlg), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_WELCOME_HEADER, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( GetDlgItem(GetParent(hwndDlg), IDC_HEADER), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_CANCEL_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(GetParent(hwndDlg), IDCANCEL), szBuffer );
-
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDBACK), FALSE );
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDFINISH), FALSE );
- ShowWindow( GetDlgItem(GetParent(hwndDlg),IDNEXT), TRUE );
-
- SetFocus( GetDlgItem(GetParent(hwndDlg),IDNEXT) );
- }
- break;
- case WM_NOTIFY:
- {
- LPNMHDR pnmh = (LPNMHDR)lParam;
-
- if ( pnmh->idFrom == IDC_RICHEDIT21 && pnmh->code == EN_LINK )
- {
- ENLINK *plink = (ENLINK*)lParam;
-
- if ( plink->msg == WM_LBUTTONUP )
- {
- TCHAR szBuffer[256];
- TEXTRANGE range;
-
- range.chrg = plink->chrg;
- range.lpstrText = szBuffer;
-
- SendMessage( pnmh->hwndFrom, EM_GETTEXTRANGE, 0, (LPARAM)&range );
-
- ShellExecute( hwndDlg, NULL, szBuffer, NULL, NULL, SW_SHOWDEFAULT );
- }
-
- }
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-BOOL CALLBACK DialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
-{
- static HWND hwndPages[2] = { NULL };
- static int iActualPage = 0;
-
- switch ( uMsg )
- {
- case WM_INITDIALOG:
- {
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong(hwndDlg, GWL_HINSTANCE );
- TCHAR szBuffer[FORMATBUFSIZE];
-
- SetWindowLong( hwndDlg, GWL_USERDATA, (LONG)lParam );
- hwndPages[0] = CreateDialog(
- hInstance,
- MAKEINTRESOURCE(IDD_WELCOME_PAGE),
- hwndDlg,
- WelcomeDialogProc );
-
- hwndPages[1] = CreateDialog(
- hInstance,
- MAKEINTRESOURCE(IDD_REPORT_PAGE),
- hwndDlg,
- ReportDialogProc );
-
- CHARFORMAT chfmt;
-
- chfmt.cbSize = sizeof(chfmt);
- chfmt.dwMask = CFM_BOLD;
- chfmt.dwEffects = CFE_BOLD;
-
- SendMessage(
- GetDlgItem(hwndDlg, IDC_HEADER),
- EM_SETCHARFORMAT,
- SCF_ALL,
- (LPARAM)&chfmt );
-
- LoadAndFormatString( hInstance, IDS_CANCEL_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDCANCEL), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_NEXT_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDNEXT), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_SEND_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDFINISH), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_BACK_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDBACK), szBuffer );
-
- ShowWindow( hwndPages[1], SW_HIDE );
- ShowWindow( hwndPages[0], SW_SHOW );
-
- // Let Crash Reporter window stay on top of all other windows
- SetWindowPos( hwndDlg, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
- }
- return FALSE;
- case WM_CTLCOLORSTATIC:
- return (BOOL)CreateSolidBrush(GetSysColor(COLOR_WINDOW));
- case WM_COMMAND:
- switch ( LOWORD(wParam) )
- {
- case IDBACK:
- if ( iActualPage > 0 )
- {
- ShowWindow( hwndPages[iActualPage], SW_HIDE );
- ShowWindow( hwndPages[--iActualPage], SW_SHOW );
- }
- return TRUE;
- case IDNEXT:
- if ( iActualPage < SAL_N_ELEMENTS(hwndPages) - 1 )
- {
- ShowWindow( hwndPages[iActualPage], SW_HIDE );
- ShowWindow( hwndPages[++iActualPage], SW_SHOW );
- }
- return TRUE;
- case IDFINISH:
- {
- TCHAR szBuffer[32767];
- CrashReportParams *pParams = (CrashReportParams*)GetWindowLong( hwndDlg, GWL_USERDATA );
-
- pParams->fAllowContact = Button_GetCheck( GetDlgItem(hwndPages[1], IDC_ALLOW_CONTACT) ) ? TRUE : FALSE;
-
- Edit_GetText( GetDlgItem(hwndPages[1], IDC_EDIT_TITLE), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sTitle = szBuffer;
-
- Edit_GetText( GetDlgItem(hwndPages[1], IDC_EDIT_DESCRIPTION), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sComment = szBuffer;
-
- Edit_GetText( GetDlgItem(hwndPages[1], IDC_EDIT_EMAIL), szBuffer, SAL_N_ELEMENTS(szBuffer) );
- pParams->sEmail = szBuffer;
-
- if ( pParams->fAllowContact && !pParams->sEmail.length() )
- {
- TCHAR szMessage[MAX_TEXT_BUFFER];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_ERROR_MSG_NOEMAILADDRESS, szMessage, SAL_N_ELEMENTS(szMessage) );
-
- MessageBox( hwndDlg, szMessage, NULL, MB_ICONERROR | MB_OK );
- break; // Don't end the dialog
- }
- else
- {
- pParams->WriteToRegistry();
-
- WriteCommentFile( pParams->sComment.c_str() );
- WriteReportFile( pParams );
-
- if ( !SendCrashReport( hwndDlg, *pParams ) )
- break; // Don't end the dialog
- }
- }
- // Fallthrough !!!
- case IDCANCEL:
- EndDialog( hwndDlg, wParam );
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-
-
-//* Generate MD5 checksum
-
-
-#define MAGIC_DESCRIPTION_FILLER 'x'
-#define MAGIC_DESCRIPTION_COUNT 80
-
-static void repatch_soffice_exe( void *pBuffer, size_t nBufSize )
-{
- wchar_t DescriptionBuffer[MAGIC_DESCRIPTION_COUNT];
-
- memset( DescriptionBuffer, 0, sizeof(DescriptionBuffer) );
- wcsncpy( DescriptionBuffer, g_wstrProductKey.c_str(), SAL_N_ELEMENTS(DescriptionBuffer) - 1 );
-
- bool bPatched = false;
-
- do
- {
- void *pFound = memchr( pBuffer, ((char *)DescriptionBuffer)[0], nBufSize );
-
- if ( pFound )
- {
- size_t distance = (char *)pFound - (char *)pBuffer;
-
- if ( nBufSize >= distance )
- {
- nBufSize -= distance;
-
- if ( nBufSize >= sizeof(DescriptionBuffer) &&
- 0 == memcmp( pFound, DescriptionBuffer, sizeof(DescriptionBuffer) ) )
- {
- for ( int i = 0; i < 80; i++ )
- {
- ((wchar_t *)pFound)[i] = MAGIC_DESCRIPTION_FILLER;
- }
- bPatched = true;
- }
- else
- {
- pBuffer = (void *)(((char *)pFound) + 1);
- nBufSize--;
- }
- }
- else
- nBufSize = 0;
- }
- else
- nBufSize = 0;
- } while ( !bPatched && nBufSize );
-}
-
-// Normalize executable/library images to prevent different MD5 checksums due
-// to a different PE header date/checksum (this doesn't affect the code/data
-// sections of a executable/library. Please see tools/source/bootstrp/md5.cxx
-// where the same method is also used. The tool so_checksum creates the MD5
-// checksums during build time. You have to make sure that both methods use the
-// same algorithm otherwise there could be problems with stack reports.
-static void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
-{
- const int OFFSET_PE_OFFSET = 0x3c;
- const int OFFSET_COFF_TIMEDATESTAMP = 4;
- const int PE_SIGNATURE_SIZE = 4;
- const int COFFHEADER_SIZE = 20;
- const int OFFSET_PE_OPTIONALHEADER_CHECKSUM = 64;
-
- // Check the header part of the file buffer
- if (buffer[0] == 'M' && buffer[1] == 'Z')
- {
- unsigned long PEHeaderOffset = (long)buffer[OFFSET_PE_OFFSET];
- if (PEHeaderOffset < nBufferSize-4)
- {
- if ( buffer[PEHeaderOffset] == 'P' &&
- buffer[PEHeaderOffset+1] == 'E' &&
- buffer[PEHeaderOffset+2] == 0 &&
- buffer[PEHeaderOffset+3] == 0 )
- {
- PEHeaderOffset += PE_SIGNATURE_SIZE;
- if (PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP < nBufferSize-4)
- {
- // Set timedatestamp and checksum fields to a normalized
- // value to enforce the same MD5 checksum for identical
- // Windows executables/libraries.
- buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP] = 0;
- buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+1] = 0;
- buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+2] = 0;
- buffer[PEHeaderOffset+OFFSET_COFF_TIMEDATESTAMP+3] = 0;
- }
-
- if (PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM < nBufferSize-4)
- {
- // Set checksum to a normalized value
- buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM] = 0;
- buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+1] = 0;
- buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+2] = 0;
- buffer[PEHeaderOffset+COFFHEADER_SIZE+OFFSET_PE_OPTIONALHEADER_CHECKSUM+3] = 0;
- }
- }
- }
- }
-}
-
-static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen )
-{
- const int MINIMAL_FILESIZE = 512;
-
- sal_uInt32 nBytesProcessed = 0;
-
- FILE *fp = fopen( filename, "rb" );
-
- if ( fp )
- {
- long nFileSize;
-
- if ( 0 == fseek( fp, 0, SEEK_END ) && -1 != (nFileSize = ftell(fp)) )
- {
- rewind( fp );
-
- sal_uInt8 *pBuffer = new sal_uInt8[nFileSize];
- size_t nBytesRead = fread( pBuffer, 1, nFileSize, fp );
-
- if ( sal::static_int_cast<long>(nBytesRead) == nFileSize )
- {
- if ( 0 == stricmp( GetFileName(filename).c_str(), "soffice.bin" ) )
- repatch_soffice_exe( pBuffer, nBytesRead );
- else if ( nFileSize > MINIMAL_FILESIZE )
- normalize_pe_image( pBuffer, nBytesRead );
-
- rtlDigestError error = rtl_digest_MD5 (
- pBuffer, nBytesRead,
- pChecksum, nChecksumLen );
-
- if ( rtl_Digest_E_None == error )
- nBytesProcessed = nBytesRead;
- }
-
- delete[] pBuffer;
- }
- fclose( fp );
- }
- return nBytesProcessed;
-}
-
-
-
-static bool WriteStackFile( FILE *fout, boost::unordered_map< string, string >& rLibraries, DWORD dwProcessId, PEXCEPTION_POINTERS pExceptionPointers )
-{
- bool fSuccess = false;
-
- if ( fout && dwProcessId && pExceptionPointers )
- {
- HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId );
-
- if ( IsValidHandle(hProcess) )
- {
- EXCEPTION_POINTERS aExceptionPointers;
- CONTEXT aContextRecord;
-
- ReadProcessMemory(
- hProcess,
- pExceptionPointers,
- &aExceptionPointers,
- sizeof(aExceptionPointers),
- NULL );
-
- ReadProcessMemory(
- hProcess,
- aExceptionPointers.ContextRecord,
- &aContextRecord,
- sizeof(aContextRecord),
- NULL );
-
- STACKFRAME frame;
-
- ZeroMemory( &frame, sizeof(frame) );
- frame.AddrPC.Offset = aContextRecord.Eip;
- frame.AddrPC.Mode = AddrModeFlat;
- frame.AddrFrame.Offset = aContextRecord.Ebp;
- frame.AddrFrame.Mode = AddrModeFlat;
-
- BOOL bSuccess;
- int frameNum = 0;
-
- SymInitialize( hProcess, NULL, TRUE );
-
- fprintf( fout, "<errormail:Stack type=\"Win32\">\n" );
-
- do
- {
- fSuccess = true;
-
- bSuccess = StackWalk( IMAGE_FILE_MACHINE_I386,
- hProcess,
- NULL,
- &frame,
- &aContextRecord,
- (PREAD_PROCESS_MEMORY_ROUTINE)ReadProcessMemory,
- SymFunctionTableAccess,
- SymGetModuleBase,
- NULL );
-
- if ( bSuccess )
- {
- // Note: ImageHelp ANSI functions do not have an A postfix while
- // Unicode versions have a W postfix. There's no macro
- // that depends on define UNICODE
-
- IMAGEHLP_MODULE moduleInfo;
-
- ZeroMemory( &moduleInfo, sizeof(moduleInfo) );
- moduleInfo.SizeOfStruct = sizeof(moduleInfo);
-
- if ( SymGetModuleInfo( hProcess, frame.AddrPC.Offset, &moduleInfo ) )
- {
- rLibraries[ GetFileName( moduleInfo.LoadedImageName ).c_str() ] = moduleInfo.LoadedImageName;
-
- DWORD dwRelOffset = 0;
- BYTE symbolBuffer[sizeof(IMAGEHLP_SYMBOL) + 256 ];
- PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL)symbolBuffer;
-
- ZeroMemory( symbolBuffer, sizeof(symbolBuffer) );
- pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
- pSymbol->MaxNameLength = 256;
-
- if ( SymGetSymFromAddr( hProcess, frame.AddrPC.Offset, &dwRelOffset, pSymbol ) )
- fprintf( fout, "<errormail:StackInfo " \
- "pos=\"%d\" ip=\"0x%p\" rel=\"0x%p\" ordinal=\"%s+0x%p\" name=\"%s\" path=\"%s\"/>\n",
- frameNum,
- frame.AddrPC.Offset,
- frame.AddrPC.Offset - moduleInfo.BaseOfImage,
- xml_encode(pSymbol->Name).c_str(),
- frame.AddrPC.Offset - pSymbol->Address,
- xml_encode(GetFileName( moduleInfo.LoadedImageName )).c_str(),
- xml_encode( GetFileDirectory( moduleInfo.LoadedImageName )).c_str()
- );
- else
- fprintf( fout, "<errormail:StackInfo " \
- "pos=\"%d\" ip=\"0x%p\" rel=\"0x%p\" name=\"%s\" path=\"%s\"/>\n",
- frameNum,
- frame.AddrPC.Offset,
- frame.AddrPC.Offset - moduleInfo.BaseOfImage,
- xml_encode(GetFileName( moduleInfo.LoadedImageName )).c_str(),
- xml_encode(GetFileDirectory( moduleInfo.LoadedImageName )).c_str()
- );
- }
- else
- fprintf( fout, "<errormail:StackInfo pos=\"%d\" ip=\"0x%p\"/>\n",
- frameNum,
- frame.AddrPC.Offset
- );
-
- frameNum++;
- }
-
- } while ( bSuccess );
-
- fprintf( fout, "</errormail:Stack>\n" );
-
- SymCleanup( hProcess );
-
- CloseHandle( hProcess );
- }
-
- }
-
- return fSuccess;
-}
-
-bool WriteChecksumFile( FILE *fchksum, const boost::unordered_map< string, string >& rLibraries )
-{
- bool success = false;
-
- if ( fchksum && rLibraries.size() )
- {
- fprintf( fchksum, "<errormail:Checksums type=\"MD5\">\n" );
-
- boost::unordered_map< string, string >::const_iterator iter;
-
- for ( iter = rLibraries.begin(); iter != rLibraries.end(); ++iter )
- {
- sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5];
- sal_uInt32 nBytesProcessed = calc_md5_checksum(
- iter->second.c_str(),
- checksum, sizeof(checksum) );
-
- if ( nBytesProcessed )
- {
- fprintf( fchksum, "<errormail:Checksum sum=\"0x" );
- for ( int i = 0; i < sizeof(checksum); fprintf( fchksum, "%02X", checksum[i++] ) );
- fprintf( fchksum, "\" bytes=\"%d\" file=\"%s\"/>\n",
- nBytesProcessed,
- GetFileName( iter->first ).c_str() );
- }
- }
-
- fprintf( fchksum, "</errormail:Checksums>\n" );
-
- success = true;
- }
-
- return success;
-}
-
-
-
-BOOL FindDumpFile()
-{
- TCHAR szFileName[MAX_PATH];
-
- if ( GetCrashDataPath( szFileName ) )
- {
- _tcscat( szFileName, _T("\\crashdat.dmp") );
-
- HANDLE hFile = CreateFile(
- szFileName,
- GENERIC_READ,
- 0, NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, NULL );
-
- if ( hFile )
- {
- CloseHandle( hFile );
-
- WideCharToMultiByte( CP_ACP, 0, szFileName, -1, g_szDumpFileNameA, MAX_PATH, NULL, NULL );
- _tcscpy( g_szDumpFileName, szFileName );
-
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-BOOL WriteDumpFile( DWORD dwProcessId, PEXCEPTION_POINTERS pExceptionPointers, DWORD dwThreadId )
-{
- BOOL fSuccess = FALSE;
- MINIDUMP_EXCEPTION_INFORMATION ExceptionParam;
-
- HMODULE hDbgHelp = LoadLibrary( _T("DBGHELP.DLL" ) );
- MiniDumpWriteDump_PROC pMiniDumpWriteDump = NULL;
-
- if ( hDbgHelp )
- {
- pMiniDumpWriteDump = (MiniDumpWriteDump_PROC)GetProcAddress( hDbgHelp, "MiniDumpWriteDump" );
-
- if ( !pMiniDumpWriteDump )
- {
- FreeLibrary( hDbgHelp );
- return false;
- }
- }
-
- if ( !pMiniDumpWriteDump )
- return false;
-
- HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, dwProcessId );
-
- if ( IsValidHandle(hProcess) )
- {
- TCHAR szTempPath[MAX_PATH];
-
- if ( GetCrashDataPath( szTempPath ) )
- {
- TCHAR szFileName[MAX_PATH];
-
- _tcscpy( szFileName, szTempPath );
- _tcscat( szFileName, _T("\\crashdat.dmp") );
- {
- HANDLE hFile = CreateFile(
- szFileName,
- GENERIC_READ | GENERIC_WRITE,
- 0, NULL,
- CREATE_ALWAYS,
- FILE_ATTRIBUTE_NORMAL, NULL );
-
- if ( hFile )
- {
- PMINIDUMP_EXCEPTION_INFORMATION lpExceptionParam = NULL;
- if ( pExceptionPointers && dwThreadId )
- {
- ExceptionParam.ThreadId = dwThreadId;
- ExceptionParam.ExceptionPointers = pExceptionPointers;
- ExceptionParam.ClientPointers = TRUE;
-
- EXCEPTION_POINTERS aExceptionPointers;
- EXCEPTION_RECORD aExceptionRecord;
-
- ReadProcessMemory(
- hProcess,
- pExceptionPointers,
- &aExceptionPointers,
- sizeof(aExceptionPointers),
- NULL );
-
-
- ReadProcessMemory(
- hProcess,
- aExceptionPointers.ExceptionRecord,
- &aExceptionRecord,
- sizeof(aExceptionRecord),
- NULL );
-
- g_dwExceptionCode = aExceptionRecord.ExceptionCode;
-
- lpExceptionParam = &ExceptionParam;
- }
-
- fSuccess = pMiniDumpWriteDump( hProcess, dwProcessId, hFile, MiniDumpNormal, lpExceptionParam, NULL, NULL );
-
- CloseHandle( hFile );
-
- WideCharToMultiByte( CP_ACP, 0, szFileName, -1, g_szDumpFileNameA, MAX_PATH, NULL, NULL );
- _tcscpy( g_szDumpFileName, szFileName );
- }
-
- if ( !fSuccess )
- DeleteFile( szFileName );
- }
- }
-
- CloseHandle( hProcess );
- }
-
- FreeLibrary( hDbgHelp );
-
- return fSuccess;
-}
-
-
-
-static DWORD FindProcessForImage( LPCTSTR lpImagePath )
-{
- DWORD dwProcessId = 0;
- DWORD aProcesses[1024];
- DWORD dwSize = 0;
- TCHAR szShortImagePath[MAX_PATH];
-
- if ( GetShortPathName( lpImagePath, szShortImagePath, SAL_N_ELEMENTS(szShortImagePath) ) &&
- EnumProcesses( aProcesses, sizeof(aProcesses), &dwSize ) )
- {
- unsigned nProcesses = dwSize / sizeof(aProcesses[0]);
-
- for ( unsigned i = 0; !dwProcessId && i < nProcesses; i++ )
- {
- HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, aProcesses[i] );
-
- if ( IsValidHandle(hProcess) )
- {
- TCHAR szModulePath[MAX_PATH+1];
-
- if ( GetModuleFileNameEx( hProcess, NULL, szModulePath, MAX_PATH ) )
- {
- TCHAR szShortModulePath[MAX_PATH];
-
- if ( GetShortPathName( szModulePath, szShortModulePath, SAL_N_ELEMENTS(szShortModulePath) ) )
- {
- if ( 0 == _tcsicmp( szShortModulePath, szShortImagePath ) )
- dwProcessId = aProcesses[i];
- }
- }
-
- CloseHandle( hProcess );
- }
- }
- }
-
- return dwProcessId;
-}
-
-
-static bool ParseCommandArgs( LPDWORD pdwProcessId, PEXCEPTION_POINTERS* ppException, LPDWORD pdwThreadId )
-{
- int argc = __argc;
-#ifdef __MINGW32__
-#ifdef _UNICODE
- TCHAR **argv = reinterpret_cast<TCHAR **>(alloca((argc+1)*sizeof(WCHAR*)));
- int *sizes = reinterpret_cast<int *>(alloca(argc*sizeof(int)));
- int argsize=0;
- char **ptr;
- int i;
- ptr=__argv;
- for (i = 0; i < argc; ++i)
- {
- sizes[i]=MultiByteToWideChar(CP_ACP, 0, *ptr, -1, NULL, 0);
- argsize+=sizes[i]+1;
- ++ptr;
- }
- ++argsize;
- TCHAR *args = reinterpret_cast<TCHAR *>(alloca(argsize*sizeof(WCHAR)));
- ptr=__argv;
- TCHAR *cptr=args;
- for (i = 0; i < argc; ++i)
- {
- argv[i]=cptr;
- MultiByteToWideChar( CP_ACP, 0, *ptr, -1, cptr, sizes[i] );
- ++ptr;
- cptr+=sizes[i];
- *cptr=0;
- ++cptr;
- }
- argv[i]=cptr;
- *cptr=0;
-#else
- TCHAR **argv = __argv;
-#endif
-#else
- TCHAR **argv = __targv;
-#endif
- bool bSuccess = true;
-
- for ( int argn = 1; bSuccess && argn < argc; argn++ )
- {
- if ( 0 == _tcsicmp( argv[argn], _T("-h") ) ||
- 0 == _tcsicmp( argv[argn], _T("/h") ) ||
- 0 == _tcsicmp( argv[argn], _T("-?") ) ||
- 0 == _tcsicmp( argv[argn], _T("/?") ) ||
- 0 == _tcsicmp( argv[argn], _T("/help") ) ||
- 0 == _tcsicmp( argv[argn], _T("-help") ) ||
- 0 == _tcsicmp( argv[argn], _T("--help") )
- )
- {
- HINSTANCE hInstance = GetModuleHandle(NULL);
- TCHAR szUsage[FORMATBUFSIZE];
- TCHAR szProcess[FORMATBUFSIZE];
- TCHAR szProcessDescription[FORMATBUFSIZE];
- TCHAR szHelpDescription[FORMATBUFSIZE];
-
- LoadAndFormatString( hInstance, IDS_MSG_CMDLINE_USAGE, szUsage, SAL_N_ELEMENTS(szUsage) );
- LoadAndFormatString( hInstance, IDS_MSG_PARAM_PROCESSID, szProcess, SAL_N_ELEMENTS(szProcess) );
- LoadAndFormatString( hInstance, IDS_MSG_PARAM_PROCESSID_DESCRIPTION, szProcessDescription, SAL_N_ELEMENTS(szProcessDescription) );
- LoadAndFormatString( hInstance, IDS_MSG_PARAM_HELP_DESCRIPTION, szHelpDescription, SAL_N_ELEMENTS(szHelpDescription) );
-
- _tprintf(
- TEXT("\n%s: crashrep %s\n\n")
- TEXT("/?, -h[elp] %s\n\n")
- TEXT("%-20s %s\n\n"),
- szUsage, szProcess, szHelpDescription, szProcess, szProcessDescription
- );
-
- return true;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-p") ) ||
- 0 == _tcsicmp( argv[argn], _T("/p") ) )
- {
- if ( ++argn < argc )
- *pdwProcessId = _tcstoul( argv[argn], NULL, 0 );
- else
- bSuccess = false;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-excp") ) ||
- 0 == _tcsicmp( argv[argn], _T("/excp") ) )
- {
- if ( ++argn < argc )
- *ppException = (PEXCEPTION_POINTERS)_tcstoul( argv[argn], NULL, 0 );
- else
- bSuccess = false;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-t") ) ||
- 0 == _tcsicmp( argv[argn], _T("/t") ) )
- {
- if ( ++argn < argc )
- *pdwThreadId = _tcstoul( argv[argn], NULL, 0 );
- else
- bSuccess = false;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-noui") ) ||
- 0 == _tcsicmp( argv[argn], _T("/noui") ) )
- {
- g_bNoUserInterface = true;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-send") ) ||
- 0 == _tcsicmp( argv[argn], _T("/send") ) )
- {
- g_bSendReport = true;
- }
- else if ( 0 == _tcsicmp( argv[argn], _T("-load") ) ||
- 0 == _tcsicmp( argv[argn], _T("/load") ) )
- {
- g_bLoadReport = true;
- }
- else // treat parameter as image path
- {
- TCHAR szImagePath[MAX_PATH];
- LPTSTR lpImageName;
-
- if ( GetFullPathName( argv[argn], MAX_PATH, szImagePath, &lpImageName ) )
- {
- DWORD dwProcessId = FindProcessForImage( szImagePath );
-
- if ( dwProcessId )
- *pdwProcessId = dwProcessId;
- else
- bSuccess = false;
- }
- }
- }
-
- if ( !*pdwProcessId && !g_bLoadReport )
- {
- TCHAR szImagePath[MAX_PATH];
- LPTSTR lpImageName;
-
- if ( GetFullPathName( TEXT("soffice.exe"), MAX_PATH, szImagePath, &lpImageName ) )
- {
- DWORD dwProcessId = FindProcessForImage( szImagePath );
-
- if ( dwProcessId )
- *pdwProcessId = dwProcessId;
- else
- bSuccess = false;
- }
- }
-
- return bSuccess;
-}
-
-
-
-BOOL WriteCommentFile( LPCTSTR lpComment )
-{
- BOOL fSuccess = FALSE;
- TCHAR szTempPath[MAX_PATH];
-
- if ( GetTempPath( SAL_N_ELEMENTS(szTempPath), szTempPath ) )
- {
- TCHAR szFileName[MAX_PATH];
-
- if ( GetTempFileName( szTempPath, TEXT("CMT"), 0, szFileName ) )
- {
- HANDLE hFile = CreateFile( szFileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL );
-
- if ( hFile )
- {
- DWORD dwBytesWritten;
-
- int needed = WideCharToMultiByte( CP_UTF8, 0, lpComment, -1, NULL, 0, NULL, NULL );
- if ( needed )
- {
- char *lpCommentUTF8 = (char *)alloca( needed );
- WideCharToMultiByte( CP_UTF8, 0, lpComment, -1, lpCommentUTF8, needed, NULL, NULL );
- fSuccess = WriteFile( hFile, lpCommentUTF8, strlen(lpCommentUTF8), &dwBytesWritten, NULL );
- }
- else
- fSuccess = TRUE;
-
-
- CloseHandle( hFile );
-
- WideCharToMultiByte( CP_ACP, 0, szFileName, -1, g_szCommentFileNameA, MAX_PATH, NULL, NULL );
- }
-
- if ( !fSuccess )
- DeleteFile( szFileName );
- }
- }
-
- return fSuccess;
-}
-
-
-
-static int _tsetenv( const _TCHAR *lpVar, const _TCHAR *lpValue )
-{
- if ( !lpValue )
- lpValue = _T("");
-
- _TCHAR *envstr = (TCHAR *)alloca( (_tcslen( lpVar ) + _tcslen( lpValue ) + 2) * sizeof(_TCHAR) );
-
- _tcscpy( envstr, lpVar );
- _tcscat( envstr, _T("=") );
- _tcscat( envstr, lpValue );
-
- return _tputenv( envstr );
-}
-
-static bool read_line( FILE *fp, string& rLine )
-{
- char szBuffer[1024];
- bool bSuccess = false;
- bool bEOL = false;
- string line;
-
-
- while ( !bEOL && fgets( szBuffer, sizeof(szBuffer), fp ) )
- {
- int len = strlen(szBuffer);
-
- bSuccess = true;
-
- while ( len && szBuffer[len - 1] == '\n' )
- {
- szBuffer[--len] = 0;
- bEOL = true;
- }
-
- line.append( szBuffer );
- }
-
- rLine = line;
- return bSuccess;
-}
-
-static string get_script_string( const char *pFileName, const char *pKeyName )
-{
- FILE *fp = fopen( pFileName, "rt" );
- string retValue;
-
- if ( fp )
- {
- string line;
- string section;
-
- while ( read_line( fp, line ) )
- {
- line = trim_string( line );
-
-
- string::size_type iEqualSign = line.find( '=', 0 );
-
- if ( iEqualSign != string::npos )
- {
- string keyname = line.substr( 0, iEqualSign );
- keyname = trim_string( keyname );
-
- string value = line.substr( sal::static_int_cast<string::size_type>(iEqualSign + 1) );
- value = trim_string( value );
-
- if ( value.length() && '\"' == value[0] )
- {
- value.erase( 0, 1 );
-
- string::size_type iQuotes = value.find( '"', 0 );
-
- if ( iQuotes != string::npos )
- value.erase( iQuotes );
- }
-
- if ( 0 == stricmp( keyname.c_str(), pKeyName ) )
- {
- retValue = value;
- break;
- }
- }
- }
-
- fclose( fp );
- }
-
- return retValue;
-}
-
-static bool ReadBootstrapParams( CrashReportParams &rParams )
-{
- TCHAR szBuffer[256] = TEXT("");
- TCHAR szModuleName[MAX_PATH];
- TCHAR szModuleVersionName[MAX_PATH];
- TCHAR szDrive[_MAX_DRIVE];
- TCHAR szDir[_MAX_DIR];
- TCHAR szFName[_MAX_FNAME];
- TCHAR szExt[_MAX_EXT];
- TCHAR szReportServer[MAX_HOSTNAME];
- TCHAR szReportPort[256];
- bool bSuccess = false;
-
- GetModuleFileName( NULL, szModuleName, MAX_PATH );
- _tsplitpath( szModuleName, szDrive, szDir, szFName, szExt );
- _tmakepath( szModuleName, szDrive, szDir, _T("bootstrap"), _T(".ini") );
- _tmakepath( szModuleVersionName, szDrive, szDir, _T("version"), _T(".ini") );
-
- if (
- GetPrivateProfileString(
- TEXT("Bootstrap"),
- TEXT("ProductKey"),
- TEXT("LibreOffice"),
- szBuffer,
- SAL_N_ELEMENTS(szBuffer),
- szModuleName )
- )
- {
- TCHAR *pVersion = _tcschr( szBuffer, ' ' );
-
- g_wstrProductKey = szBuffer;
-
- if ( pVersion )
- {
- *pVersion = 0;
- pVersion++;
- }
- else
- pVersion = TEXT("");
-
- if ( !_tgetenv( _T("PRODUCTNAME") ) )
- {
- _tsetenv( TEXT("PRODUCTNAME"), szBuffer );
- }
- if ( !_tgetenv( _T("PRODUCTVERSION") ) )
- _tsetenv( TEXT("PRODUCTVERSION"), pVersion );
- }
-
- GetPrivateProfileString(
- TEXT("Version"),
- TEXT("buildid"),
- TEXT("unknown"),
- g_szBuildId, SAL_N_ELEMENTS(g_szBuildId),
- szModuleVersionName );
-
- g_strDefaultLanguage = get_script_string( "instdb.inf", "DefaultLanguage" );
-
- if ( GetPrivateProfileString(
- TEXT("ErrorReport"),
- TEXT("ErrorReportPort"),
- TEXT("80"),
- szReportPort, SAL_N_ELEMENTS(szReportPort),
- szModuleName
- ) )
- {
- TCHAR *endptr = NULL;
-
- unsigned short uReportPort = (unsigned short)_tcstoul( szReportPort, &endptr, 10 );
- if ( uReportPort )
- g_uReportPort = uReportPort;
- }
-
- if ( GetPrivateProfileString(
- TEXT("ErrorReport"),
- TEXT("ErrorReportServer"),
- TEXT(""),
- szReportServer, SAL_N_ELEMENTS(szReportServer),
- szModuleName
- ) )
- {
- bSuccess = 0 != WideCharToMultiByte( CP_ACP, 0, szReportServer, -1, g_szReportServerA, SAL_N_ELEMENTS(g_szReportServerA), NULL, NULL );
- }
-
- LPCTSTR lpEnvString;
-
- if ( 0 != (lpEnvString = _tgetenv( _T("ERRORREPORT_PROXYSERVER") )) )
- rParams.sProxyServer = lpEnvString;
-
- if ( 0 != (lpEnvString = _tgetenv( _T("ERRORREPORT_PROXYPORT") )) )
- rParams.sProxyPort = lpEnvString;
-
- if ( 0 != (lpEnvString = _tgetenv( _T("ERRORREPORT_SENDERADDRESS") )) )
- rParams.sEmail = lpEnvString;
-
- return bSuccess;
-}
-
-
-
-bool SendHTTPRequest(
- FILE *fp,
- const char *pszServer,
- unsigned short uPort = 80,
- const char *pszProxyServer = NULL,
- unsigned short uProxyPort = 8080 )
-{
- bool success = false;
-
- struct hostent *hp;
-
- if ( pszProxyServer )
- hp = gethostbyname( pszProxyServer );
- else
- hp = gethostbyname( pszServer );
-
- if ( hp )
- {
- SOCKET s = socket( AF_INET, SOCK_STREAM, 0 );
-
- if ( s )
- {
- struct sockaddr_in address;
-
- memcpy(&(address.sin_addr.s_addr), *(hp->h_addr_list),sizeof(struct in_addr));
- address.sin_family = AF_INET;
-
- if ( pszProxyServer )
- address.sin_port = ntohs( uProxyPort );
- else
- address.sin_port = ntohs( uPort );
-
- if ( 0 == connect( s, (struct sockaddr *)&address, sizeof(struct sockaddr_in)) )
- {
- fseek( fp, 0, SEEK_END );
- size_t length = ftell( fp );
- fseek( fp, 0, SEEK_SET );
-
- char buffer[2048];
-
- if ( pszProxyServer )
- sprintf( buffer,
- "POST http://%s:%d/soap/servlet/rpcrouter HTTP/1.0\r\n"
- "Content-Type: text/xml; charset=\"utf-8\"\r\n"
- "Content-Length: %d\r\n"
- "SOAPAction: \"\"\r\n\r\n",
- pszServer,
- uPort,
- length
- );
- else
- sprintf( buffer,
- "POST /soap/servlet/rpcrouter HTTP/1.0\r\n"
- "Content-Type: text/xml; charset=\"utf-8\"\r\n"
- "Content-Length: %d\r\n"
- "SOAPAction: \"\"\r\n\r\n",
- length
- );
-
- if ( SOCKET_ERROR != send( s, buffer, strlen(buffer), 0 ) )
- {
- size_t nBytes;
-
- do
- {
- nBytes = fread( buffer, 1, sizeof(buffer), fp );
-
- if ( nBytes )
- success = SOCKET_ERROR != send( s, buffer, nBytes, 0 );
- } while( nBytes && success );
-
- if ( success )
- {
- memset( buffer, 0, sizeof(buffer) );
- success = SOCKET_ERROR != recv( s, buffer, sizeof(buffer), 0 );
- if ( success )
- {
- char szHTTPSignature[sizeof(buffer)] = "";
- unsigned uHTTPReturnCode = 0;
-
- sscanf( buffer, "%s %d ", szHTTPSignature, &uHTTPReturnCode );
- success = uHTTPReturnCode == 200;
- }
- }
- }
-
- }
-
- closesocket( s );
- }
- }
-
- return success;
-}
-
-
-
-static void WriteSOAPRequest( FILE *fp )
-{
- fprintf( fp,
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\"\n"
- "xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\"\n"
- "xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\"\n"
- "xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\"\n"
- "xmlns:rds=\"urn:ReportDataService\"\n"
- "xmlns:apache=\"http://xml.apache.org/xml-soap\"\n"
- "SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n"
- "<SOAP-ENV:Body>\n"
- );
-
- fprintf( fp, "<rds:submitReport>\n" );
- fprintf( fp, "<body xsi:type=\"xsd:string\">This is an autogenerated crash report mail.</body>\n" );
- fprintf( fp, "<hash xsi:type=\"apache:Map\">\n" );
-
- FILE *fpin = fopen( g_szReportFileNameA, "r" );
- if ( fpin )
- {
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">reportmail.xml</key>\n"
- "<value xsi:type=\"xsd:string\"><![CDATA[" );
- fcopy( fpin, fp );
- fprintf( fp, "]]></value></item>\n" );
- fclose( fpin );
- }
-
- fpin = fopen( g_szCommentFileNameA, "r" );
- if ( fpin )
- {
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">description.txt</key>\n"
- "<value xsi:type=\"xsd:string\"><![CDATA[" );
- fcopy( fpin, fp );
- fprintf( fp, "]]></value></item>\n" );
- fclose( fpin );
- }
-
-
- fpin = fopen( g_szDumpFileNameA, "rb" );
- if ( fpin )
- {
- FILE *fptemp = _tmpfile();
-
- if ( fptemp )
- {
- if ( base64_encode( fpin, fptemp ) )
- {
- fseek( fptemp, 0, SEEK_SET );
- fprintf( fp,
- "<item>\n"
- "<key xsi:type=\"xsd:string\">user.dmp</key>\n"
- "<value xsi:type=\"xsd:string\">" );
- fcopy( fptemp, fp );
- fprintf( fp, "</value></item>\n" );
- }
- fclose( fptemp );
- }
- fclose( fpin );
- }
-
- fprintf( fp,
- "</hash>\n"
- "</rds:submitReport>\n"
- "</SOAP-ENV:Body>\n"
- "</SOAP-ENV:Envelope>\n"
- );
-}
-
-
-
-struct RequestParams
-{
- bool success;
- FILE *fpin;
- const char *lpServer;
- unsigned short uPort;
- const char *lpProxyServer;
- unsigned short uProxyPort;
- HWND hwndStatus;
-};
-
-void _cdecl SendingThread( void *lpArgs )
-{
- RequestParams *pParams = (RequestParams *)lpArgs;
-
- pParams->success = SendHTTPRequest( pParams->fpin, pParams->lpServer, pParams->uPort, pParams->lpProxyServer, pParams->uProxyPort );
-
- PostMessage( pParams->hwndStatus, WM_COMMAND, IDOK, 0 );
-}
-
-
-
-BOOL CALLBACK SendingStatusDialogProc(
- HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam
- )
-{
- static RequestParams *pRequest = NULL;
- static HANDLE hSendingThread = NULL;
-
- switch ( uMsg )
- {
- case WM_INITDIALOG:
- {
- TCHAR szBuffer[1024] = TEXT("");
- HINSTANCE hInstance = (HINSTANCE)GetWindowLong( hwndDlg, GWL_HINSTANCE );
-
- pRequest = (RequestParams *)lParam;
-
- LoadAndFormatString( hInstance, IDS_SENDING_REPORT_HEADER, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- SetWindowText( hwndDlg, szBuffer );
-
- LoadAndFormatString( hInstance, IDS_SENDING_REPORT_STATUS, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Static_SetText( GetDlgItem(hwndDlg, IDC_SENDING_REPORT_STATUS), szBuffer );
-
- LoadAndFormatString( hInstance, IDS_CANCEL_BUTTON, szBuffer, SAL_N_ELEMENTS(szBuffer) );
- Button_SetText( GetDlgItem(hwndDlg, IDCANCEL), szBuffer );
-
- pRequest->hwndStatus = hwndDlg;
-
- hSendingThread = (HANDLE)_beginthread( SendingThread, 0, pRequest );
- }
- return TRUE;
- case WM_COMMAND:
- switch ( LOWORD(wParam) )
- {
- case IDCANCEL:
- TerminateThread( hSendingThread, 0 );
- case IDOK:
- WaitForSingleObject( hSendingThread, INFINITE );
- CloseHandle( hSendingThread );
- EndDialog( hwndDlg, wParam );
- return TRUE;
- }
- break;
- default:
- break;
- }
-
- return FALSE;
-}
-
-
-
-bool SendCrashReport( HWND hwndParent, const CrashReportParams &rParams )
-{
- bool success = false;
- char szProxyServer[1024] = "";
- unsigned short uProxyPort = 8080;
- TCHAR *endptr = NULL;
-
- switch ( rParams.uInternetConnection )
- {
- case 2:
- {
- WideCharToMultiByte(
- CP_ACP, 0, rParams.sProxyServer.c_str(), -1,
- szProxyServer, sizeof(szProxyServer), NULL, NULL );
- uProxyPort = (unsigned short)_tcstoul( rParams.sProxyPort.c_str(), &endptr, 10 );
- }
- break;
- case 0:
- {
- DWORD dwProxyEnable = 0;
-
- RegReadValue( HKEY_CURRENT_USER,
- TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"),
- TEXT("ProxyEnable"),
- &dwProxyEnable,
- sizeof(dwProxyEnable) );
-
- if ( dwProxyEnable )
- {
- TCHAR tszProxyServers[1024] = TEXT("");
-
- if ( ERROR_SUCCESS == RegReadValue( HKEY_CURRENT_USER,
- TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings"), TEXT("ProxyServer"),
- tszProxyServers,
- sizeof(tszProxyServers) ) )
- {
- TCHAR *lpHttpStart = _tcsstr( tszProxyServers, TEXT("http=") );
-
- if ( lpHttpStart )
- lpHttpStart += 5;
- else
- lpHttpStart = tszProxyServers;
-
- TCHAR *lpHttpEnd = _tcschr( lpHttpStart, ';' );
-
- if ( lpHttpEnd )
- *lpHttpEnd = 0;
-
- char szHTTPProxyServer[1024] = "";
- WideCharToMultiByte( CP_ACP, 0, lpHttpStart, -1, szHTTPProxyServer, sizeof(szHTTPProxyServer), NULL, NULL );
-
- char *lpColon = strchr( szHTTPProxyServer, ':' );
-
- if ( lpColon )
- {
- char *endptr = NULL;
-
- *lpColon = 0;
- uProxyPort = (unsigned short)strtoul( lpColon + 1, &endptr, 10 );
- }
- else
- uProxyPort = 8080;
-
- strcpy( szProxyServer, szHTTPProxyServer );
-
- }
- }
- }
- break;
- default:
- case 1:
- break;
- }
-
- FILE *fptemp = _tmpfile();
- if ( fptemp )
- {
- RequestParams request;
-
- request.success = false;
- request.fpin = fptemp;
- request.lpServer = REPORT_SERVER;
- request.uPort = REPORT_PORT;
- request.lpProxyServer = szProxyServer[0] ? szProxyServer : NULL;
- request.uProxyPort = uProxyPort;
- request.hwndStatus = NULL;
-
- WriteSOAPRequest( fptemp );
- fseek( fptemp, 0, SEEK_SET );
-
- if ( hwndParent )
- {
- int retid = DialogBoxParam(
- GetModuleHandle(NULL),
- MAKEINTRESOURCE(IDD_SENDING_STATUS),
- hwndParent,
- SendingStatusDialogProc,
- (LPARAM)&request
- );
-
- success = request.success;
-
- if ( IDOK == retid )
- {
- if ( !success )
- {
- TCHAR szMessage[1024];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_ERROR_MSG_PROXY, szMessage, SAL_N_ELEMENTS(szMessage) );
-
- MessageBox( hwndParent, szMessage, NULL, MB_ICONERROR | MB_OK );
- }
- else
- {
- TCHAR szMessage[1024];
- TCHAR szTitle[1024];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_SENDING_REPORT_STATUS_FINISHED, szMessage, SAL_N_ELEMENTS(szMessage) );
- LoadAndFormatString( GetModuleHandle(NULL), IDS_SENDING_REPORT_HEADER, szTitle, SAL_N_ELEMENTS(szTitle) );
-
- MessageBox( hwndParent, szMessage, szTitle, MB_ICONINFORMATION | MB_OK );
- }
- }
-
- }
- else
- {
- HANDLE hSendingThread = (HANDLE)_beginthread( SendingThread, 0, (void *)&request );
-
- WaitForSingleObject( hSendingThread, INFINITE );
-
- success = request.success;
- if ( !success )
- {
- TCHAR szMessage[1024];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_ERROR_MSG_PROXY, szMessage, SAL_N_ELEMENTS(szMessage) );
- _ftprintf( stderr, _T("ERROR: %s\n"), szMessage );
- }
- else
- {
- TCHAR szMessage[1024];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_SENDING_REPORT_STATUS_FINISHED, szMessage, SAL_N_ELEMENTS(szMessage) );
-
- _ftprintf( stderr, _T("SUCCESS: %s\n"), szMessage );
- }
- }
- fclose( fptemp );
- }
- else
- {
- TCHAR szMessage[1024];
-
- LoadAndFormatString( GetModuleHandle(NULL), IDS_ERROR_MSG_DISK_FULL, szMessage, SAL_N_ELEMENTS(szMessage) );
-
- if ( hwndParent )
- MessageBox( hwndParent, szMessage, NULL, MB_ICONERROR | MB_OK );
- else
- _ftprintf( stderr, _T("ERROR: %s\n"), szMessage );
- }
-
- return success;
-}
-
-
-
-#ifdef __MINGW32__
-int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR /*lpCmdLine*/, int )
-#else
-int WINAPI _tWinMain( HINSTANCE hInstance, HINSTANCE, LPTSTR /*lpCmdLine*/, int )
-#endif
-{
- int exitcode = -1;
- int argc = __argc;
-
-#ifdef __MINGW32__
- char **argv = __argv;
-#else
-#ifdef _UNICODE
- char **argv = new char *[argc + 1];
-
- for ( int argn = 0; argn < argc; argn++ )
- {
- int nBytes = WideCharToMultiByte( CP_ACP, 0, __targv[argn], -1, NULL, 0, NULL, NULL );
- argv[argn] = new char[nBytes];
- WideCharToMultiByte( CP_ACP, 0, __targv[argn], -1, argv[argn], nBytes, NULL, NULL );
- }
- argv[argc] = NULL;
-#else
- char **argv = __targv;
-#endif
-#endif
-
- osl_setCommandArgs( argc, argv );
-
- PEXCEPTION_POINTERS pExceptionPointers = NULL;
- DWORD dwProcessId = 0;
- DWORD dwThreadId = 0;
-
- WSADATA wsaData;
- WORD wVersionRequested;
-
- wVersionRequested = MAKEWORD(1, 1);
- WSAStartup(wVersionRequested, &wsaData);
-
- CrashReportParams Params;
-
- Params.ReadFromRegistry();
- Params.ReadFromEnvironment();
-
- if ( ReadBootstrapParams( Params ) &&
- ParseCommandArgs( &dwProcessId, &pExceptionPointers, &dwThreadId ) )
- {
- bool bGotDumpFile;
-
- if ( g_bLoadReport )
- bGotDumpFile = FindDumpFile();
- else
- bGotDumpFile = WriteDumpFile( dwProcessId, pExceptionPointers, dwThreadId );
-
- if( bGotDumpFile )
- {
- boost::unordered_map< string, string > aLibraries;
-
- if ( g_bLoadReport )
- {
- g_fpStackFile = _open_reportfile( _T(".stk"), _T("rb") );
- g_fpChecksumFile = _open_reportfile( _T(".chk"), _T("rb") );
- }
- else
- {
- if ( g_bSendReport )
- {
- g_fpStackFile = _tmpfile();
- g_fpChecksumFile = _tmpfile();
- }
- else
- {
- g_fpStackFile = _open_reportfile( _T(".stk"), _T("w+b") );
- g_fpChecksumFile = _open_reportfile( _T(".chk"), _T("w+b") );
-
- FILE *fpUnsent = _open_reportfile( _T(".lck"), _T("w+b") );
- if ( fpUnsent )
- {
- fprintf( fpUnsent, "Unsent\r\n" );
- fclose( fpUnsent );
- }
- }
-
- WriteStackFile( g_fpStackFile, aLibraries, dwProcessId, pExceptionPointers );
- WriteChecksumFile( g_fpChecksumFile, aLibraries );
- WriteReportFile( &Params );
-
- FILE *fpPreview = _open_reportfile( _T(".prv"), _T("w+b") );
-
- if ( fpPreview )
- {
- FILE *fp = fopen( g_szReportFileNameA, "rb" );
- if ( fp )
- {
- fcopy( fp, fpPreview );
- fclose( fp );
- }
- fclose( fpPreview );
- }
- }
-
- if ( g_bSendReport )
- {
- InitCommonControls();
-
- // Actually this should never be true anymore
- if ( !g_bNoUserInterface && InitRichEdit() )
- {
-
- INT_PTR result = DialogBoxParam( hInstance, MAKEINTRESOURCE(IDD_DIALOG_FRAME), NULL, DialogProc, (LPARAM)&Params );
-
- if ( result > 0 )
- {
- exitcode = 0;
- }
- DeinitRichEdit();
- }
- else
- {
- WriteCommentFile( Params.sComment.c_str() );
- WriteReportFile( &Params );
- if ( SendCrashReport( NULL, Params ) )
- exitcode = 0;
- }
-
-
- if ( g_szReportFileNameA[0] )
- DeleteFileA( g_szReportFileNameA );
-
- if ( g_szCommentFileNameA[0] )
- DeleteFileA( g_szCommentFileNameA );
- }
- else
- {
- if ( g_szReportFileNameA[0] )
- DeleteFileA( g_szReportFileNameA );
- exitcode = 0;
- }
-
- if ( g_szDumpFileNameA[0] && g_bSendReport )
- DeleteFileA( g_szDumpFileNameA );
-
- if ( g_fpStackFile )
- fclose( g_fpStackFile );
-
- if ( g_fpChecksumFile )
- fclose( g_fpChecksumFile );
- }
- }
-
-
- return exitcode;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/Executable_crashrep_com.mk b/desktop/Executable_crashrep_com.mk
deleted file mode 100644
index 15d69bf04adf..000000000000
--- a/desktop/Executable_crashrep_com.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_Executable_Executable,crashrep_com))
-
-$(eval $(call gb_Executable_set_targettype_gui,crashrep_com,NO))
-
-$(eval $(call gb_Executable_add_defs,crashrep_com,\
- $(LFS_CFLAGS) \
-))
-
-$(eval $(call gb_Executable_use_libraries,crashrep_com,\
- $(gb_UWINAPI) \
-))
-
-$(eval $(call gb_Executable_add_exception_objects,crashrep_com,\
- desktop/win32/source/guistdio/guistdio \
-))
-
-# vim: set ts=4 sw=4 et:
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index 4d6f5e82d79a..fd9d443ea92a 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -62,12 +62,6 @@ endif
ifeq ($(OS),WNT)
-ifneq ($(ENABLE_CRASHDUMP),)
-$(eval $(call gb_Module_add_targets,desktop,\
- Executable_crashrep_com \
-))
-endif
-
$(eval $(call gb_Module_add_targets,desktop,\
StaticLibrary_winloader \
StaticLibrary_winlauncher \
diff --git a/desktop/win32/source/guistdio/guistdio.cxx b/desktop/win32/source/guistdio/guistdio.cxx
deleted file mode 100644
index e872ac52d735..000000000000
--- a/desktop/win32/source/guistdio/guistdio.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "guistdio.inc"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/distro-configs/OxygenOfficeLinux.conf b/distro-configs/OxygenOfficeLinux.conf
index 8eb365f86824..72cb10d179ed 100644
--- a/distro-configs/OxygenOfficeLinux.conf
+++ b/distro-configs/OxygenOfficeLinux.conf
@@ -65,5 +65,4 @@
--enable-python=internal
--enable-oxygenoffice
--enable-ccache
---enable-crashdump
--enable-cairo-canvas
diff --git a/framework/qa/complex/api_internal/CheckAPI.props b/framework/qa/complex/api_internal/CheckAPI.props
index b25eb9ae0022..58bd9420b4ab 100644
--- a/framework/qa/complex/api_internal/CheckAPI.props
+++ b/framework/qa/complex/api_internal/CheckAPI.props
@@ -1,4 +1,4 @@
ParamList=-OutProducer stats.SimpleFileOutProducer -OutputPath /dev/null
-#AppExecutionCommand=d:\\prj_new\\install\\src680_m17\\program\\soffice --norestore --nocrashreport --accept=socket,host=0,port=8100;urp;
+#AppExecutionCommand=d:\\prj_new\\install\\src680_m17\\program\\soffice --norestore --accept=socket,host=0,port=8100;urp;
# the test job list
job1=sw.SwXTextTable
diff --git a/framework/qa/complex/framework/recovery/RecoveryTools.java b/framework/qa/complex/framework/recovery/RecoveryTools.java
index e918055fbfe9..36f3c018cf4d 100644
--- a/framework/qa/complex/framework/recovery/RecoveryTools.java
+++ b/framework/qa/complex/framework/recovery/RecoveryTools.java
@@ -219,15 +219,15 @@ public class RecoveryTools {
/**
- * The office must be started WITH restore and crashreporter functionality.
- * Therefore the parameter '<CODE>--norestore</CODE>' and '<CODE>--nocrashreport</CODE>'
+ * The office must be started WITH restore functionality.
+ * Therefore the parameter '<CODE>--norestore</CODE>'
* was removed from the <CODE>AppExecutionCommand</CODE> parameter
*/
public void removeParametersFromAppExecutionCommand(){
//remove some params to start office
String office = (String) param.get("AppExecutionCommand");
- String[] params = {"--norestore", "--nocrashreport"};
+ String[] params = {"--norestore"};
for (int i = 0; i < params.length; i++){
int index = office.indexOf(params[i]);
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
index 2501b575f4c3..f0145c613901 100644
--- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
+++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java
@@ -275,7 +275,6 @@ public class Bootstrap {
cmdArray[1] = "--nologo";
cmdArray[2] = "--nodefault";
cmdArray[3] = "--norestore";
- cmdArray[4] = "--nocrashreport";
cmdArray[5] = "--nolockcheck";
cmdArray[6] = "--accept=pipe,name=" + sPipeName + ";urp;";
diff --git a/reportdesign/qa/complex/reportdesign/runner.props b/reportdesign/qa/complex/reportdesign/runner.props
index e663320b6671..a9830f2c8695 100644
--- a/reportdesign/qa/complex/reportdesign/runner.props
+++ b/reportdesign/qa/complex/reportdesign/runner.props
@@ -23,8 +23,8 @@ unxlngi.DOC_COMPARATOR_OUTPUT_PATH=/net/so-gfxcmp-lin/export/gfxcmp/document-poo
DB_CONNECTION_STRING=server:jakobus,db:jobs_convwatch,user:admin,passwd:admin
# Set path to an existing office installation
-wntmsci.AppExecutionCommand=C:\\home\\${USERNAME}\\staroffice8\\program\\soffice.exe --norestore --nocrashreport --accept=socket,host=localhost,port=8100;urp;
-unxlngi.AppExecutionCommand=/opt/staroffice8/program/soffice --norestore --nocrashreport --accept=socket,host=localhost,port=8100;urp;
+wntmsci.AppExecutionCommand=C:\\home\\${USERNAME}\\staroffice8\\program\\soffice.exe --norestore --accept=socket,host=localhost,port=8100;urp;
+unxlngi.AppExecutionCommand=/opt/staroffice8/program/soffice --norestore --accept=socket,host=localhost,port=8100;urp;
# Set the 'Continue' Property to true, to leave out already done tests.
Continue=true
diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index 29359b0a78c9..f0c7ad999408 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -29,9 +29,6 @@
#if defined( INTEL )
#include "backtrace.h"
#define INCLUDE_BACKTRACE
-#if HAVE_FEATURE_CRASHDUMP
-#define STACKTYPE "MacOsX_X86"
-#endif
#endif /* INTEL */
#endif /* MACOSX */
@@ -40,9 +37,6 @@
#include <execinfo.h>
#include <link.h>
#define INCLUDE_BACKTRACE
-#if HAVE_FEATURE_CRASHDUMP
-#define STACKTYPE "Linux"
-#endif
#endif
#ifdef SOLARIS
@@ -50,16 +44,6 @@
#include "backtrace.h"
#define INCLUDE_BACKTRACE
-#if HAVE_FEATURE_CRASHDUMP
-#if defined( SPARC )
-#define STACKTYPE "Solaris_Sparc"
-#elif defined( INTEL )
-#define STACKTYPE "Solaris_X86"
-#else
-#define STACKTYPE "Solaris_Unknown"
-#endif
-#endif
-
#endif /* defined SOLARIS */
#if defined INCLUDE_BACKTRACE
@@ -81,11 +65,7 @@
#define ACT_EXIT 2
#define ACT_SYSTEM 3
#define ACT_HIDE 4
-#if HAVE_FEATURE_CRASHDUMP
-# define ACT_ABORT 5
-#else
-# define ACT_ABORT ACT_SYSTEM
-#endif
+#define ACT_ABORT ACT_SYSTEM
#if defined HAVE_VALGRIND_HEADERS
#include <valgrind/memcheck.h>
@@ -314,495 +294,6 @@ static bool DeInitSignal(void)
return false;
}
-#if HAVE_FEATURE_CRASHDUMP && defined(INCLUDE_BACKTRACE)
-
-static sal_uInt32 calc_md5_checksum( const char *filename, sal_uInt8 *pChecksum, sal_uInt32 nChecksumLen )
-{
- sal_uInt32 nBytesProcessed = 0;
-
- FILE *fp = fopen( filename, "r" );
-
- if ( fp )
- {
- rtlDigest digest = rtl_digest_createMD5();
-
- if ( digest )
- {
- size_t nBytesRead;
- sal_uInt8 buffer[4096];
- rtlDigestError error = rtl_Digest_E_None;
-
- while ( rtl_Digest_E_None == error &&
- 0 != (nBytesRead = fread( buffer, 1, sizeof(buffer), fp )) )
- {
- error = rtl_digest_updateMD5( digest, buffer, nBytesRead );
- nBytesProcessed += nBytesRead;
- }
-
- if ( rtl_Digest_E_None == error )
- {
- error = rtl_digest_getMD5( digest, pChecksum, nChecksumLen );
- }
-
- if ( rtl_Digest_E_None != error )
- nBytesProcessed = 0;
-
- rtl_digest_destroyMD5( digest );
- }
-
- fclose( fp );
- }
-
- return nBytesProcessed;
-}
-
-/*****************************************************************************/
-/* Call crash reporter */
-/*****************************************************************************/
-
-/* Helper function to encode and write a string to a stream */
-
-static int fputs_xml( const char *string, FILE *stream )
-{
- int result = 0;
-
- while ( result >= 0 && *string )
- {
- switch( *string )
- {
- case '&':
- result = fputs( "&amp;", stream );
- break;
- case '<':
- result = fputs( "&lt;", stream );
- break;
- case '>':
- result = fputs( "&gt;", stream );
- break;
- default:
- result = fputc( *string, stream );
- break;
- }
-
- string++;
- }
-
- return result;
-}
-#endif
-
-/* Create intermediate files and run crash reporter */
-
-#if HAVE_FEATURE_CRASHDUMP && defined INCLUDE_BACKTRACE && defined LINUX
-
-typedef struct
-{
- const char *name;
- ElfW(Off) offset;
-} dynamic_entry;
-
-static int
-callback(struct dl_phdr_info *info, size_t size, void *data)
-{
- const ElfW(Phdr) *pDynamic = NULL;
-
- if (size == sizeof(struct dl_phdr_info))
- {
- int i;
- for (i = 0; i < info->dlpi_phnum; ++i)
- {
- if (info->dlpi_phdr[i].p_type == PT_DYNAMIC)
- {
- pDynamic = &(info->dlpi_phdr[i]);
- break;
- }
- }
- }
-
- if (pDynamic)
- {
- char exe[PATH_MAX];
- const char *dsoname = info->dlpi_name;
-
- dynamic_entry* entry = (dynamic_entry*)data;
-
- if (strcmp(dsoname, "") == 0)
- {
- char buffer[100];
- int len;
-
- snprintf(buffer, sizeof(buffer), "/proc/%d/exe", getpid());
- if ((len = readlink(buffer, exe, PATH_MAX)) != -1)
- {
- exe[len] = '\0';
- dsoname = exe;
- }
- }
-
- if (strcmp(dsoname, entry->name) == 0)
- {
- entry->offset = pDynamic->p_offset;
- return 1;
- }
- }
- return 0;
-}
-
-/* Get the location of the .dynamic section offset for the given elf file.
- * i.e. same as the "Offset" value shown for DYNAMIC from readelf -l foo
- *
- * We want to know this value so that if the binaries have been modified
- * by prelink then we can still process the call stack on server side
- * by comparing this value to that of an "un-prelinked but known to be
- * otherwise equivalent" version of those binaries and adjust the call
- * stack addresses by the differences between .dynamic addresses so as
- * to be able to map the prelinked addresses back to the unprelinked
- * addresses
- *
- * cmc@openoffice.org
- */
-static ElfW(Off)
-dynamic_section_offset(const char *name)
-{
- dynamic_entry entry;
-
- entry.name = name;
- entry.offset = 0;
-
- dl_iterate_phdr(callback, &entry);
-
- return entry.offset;
-}
-#endif
-
-static int ReportCrash( int Signal )
-{
-#if HAVE_FEATURE_CRASHDUMP
-
-#define REPORTENV_PARAM "-crashreportenv:"
-
- static bool bCrashReporterExecuted = false;
- bool bAutoCrashReport = false;
-
- sal_uInt32 argi;
- sal_uInt32 argc;
- rtl_uString *ustrCommandArg = NULL;
-
- if ( !bErrorReportingEnabled )
- return -1;
-
- argc = osl_getCommandArgCount();
-
- for ( argi = 0; argi < argc; argi++ )
- {
- osl_getCommandArg( argi, &ustrCommandArg );
- if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--nocrashreport" ) )
- {
- rtl_uString_release( ustrCommandArg );
- return -1;
- }
- else if ( 0 == rtl_ustr_ascii_compare( rtl_uString_getStr( ustrCommandArg ), "--autocrashreport" ) )
- {
- bAutoCrashReport = true;
- }
- else if ( 0 == rtl_ustr_ascii_shortenedCompare_WithLength(
- rtl_uString_getStr( ustrCommandArg ), rtl_uString_getLength( ustrCommandArg ),
- REPORTENV_PARAM, strlen(REPORTENV_PARAM) )
- )
- {
- rtl_uString *ustrEnvironment = NULL;
- rtl_String *strEnv = NULL;
-
- rtl_uString_newFromStr( &ustrEnvironment, rtl_uString_getStr( ustrCommandArg ) + strlen(REPORTENV_PARAM) );
-
- if ( ustrEnvironment )
- {
- rtl_uString2String(
- &strEnv,
- rtl_uString_getStr( ustrEnvironment ), rtl_uString_getLength( ustrEnvironment ),
- osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS
- );
-
- if ( strEnv )
- {
- putenv( rtl_string_getStr( strEnv ) );
- rtl_string_release( strEnv );
- }
-
- rtl_uString_release( ustrEnvironment );
- }
- }
- }
-
- if ( ustrCommandArg )
- rtl_uString_release( ustrCommandArg );
-
- if ( !bCrashReporterExecuted )
- {
- int i;
- /* struct sigaction act; */
-
- for (i = 0; i < NoSignals; i++)
- {
- if (Signals[i].Signal == Signal && Signals[i].Action == ACT_ABORT )
- {
- int ret;
- char szShellCmd[512] = { '\0' };
- char *pXMLTempName = NULL;
- char *pStackTempName = NULL;
- char *pChecksumTempName = NULL;
-
-#ifdef INCLUDE_BACKTRACE
- char szXMLTempNameBuffer[L_tmpnam];
- char szChecksumTempNameBuffer[L_tmpnam];
- char szStackTempNameBuffer[L_tmpnam];
-
- void *stackframes[MAX_STACK_FRAMES];
- int nFrames = backtrace( stackframes, SAL_N_ELEMENTS(stackframes) );
-
- FILE *xmlout = NULL, *stackout = NULL, *checksumout = NULL;
- int fdxml, fdstk, fdchksum;
-
- strncpy( szXMLTempNameBuffer, P_tmpdir, sizeof(szXMLTempNameBuffer) );
- strncat( szXMLTempNameBuffer, "/crxmlXXXXXX", sizeof(szXMLTempNameBuffer) - strlen(szXMLTempNameBuffer) - 1 );
-
- strncpy( szStackTempNameBuffer, P_tmpdir, sizeof(szStackTempNameBuffer) );
- strncat( szStackTempNameBuffer, "/crstkXXXXXX", sizeof(szStackTempNameBuffer) - strlen(szStackTempNameBuffer) - 1 );
-
- strncpy( szChecksumTempNameBuffer, P_tmpdir, sizeof(szChecksumTempNameBuffer) );
- strncat( szChecksumTempNameBuffer, "/crchkXXXXXX", sizeof(szChecksumTempNameBuffer) - strlen(szChecksumTempNameBuffer) - 1 );
-
- fdxml = mkstemp(szXMLTempNameBuffer);
- fdstk = mkstemp(szStackTempNameBuffer);
- fdchksum = mkstemp(szChecksumTempNameBuffer);
-
- xmlout = fdopen( fdxml , "w" );
- stackout = fdopen( fdstk , "w" );
- checksumout = fdopen( fdchksum, "w" );
-
- pXMLTempName = szXMLTempNameBuffer;
- pStackTempName = szStackTempNameBuffer;
- pChecksumTempName = szChecksumTempNameBuffer;
-
- if ( xmlout && stackout && checksumout )
- {
- fprintf( xmlout, "<errormail:Stack type=\"%s\">\n", STACKTYPE );
-
- fprintf( checksumout, "<errormail:Checksums type=\"MD5\">\n" );
-
- int iFrame;
- for ( iFrame = 0; iFrame < nFrames; iFrame++ )
- {
- Dl_info dl_info;
-
- fprintf( stackout, "0x%" SAL_PRIxUINTPTR ":",
- reinterpret_cast<sal_uIntPtr>(stackframes[iFrame]) );
-
- fprintf( xmlout, "<errormail:StackInfo pos=\"%d\" ip=\"0x%" SAL_PRIxUINTPTR "\"",
- iFrame,
- reinterpret_cast<sal_uIntPtr>(stackframes[iFrame])
- );
-
- memset( &dl_info, 0, sizeof(dl_info) );
-
- /* dladdr may fail */
- if ( dladdr( stackframes[iFrame], &dl_info) )
- {
- const char *dli_fname = NULL;
- char *dli_fdir = NULL;
-
- /* Don't expect that dladdr filled all members of dl_info */
-
- dli_fname = dl_info.dli_fname ? strrchr( dl_info.dli_fname, '/' ) : NULL;
- if ( dli_fname )
- {
- char szDirectory[PATH_MAX];
- char szCanonicDirectory[PATH_MAX];
-
- ++dli_fname;
- memcpy( szDirectory, dl_info.dli_fname, dli_fname - dl_info.dli_fname );
- szDirectory[dli_fname - dl_info.dli_fname] = 0;
-
- dli_fdir = realpath( szDirectory, szCanonicDirectory ) ? szCanonicDirectory : szDirectory;
-
- if ( *dli_fdir && dli_fdir[ strlen(dli_fdir) - 1 ] != '/' )
- strcat( dli_fdir, "/" );
- }
- else
- dli_fname = dl_info.dli_fname;
-
- /* create checksum of library on stack */
- if ( dli_fname )
- {
- sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5];
-
- sal_uInt32 nBytesProcessed = calc_md5_checksum(
- dl_info.dli_fname, checksum, sizeof(checksum) );
- if ( nBytesProcessed )
- {
- int j;
-
- fprintf( checksumout, "<errormail:Checksum sum=\"0x" );
- for ( j = 0; j < 16; fprintf( checksumout, "%02X", checksum[j++] ) );
- fprintf( checksumout,
- "\" bytes=\"%lu\" file=\"%s\"/>\n",
- sal::static_int_cast<
- unsigned long>(nBytesProcessed),
- dli_fname );
- }
- }
-
- if ( dl_info.dli_fbase && dl_info.dli_fname )
- {
-#ifdef LINUX
- ElfW(Off) dynamic_offset = dynamic_section_offset(dl_info.dli_fname);
- fprintf( stackout, " 0x%" SAL_PRI_SIZET "x:", dynamic_offset);
-#endif
-
- fprintf( stackout, " %s + 0x%" SAL_PRI_PTRDIFFT "x",
- dl_info.dli_fname,
- (char*)stackframes[iFrame] - (char*)dl_info.dli_fbase
- );
-
- fprintf( xmlout, " rel=\"0x%" SAL_PRI_PTRDIFFT "x\"", (char *)stackframes[iFrame] - (char *)dl_info.dli_fbase );
- if ( dli_fname )
- fprintf( xmlout, " name=\"%s\"", dli_fname );
-
- if ( dli_fdir )
- fprintf( xmlout, " path=\"%s\"", dli_fdir );
-
-#ifdef LINUX
- fprintf( xmlout, " dynamicoffset=\"0x%" SAL_PRI_SIZET "x\"", dynamic_offset );
-#endif
- }
- else
- fprintf( stackout, " ????????" );
-
- if ( dl_info.dli_sname && dl_info.dli_saddr )
- {
- fputs( " (", stackout );
- fputs_xml( dl_info.dli_sname, stackout );
- fprintf( stackout, " + 0x%" SAL_PRI_PTRDIFFT "x)",
- (char*)stackframes[iFrame] - (char*)dl_info.dli_saddr );
-
- fputs( " ordinal=\"", xmlout );
- fputs_xml( dl_info.dli_sname, xmlout );
- fprintf( xmlout, "+0x%" SAL_PRI_PTRDIFFT "x\"",
- (char *)stackframes[iFrame] - (char *)dl_info.dli_saddr );
- }
-
- }
- else /* dladdr failed */
- {
- fprintf( stackout, " ????????" );
- }
-
- fprintf( stackout, "\n" );
- fprintf( xmlout, "/>\n" );
-
- }
-
- fprintf( xmlout, "</errormail:Stack>\n" );
- fprintf( checksumout, "</errormail:Checksums>\n" );
- }
- else
- {
- pXMLTempName = NULL;
- pStackTempName = NULL;
- pChecksumTempName = NULL;
- }
-
- if ( stackout )
- fclose( stackout );
- if ( xmlout )
- fclose( xmlout );
- if ( checksumout )
- fclose( checksumout );
-
- if ( pXMLTempName && pChecksumTempName && pStackTempName )
-#endif /* INCLUDE_BACKTRACE */
- {
- rtl_uString * crashrep_url = NULL;
- rtl_uString * crashrep_path = NULL;
- rtl_String * crashrep_path_system = NULL;
- rtl_string2UString(
- &crashrep_url,
- RTL_CONSTASCII_USTRINGPARAM(
- "$BRAND_BASE_DIR/program/crashrep"),
- OSTRING_TO_OUSTRING_CVTFLAGS);
- rtl_bootstrap_expandMacros(&crashrep_url);
- osl_getSystemPathFromFileURL(crashrep_url, &crashrep_path);
- rtl_uString2String(
- &crashrep_path_system,
- rtl_uString_getStr(crashrep_path),
- rtl_uString_getLength(crashrep_path),
- osl_getThreadTextEncoding(),
- (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR
- | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR));
- rtl_uString_release(crashrep_url);
- rtl_uString_release(crashrep_path);
-#if defined INCLUDE_BACKTRACE && (defined LINUX || defined MACOSX)
- snprintf( szShellCmd, SAL_N_ELEMENTS(szShellCmd),
- "%s -p %d -s %d -xml %s -chksum %s -stack %s -noui%s",
- rtl_string_getStr(crashrep_path_system),
- getpid(),
- Signal,
- pXMLTempName,
- pChecksumTempName,
- pStackTempName,
- bAutoCrashReport ? " -send" : "" );
-#elif defined INCLUDE_BACKTRACE && defined SOLARIS
- snprintf( szShellCmd, SAL_N_ELEMENTS(szShellCmd),
- "%s -p %d -s %d -xml %s -chksum %s -noui%s",
- rtl_string_getStr(crashrep_path_system),
- getpid(),
- Signal,
- pXMLTempName,
- pChecksumTempName,
- bAutoCrashReport ? " -send" : "" );
-#else
- snprintf( szShellCmd, SAL_N_ELEMENTS(szShellCmd),
- "%s -p %d -s %d -noui%s",
- rtl_string_getStr(crashrep_path_system),
- getpid(), Signal, bAutoCrashReport ? " -send" : "" );
-#endif
- rtl_string_release(crashrep_path_system);
- }
-
- ret = szShellCmd[0] == '\0' ? -1 : system( szShellCmd );
-
- if ( pXMLTempName )
- unlink( pXMLTempName );
-
- if ( pStackTempName )
- unlink( pStackTempName );
-
- if ( pChecksumTempName )
- unlink( pChecksumTempName );
-
- if ( -1 != ret )
- {
- bCrashReporterExecuted = true;
- return 1;
- }
- else
- return -1;
-
- }
- }
-
- return 0;
- }
-
- return 1;
-#else /* HAVE_FEATURE_CRASHDUMP */
- /* the utility crash_report is not build, so do the same as when
- the option -nocrashreport is used */
- (void) Signal; // avoid warnings
- return -1;
-#endif /* HAVE_FEATURE_CRASHDUMP */
-}
-
static void PrintStack( int sig )
{
#ifdef INCLUDE_BACKTRACE
@@ -868,7 +359,6 @@ void CallSystemHandler(int Signal)
break;
case ACT_ABORT: /* terminate witch core dump */
- ReportCrash( Signal );
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigemptyset(&(act.sa_mask));
@@ -956,8 +446,6 @@ void SignalHandlerFunction(int Signal)
break;
}
- ReportCrash( Signal );
-
switch (CallSignalHandler(&Info))
{
case osl_Signal_ActCallNextHdl:
@@ -965,7 +453,6 @@ void SignalHandlerFunction(int Signal)
break;
case osl_Signal_ActAbortApp:
- ReportCrash( Signal );
act.sa_handler = SIG_DFL;
act.sa_flags = 0;
sigemptyset(&(act.sa_mask));
diff --git a/sal/osl/w32/signal.cxx b/sal/osl/w32/signal.cxx
index 8236bfc3d1f9..470c1f622675 100644
--- a/sal/osl/w32/signal.cxx
+++ b/sal/osl/w32/signal.cxx
@@ -99,131 +99,12 @@ static oslSignalAction CallSignalHandler(oslSignalInfo *pInfo)
/* SignalHandlerFunction */
/*****************************************************************************/
-#define REPORTENV_PARAM "-crashreportenv:"
-#define REPORTENV_PARAM2 "/crashreportenv:"
-
-static BOOL ReportCrash( LPEXCEPTION_POINTERS lpEP )
-{
- BOOL fSuccess = FALSE;
- BOOL fAutoReport = FALSE;
- TCHAR szBuffer[1024];
- ::osl::LongPathBuffer< sal_Char > aPath( MAX_LONG_PATH );
- LPTSTR lpFilePart;
- PROCESS_INFORMATION ProcessInfo;
- STARTUPINFO StartupInfo;
- int argi;
-
- if ( !bErrorReportingEnabled )
- return FALSE;
-
- /* Check if crash reporter was disabled by command line */
-
- for ( argi = 1; argi < __argc; argi++ )
- {
- if (
- 0 == stricmp( __argv[argi], "--nocrashreport" ) ||
- 0 == stricmp( __argv[argi], "/nocrashreport" )
- )
- return FALSE;
- else if (
- 0 == stricmp( __argv[argi], "--autocrashreport" ) ||
- 0 == stricmp( __argv[argi], "/autocrashreport" )
- )
- fAutoReport = TRUE;
- else if (
- 0 == strnicmp( __argv[argi], REPORTENV_PARAM, strlen(REPORTENV_PARAM) ) ||
- 0 == strnicmp( __argv[argi], REPORTENV_PARAM2, strlen(REPORTENV_PARAM2) )
- )
- {
- const char *envparam = __argv[argi] + strlen(REPORTENV_PARAM);
- const char *delim = strchr(envparam, '=' );
-
- if ( delim )
- {
- CHAR *lpVariable;
- CHAR *lpValue;
- const char *variable = envparam;
- size_t variable_len = delim - envparam;
- const char *value = delim + 1;
- size_t value_len = strlen(envparam) - variable_len - 1;
-
- if ( '\"' == *value )
- {
- const char *quote;
-
- value++;
- value_len--;
-
- quote = strchr( value, '\"' );
- if ( quote )
- value_len = quote - value;
- }
-
- lpVariable = reinterpret_cast< CHAR* >( _alloca( variable_len + 1 ) );
- memcpy( lpVariable, variable, variable_len );
- lpVariable[variable_len] = 0;
-
- lpValue = reinterpret_cast< CHAR* >( _alloca( value_len + 1) );
- memcpy( lpValue, value, value_len );
- lpValue[value_len] = 0;
-
- SetEnvironmentVariable( lpVariable, lpValue );
- }
- }
- }
-
- if ( SearchPath( NULL, TEXT( "crashrep.exe" ), NULL, aPath.getBufSizeInSymbols(), aPath, &lpFilePart ) )
- {
- ZeroMemory( &StartupInfo, sizeof(StartupInfo) );
- StartupInfo.cb = sizeof(StartupInfo.cb);
-
- sntprintf( szBuffer, SAL_N_ELEMENTS(szBuffer),
- _T("%s -p %lu -excp 0x%p -t %lu%s"),
- static_cast<sal_Char*>( aPath ),
- GetCurrentProcessId(),
- lpEP,
- GetCurrentThreadId(),
- fAutoReport ? _T(" -noui -send") : _T(" -noui") );
-
- if (
- CreateProcess(
- NULL,
- szBuffer,
- NULL,
- NULL,
- FALSE,
-#ifdef UNICODE
- CREATE_UNICODE_ENVIRONMENT,
-#else
- 0,
-#endif
- NULL, NULL, &StartupInfo, &ProcessInfo )
- )
- {
- DWORD dwExitCode;
-
- WaitForSingleObject( ProcessInfo.hProcess, INFINITE );
- if ( GetExitCodeProcess( ProcessInfo.hProcess, &dwExitCode ) && 0 == dwExitCode )
-
- fSuccess = TRUE;
-
- }
- }
-
- return fSuccess;
-}
-
-/*****************************************************************************/
-/* SignalHandlerFunction */
-/*****************************************************************************/
-
/* magic Microsoft C++ compiler exception constant */
#define EXCEPTION_MSC_CPP_EXCEPTION 0xe06d7363
static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
{
static sal_Bool bNested = sal_False;
- sal_Bool bRaiseCrashReporter = sal_False;
oslSignalInfo Info;
oslSignalAction Action;
@@ -238,17 +119,14 @@ static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
case EXCEPTION_MSC_CPP_EXCEPTION:
case EXCEPTION_ACCESS_VIOLATION:
Info.Signal = osl_Signal_AccessViolation;
- bRaiseCrashReporter = sal_True;
break;
case EXCEPTION_INT_DIVIDE_BY_ZERO:
Info.Signal = osl_Signal_IntegerDivideByZero;
- bRaiseCrashReporter = sal_True;
break;
case EXCEPTION_FLT_DIVIDE_BY_ZERO:
Info.Signal = osl_Signal_FloatDivideByZero;
- bRaiseCrashReporter = sal_True;
break;
case EXCEPTION_BREAKPOINT:
@@ -257,21 +135,13 @@ static long WINAPI SignalHandlerFunction(LPEXCEPTION_POINTERS lpEP)
default:
Info.Signal = osl_Signal_System;
- bRaiseCrashReporter = sal_True;
break;
}
if ( !bNested )
{
bNested = sal_True;
-
- if ( bRaiseCrashReporter && ReportCrash( lpEP ) )
- {
- CallSignalHandler(&Info);
- Action = osl_Signal_ActKillApp;
- }
- else
- Action = CallSignalHandler(&Info);
+ Action = CallSignalHandler(&Info);
}
else
Action = osl_Signal_ActKillApp;
diff --git a/scp2/AutoInstall.mk b/scp2/AutoInstall.mk
index 30b0baff89b6..4983fc7bb406 100644
--- a/scp2/AutoInstall.mk
+++ b/scp2/AutoInstall.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_AutoInstall_add_module,base_brand,,LIBO_EXECUTABLE))
$(eval $(call gb_AutoInstall_add_module,brand,,LIBO_EXECUTABLE))
$(eval $(call gb_AutoInstall_add_module,calc,LIBO_LIB_FILE))
$(eval $(call gb_AutoInstall_add_module,calc_brand,,LIBO_EXECUTABLE))
-$(eval $(call gb_AutoInstall_add_module,crashrep,,LIBO_EXECUTABLE))
$(eval $(call gb_AutoInstall_add_module,draw_brand,,LIBO_EXECUTABLE))
$(eval $(call gb_AutoInstall_add_module,extensions_ct2n,,,,))
$(eval $(call gb_AutoInstall_add_module,extensions_bsh,,,LIBO_JAR_FILE))
diff --git a/scp2/InstallModule_crashrep.mk b/scp2/InstallModule_crashrep.mk
deleted file mode 100644
index 1a72e1415708..000000000000
--- a/scp2/InstallModule_crashrep.mk
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_InstallModule_InstallModule,scp2/crashrep))
-
-$(eval $(call gb_InstallModule_use_auto_install_libs,scp2/crashrep,\
- crashrep \
-))
-
-$(eval $(call gb_InstallModule_add_scpfiles,scp2/crashrep,\
- scp2/source/crashrep/file_crashrep \
-))
-
-# vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk
index baa872627a8d..ab776cc2cee1 100644
--- a/scp2/InstallScript_setup_osl.mk
+++ b/scp2/InstallScript_setup_osl.mk
@@ -30,9 +30,6 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
scp2/winexplorerext \
) \
) \
- $(if $(filter TRUE,$(ENABLE_CRASHDUMP)),\
- scp2/crashrep \
- ) \
$(if $(WITH_EXTENSION_INTEGRATION),\
scp2/extensions \
) \
diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk
index be02cd87a9da..2db4fc7e966d 100644
--- a/scp2/Module_scp2.mk
+++ b/scp2/Module_scp2.mk
@@ -39,9 +39,6 @@ $(eval $(call gb_Module_add_targets,scp2,\
InstallModule_winexplorerext \
) \
) \
- $(if $(filter TRUE,$(ENABLE_CRASHDUMP)),\
- InstallModule_crashrep \
- ) \
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GCONF) $(ENABLE_GNOMEVFS) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
InstallModule_gnome \
) \
diff --git a/scp2/source/crashrep/file_crashrep.scp b/scp2/source/crashrep/file_crashrep.scp
deleted file mode 100644
index e5021465be03..000000000000
--- a/scp2/source/crashrep/file_crashrep.scp
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "macros.inc"
-
-// crashreporter files
-
-#ifdef WNT
-
-File gid_Brand_File_Lib_Dbghelp
- LIB_FILE_BODY;
- Name = "dbghelp.dll";
- Dir = gid_Brand_Dir_Program;
- Styles = (PACKED);
-End
-
-#endif
diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 88d8166ba889..7a4e5b1bfa2c 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -28,7 +28,6 @@
#include "macros.inc"
#include "AutoInstall/brand"
-#include "AutoInstall/crashrep"
#include "config_folders.h"
@@ -54,9 +53,7 @@ Module gid_Module_Root_Brand
gid_Brand_Dir_Share_Labels,
gid_Brand_Dir_Share_Registry,
gid_Brand_Dir_Share_Xdg);
- Files = (auto_crashrep_ALL,
- auto_brand_ALL,
- gid_Brand_File_Bin_Crashreport_Script,
+ Files = (auto_brand_ALL,
gid_Brand_File_Gdb_Trace,
gid_Brand_File_Bin_Soffice,
gid_Brand_File_Bin_Soffice_Bin_Manifest,