Process Hacker
Main Page
Namespaces
Data Structures
Files
File List
Globals
Process Hacker
Namespaces
Data Structures
Files
File List
KProcessHacker
phlib
plugins
DotNetTools
ExtendedNotifications
ExtendedServices
ExtendedTools
include
NetAdapters
NetworkTools
OnlineChecks
SamplePlugin
SbieSupport
ToolStatus
Updater
main.c
options.c
resource.h
updater.c
updater.h
UserNotes
WindowExplorer
ProcessHacker
tests
tools
Globals
updater.h
Go to the documentation of this file.
1
/*
2
* Process Hacker Plugins -
3
* Update Checker Plugin
4
*
5
* Copyright (C) 2011-2015 dmex
6
*
7
* This file is part of Process Hacker.
8
*
9
* Process Hacker is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* Process Hacker is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with Process Hacker. If not, see <http://www.gnu.org/licenses/>.
21
*/
22
23
#ifndef __UPDATER_H__
24
#define __UPDATER_H__
25
26
#pragma comment(lib, "Winhttp.lib")
27
28
#define CINTERFACE
29
#define COBJMACROS
30
#define INITGUID
31
#include <
phdk.h
>
32
#include <phappresource.h>
33
#include <
mxml.h
>
34
#include <windowsx.h>
35
#include <netlistmgr.h>
36
#include <winhttp.h>
37
#include <Wincodec.h>
38
39
#include "
resource.h
"
40
41
// Force update checks to succeed with debug builds
42
//#define DEBUG_UPDATE
43
#define UPDATE_MENUITEM 1001
44
#define PH_UPDATEISERRORED (WM_APP + 101)
45
#define PH_UPDATEAVAILABLE (WM_APP + 102)
46
#define PH_UPDATEISCURRENT (WM_APP + 103)
47
#define PH_UPDATENEWER (WM_APP + 104)
48
#define PH_UPDATESUCCESS (WM_APP + 105)
49
#define PH_UPDATEFAILURE (WM_APP + 106)
50
#define WM_SHOWDIALOG (WM_APP + 150)
51
52
#define PLUGIN_NAME L"ProcessHacker.UpdateChecker"
53
#define SETTING_NAME_AUTO_CHECK (PLUGIN_NAME L".PromptStart")
54
55
#define MAKEDLLVERULL(major, minor, build, revision) \
56
(((ULONGLONG)(major) << 48) | \
57
((ULONGLONG)(minor) << 32) | \
58
((ULONGLONG)(build) << 16) | \
59
((ULONGLONG)(revision) << 0))
60
61
#define Control_Visible(hWnd, visible) \
62
ShowWindow(hWnd, visible ? SW_SHOW : SW_HIDE);
63
64
extern
PPH_PLUGIN
PluginInstance
;
65
66
typedef
enum
_PH_UPDATER_STATE
67
{
68
PhUpdateDefault
= 0,
69
PhUpdateDownload
= 1,
70
PhUpdateInstall
= 2,
71
PhUpdateMaximum
= 3
72
}
PH_UPDATER_STATE
;
73
74
typedef
struct
_PH_UPDATER_CONTEXT
75
{
76
BOOLEAN
HaveData
;
77
PH_UPDATER_STATE
UpdaterState
;
78
HBITMAP
IconBitmap
;
79
HICON
IconHandle
;
80
HFONT
FontHandle
;
81
HWND
StatusHandle
;
82
HWND
ProgressHandle
;
83
HWND
DialogHandle
;
84
85
ULONG
MinorVersion
;
86
ULONG
MajorVersion
;
87
ULONG
RevisionVersion
;
88
ULONG
CurrentMinorVersion
;
89
ULONG
CurrentMajorVersion
;
90
ULONG
CurrentRevisionVersion
;
91
PPH_STRING
UserAgent
;
92
PPH_STRING
Version
;
93
PPH_STRING
RevVersion
;
94
PPH_STRING
RelDate
;
95
PPH_STRING
Size
;
96
PPH_STRING
Hash
;
97
PPH_STRING
ReleaseNotesUrl
;
98
PPH_STRING
SetupFileDownloadUrl
;
99
PPH_STRING
SetupFilePath
;
100
}
PH_UPDATER_CONTEXT
, *
PPH_UPDATER_CONTEXT
;
101
102
VOID
ShowUpdateDialog
(
103
_In_opt_ PPH_UPDATER_CONTEXT Context
104
);
105
106
VOID
StartInitialCheck
(
107
VOID
108
);
109
110
PPH_STRING
PhGetOpaqueXmlNodeText
(
111
_In_
mxml_node_t
*xmlNode
112
);
113
114
BOOL
PhInstalledUsingSetup
(
115
VOID
116
);
117
118
INT_PTR CALLBACK
UpdaterWndProc
(
119
_In_ HWND hwndDlg,
120
_In_ UINT uMsg,
121
_In_ WPARAM wParam,
122
_In_ LPARAM lParam
123
);
124
125
INT_PTR CALLBACK
OptionsDlgProc
(
126
_In_ HWND hwndDlg,
127
_In_ UINT uMsg,
128
_In_ WPARAM wParam,
129
_In_ LPARAM lParam
130
);
131
132
#endif
plugins
Updater
updater.h
Generated by
1.8.2