1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
|
/*
Miranda Crash Dumper Plugin
Copyright (C) 2008 - 2012 Boris Krasnovskiy All Rights Reserved
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation version 2
of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <windows.h>
#include <windowsx.h>
#include <richedit.h>
#include <delayimp.h>
#include <malloc.h>
#include <newpluginapi.h>
#include <m_utils.h>
#include <m_langpack.h>
#include <m_clist.h>
#include <m_skin.h>
#include <m_hotkeys.h>
#include <m_protocols.h>
#include <m_icolib.h>
#include <m_options.h>
#include <m_popup.h>
#include <m_netlib.h>
#include <m_string.h>
#include <m_db_int.h>
#include <m_gui.h>
#include "m_folders.h"
#include "m_toptoolbar.h"
#include "sdkstuff.h"
#include "version.h"
#include "resource.h"
#define crsi_u2a(dst, src) \
{ \
int cbLen = WideCharToMultiByte(CP_ACP, 0, src, -1, NULL, 0, NULL, NULL); \
dst = (char*)alloca(cbLen+1); \
WideCharToMultiByte(CP_ACP, 0, src, -1, dst, cbLen, NULL, NULL); \
}
#define crsi_a2u(dst, src, alloc) \
{ \
int cbLen = MultiByteToWideChar(CP_ACP, 0, src, -1, NULL, 0); \
dst = (wchar_t*)alloc(sizeof(wchar_t) * (cbLen+1)); \
MultiByteToWideChar(CP_ACP, 0, src, -1, dst, cbLen); \
}
#define crsi_t2a(d,s) crsi_u2a(d,s)
#define crsi_a2t(d,s) crsi_a2u(d,s,alloca)
#define crs_a2t(d,s) crsi_a2u(d,s,mir_alloc)
#define MS_CRASHDUMPER_STORETOFILE "CrashDmp/StoreVerInfoToFile"
#define MS_CRASHDUMPER_STORETOCLIP "CrashDmp/StoreVerInfoToClip"
#define MS_CRASHDUMPER_GETINFO "CrashDmp/GetInfo"
#define MS_CRASHDUMPER_VIEWINFO "CrashDmp/ViewInfo"
#define MS_CRASHDUMPER_UPLOAD "CrashDmp/UploadInfo"
#define MS_CRASHDUMPER_URL "CrashDmp/StartUrl"
#define MS_CRASHDUMPER_URLTOCLIP "CrashDmp/CopyToClip"
#define MODULENAME "Crash Dumper"
struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin();
int Load() override;
int Unload() override;
};
#define VI_FLAG_FORMAT 1
#define VI_FLAG_PRNVAR 2
#define VI_FLAG_PRNDLL 4
#define VI_FLAG_WEATHER 8
struct VerTrnsfr
{
char* buf;
bool autot;
};
extern LCID packlcid;
extern bool servicemode, clsdates, dtsubfldr, catchcrashes, needrestart;
extern wchar_t CrashLogFolder[MAX_PATH];
extern wchar_t VersionInfoFolder[MAX_PATH];
void WriteBBFile(CMStringW& buffer, bool hdr);
void WriteUtfFile(HANDLE hDumpFile, char* bufu);
LONG WINAPI myfilter(PEXCEPTION_POINTERS exc_ptr);
LONG WINAPI myfilterv(PEXCEPTION_POINTERS exc_ptr);
DWORD MirandaThreadFilter(DWORD code, EXCEPTION_POINTERS* info);
void GetInternetExplorerVersion(CMStringW& buffer);
void GetProcessorString(CMStringW& buffer);
void GetFreeMemoryString(CMStringW& buffer);
void GetFreeDiskString(LPCTSTR dirname, CMStringW& buffer);
void GetAdminString(CMStringW& buffer);
void GetLanguageString(CMStringW& buffer);
void GetLanguagePackString(CMStringW& buffer);
void GetWow64String(CMStringW& buffer);
void GetVersionInfo(HMODULE hLib, CMStringW& buffer);
void GetISO8061Time(SYSTEMTIME* stLocal, LPTSTR lpszString, DWORD dwSize);
void ReadableExceptionInfo(PEXCEPTION_RECORD excrec, CMStringW& buffer);
void GetLastWriteTime(LPCTSTR fileName, LPTSTR lpszString, DWORD dwSize);
void GetLastWriteTime(FILETIME* ftime, LPTSTR lpszString, DWORD dwSize);
void StoreStringToClip(CMStringW& buffer);
void ShowMessage(int type, const wchar_t* format, ...);
bool IsPluginEnabled(wchar_t* filename);
const PLUGININFOEX* GetMirInfo(HMODULE hModule);
void CreateMiniDump(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr);
void CreateCrashReport(HANDLE hDumpFile, PEXCEPTION_POINTERS exc_ptr, const wchar_t* msg);
void PrintVersionInfo(CMStringW& buffer, unsigned flags = VI_FLAG_PRNVAR);
bool ProcessVIHash(bool store);
void InitExceptionHandler(void);
void DestroyExceptionHandler(void);
void SetExceptionHandler(void);
void RemoveExceptionHandler(void);
extern CDlgBase *pViewDialog;
//INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//INT_PTR CALLBACK DlgProcView(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void DestroyAllWindows(void);
void UploadInit(void);
void UploadClose(void);
void OpenAuthUrl(const char* url);
void __cdecl VersionInfoUploadThread(void* arg);
void InitIcons(void);
HICON LoadIconEx(int iconId, bool big = false);
void ReleaseIconEx(int iconId);
HANDLE GetIconHandle(int iconId);
class COptDialog : public CDlgBase
{
private:
CCtrlEdit m_edtUserName, m_edtPass;
CCtrlCheck m_chkAutoUpload, m_chkClassicDates, m_chkRepSubfolder, m_chkCatchCrashes;
CCtrlLabel m_lblRestart;
protected:
bool OnInitDialog() override;
bool OnApply() override;
void OnCatchCrashesChange(CCtrlCheck*);
public:
COptDialog();
};
class CViewVersionInfo : public CDlgBase
{
private:
DWORD m_flags;
CCtrlButton m_btnCancel, m_btnCopyClip, m_btnCopyFile;
CCtrlRichEdit m_redtViewVersionInfo;
protected:
bool OnInitDialog() override;
bool OnClose() override;
int Resizer(UTILRESIZECONTROL*) override;
INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override;
void OnCancelClick(CCtrlBase*);
void OnCopyClipClick(CCtrlBase*);
void OnCopyFileClick(CCtrlBase*);
void OnViewVersionInfoBuildMenu(CCtrlBase*);
public:
CViewVersionInfo(DWORD flags);
};
|