forked from winsiderss/systeminformer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabout.c
More file actions
191 lines (168 loc) · 5.45 KB
/
Copy pathabout.c
File metadata and controls
191 lines (168 loc) · 5.45 KB
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
/*
* Process Hacker -
* about dialog
*
* Copyright (C) 2010-2016 wj32
* Copyright (C) 2017 dmex
*
* This file is part of Process Hacker.
*
* Process Hacker 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, either version 3 of the License, or
* (at your option) any later version.
*
* Process Hacker 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 Process Hacker. If not, see <http://www.gnu.org/licenses/>.
*/
#include <phapp.h>
#include <windowsx.h>
#include <symprv.h>
#include <hndlprv.h>
#include <memprv.h>
#include <modprv.h>
#include <netprv.h>
#include <phappres.h>
#include <procprv.h>
#include <srvprv.h>
#include <thrdprv.h>
static INT_PTR CALLBACK PhpAboutDlgProc(
_In_ HWND hwndDlg,
_In_ UINT uMsg,
_In_ WPARAM wParam,
_In_ LPARAM lParam
)
{
switch (uMsg)
{
case WM_INITDIALOG:
{
PPH_STRING appName;
PhCenterWindow(hwndDlg, GetParent(hwndDlg));
#if (PHAPP_VERSION_REVISION != 0)
appName = PhFormatString(
L"Process Hacker %u.%u.%u",
PHAPP_VERSION_MAJOR,
PHAPP_VERSION_MINOR,
PHAPP_VERSION_REVISION
);
#else
appName = PhFormatString(
L"Process Hacker %u.%u",
PHAPP_VERSION_MAJOR,
PHAPP_VERSION_MINOR
);
#endif
SetDlgItemText(hwndDlg, IDC_ABOUT_NAME, appName->Buffer);
PhDereferenceObject(appName);
SetDlgItemText(hwndDlg, IDC_CREDITS,
L"Thanks to:\n"
L" <a href=\"https://github.com/wj32\">wj32</a> - Wen Jia Liu\n"
L" <a href=\"https://github.com/dmex\">dmex</a> - Steven G\n"
L" <a href=\"https://github.com/xhmikosr\">XhmikosR</a>\n"
L" Donors - thank you for your support!\n\n"
L"Process Hacker uses the following components:\n"
L" <a href=\"http://www.minixml.org\">Mini-XML</a> by Michael Sweet\n"
L" <a href=\"http://www.pcre.org\">PCRE</a>\n"
L" MD5 code by Jouni Malinen\n"
L" SHA1 code by Filip Navara, based on code by Steve Reid\n"
L" <a href=\"http://www.famfamfam.com/lab/icons/silk\">Silk icons</a>\n"
L" <a href=\"http://www.fatcow.com/free-icons\">Farm-fresh web icons</a>\n"
);
SendMessage(hwndDlg, WM_NEXTDLGCTL, (LPARAM)GetDlgItem(hwndDlg, IDOK), TRUE);
}
break;
case WM_COMMAND:
{
switch (GET_WM_COMMAND_ID(wParam, lParam))
{
case IDCANCEL:
case IDOK:
EndDialog(hwndDlg, IDOK);
break;
case IDC_DIAGNOSTICS:
{
PhShowInformationDialog(hwndDlg, PH_AUTO_T(PH_STRING, PhGetDiagnosticsString())->Buffer, 0);
}
break;
}
}
break;
case WM_NOTIFY:
{
LPNMHDR header = (LPNMHDR)lParam;
switch (header->code)
{
case NM_CLICK:
{
switch (header->idFrom)
{
case IDC_CREDITS:
case IDC_LINK_SF:
PhShellExecute(hwndDlg, ((PNMLINK)header)->item.szUrl, NULL);
break;
}
}
break;
}
}
break;
}
return FALSE;
}
VOID PhShowAboutDialog(
_In_ HWND ParentWindowHandle
)
{
DialogBox(
PhInstanceHandle,
MAKEINTRESOURCE(IDD_ABOUT),
ParentWindowHandle,
PhpAboutDlgProc
);
}
FORCEINLINE ULONG PhpGetObjectTypeObjectCount(
_In_ PPH_OBJECT_TYPE ObjectType
)
{
PH_OBJECT_TYPE_INFORMATION info;
PhGetObjectTypeInformation(ObjectType, &info);
return info.NumberOfObjects;
}
PPH_STRING PhGetDiagnosticsString(
VOID
)
{
PH_STRING_BUILDER stringBuilder;
PhInitializeStringBuilder(&stringBuilder, 50);
PhAppendFormatStringBuilder(&stringBuilder, L"OBJECT INFORMATION\r\n");
#define OBJECT_TYPE_COUNT(Type) PhAppendFormatStringBuilder(&stringBuilder, \
L#Type L": %u objects\r\n", PhpGetObjectTypeObjectCount(Type))
// ref
OBJECT_TYPE_COUNT(PhObjectTypeObject);
// basesup
OBJECT_TYPE_COUNT(PhStringType);
OBJECT_TYPE_COUNT(PhBytesType);
OBJECT_TYPE_COUNT(PhListType);
OBJECT_TYPE_COUNT(PhPointerListType);
OBJECT_TYPE_COUNT(PhHashtableType);
OBJECT_TYPE_COUNT(PhFileStreamType);
// ph
OBJECT_TYPE_COUNT(PhSymbolProviderType);
OBJECT_TYPE_COUNT(PhProcessItemType);
OBJECT_TYPE_COUNT(PhServiceItemType);
OBJECT_TYPE_COUNT(PhNetworkItemType);
OBJECT_TYPE_COUNT(PhModuleProviderType);
OBJECT_TYPE_COUNT(PhModuleItemType);
OBJECT_TYPE_COUNT(PhThreadProviderType);
OBJECT_TYPE_COUNT(PhThreadItemType);
OBJECT_TYPE_COUNT(PhHandleProviderType);
OBJECT_TYPE_COUNT(PhHandleItemType);
OBJECT_TYPE_COUNT(PhMemoryItemType);
return PhFinalStringBuilderString(&stringBuilder);
}