Skip to content

Commit 937a465

Browse files
committed
Updater: Fix nightly link, Fix changelog text;
1 parent 490ac4f commit 937a465

File tree

8 files changed

+57
-6
lines changed

8 files changed

+57
-6
lines changed

plugins/CommonUtil/json.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ PSTR UtilGetJsonValueAsString(
6161
return json_object_get_string(json_get_object(Object, Key));
6262
}
6363

64-
int64_t UtilGetJsonValueAsUlong(
64+
INT64 UtilGetJsonValueAsUlong(
6565
_In_ PVOID Object,
6666
_In_ PSTR Key
6767
)
@@ -130,6 +130,14 @@ PSTR UtilGetJsonArrayString(
130130
return _strdup( json_object_to_json_string(Object) ); // leak
131131
}
132132

133+
INT64 UtilGetJsonArrayUlong(
134+
_In_ PVOID Object,
135+
_In_ INT Index
136+
)
137+
{
138+
return json_object_get_int64(json_object_array_get_idx(Object, Index));
139+
}
140+
133141
INT UtilGetArrayLength(
134142
_In_ PVOID Object
135143
)

plugins/CommonUtil/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ COMMONUTIL_INTERFACE PluginInterface =
4343
UtilCreateJsonArray,
4444
UtilAddJsonArray,
4545
UtilGetJsonArrayString,
46+
UtilGetJsonArrayUlong,
4647
UtilGetArrayLength,
4748
UtilGetObjectArrayIndex,
4849
UtilGetObjectArrayList

plugins/CommonUtil/main.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ PSTR UtilGetJsonArrayString(
145145
_In_ PVOID Object
146146
);
147147

148+
INT64 UtilGetJsonArrayUlong(
149+
_In_ PVOID Object,
150+
_In_ INT Index
151+
);
152+
148153
INT UtilGetArrayLength(
149154
_In_ PVOID Object
150155
);

plugins/Updater/CHANGELOG.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
2.0
2-
* Major rewrite of updater
2+
* Added support for Process Hacker nightly builds
33
* Improved UI with native TaskDialog
44

55
1.8

plugins/Updater/Updater.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ BEGIN
9797
CONTROL "Check for updates automatically",IDC_AUTOCHECKBOX,
9898
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,142,10
9999
DEFPUSHBUTTON "Close",IDCANCEL,158,33,50,14
100-
CONTROL "Check for nightly builds",IDC_NIGHTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,18,142,10
100+
CONTROL "Check for nightly builds",IDC_NIGHTLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,19,142,10
101101
END
102102

103103

plugins/Updater/page3.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,14 @@ HRESULT CALLBACK ShowAvailableCallbackProc(
5656
}
5757
else
5858
{
59-
PhShellExecute(hwndDlg, L"https://wj32.org/processhacker/downloads.php", NULL);
59+
if (PhGetIntegerSetting(SETTING_NAME_NIGHTLY_BUILD))
60+
{
61+
PhShellExecute(hwndDlg, L"https://wj32.org/processhacker/nightly.php", NULL);
62+
}
63+
else
64+
{
65+
PhShellExecute(hwndDlg, L"https://wj32.org/processhacker/downloads.php", NULL);
66+
}
6067
}
6168
}
6269
}

plugins/UserNotes/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,9 @@ VOID NTAPI MenuHookCallback(
630630

631631
LockDb();
632632

633-
// Update the process affinity in our database (if the database values are different).
634633
if (object = FindDbObjectForProcess(processItem, INTENT_PROCESS_AFFINITY))
635634
{
635+
// Update the process affinity in our database (if the database values are different).
636636
if (object->AffinityMask != (ULONG)newAffinityMask)
637637
{
638638
object->AffinityMask = (ULONG)newAffinityMask;

plugins/include/commonutil.h

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ typedef PSTR (NTAPI *PUTIL_GET_JSON_ARRAY_STRING)(
9696
_In_ PVOID Object
9797
);
9898

99+
typedef INT64 (NTAPI *PUTIL_GET_JSON_OBJECT_ARRAY_ULONG)(
100+
_In_ PVOID Object,
101+
_In_ INT Index
102+
);
103+
99104
typedef INT (NTAPI *PUTIL_GET_JSON_ARRAY_LENGTH)(
100105
_In_ PVOID Object
101106
);
@@ -134,6 +139,7 @@ typedef struct _COMMONUTIL_INTERFACE
134139
PUTIL_CREATE_JSON_ARRAY CreateJsonArray;
135140
PUTIL_ADD_JSON_OBJECT_VALUE JsonArrayAddObject;
136141
PUTIL_GET_JSON_ARRAY_STRING GetJsonArrayString;
142+
PUTIL_GET_JSON_OBJECT_ARRAY_ULONG GetJsonArrayUlong;
137143
PUTIL_GET_JSON_ARRAY_LENGTH JsonGetArrayLength;
138144
PUTIL_GET_JSON_OBJECT_ARRAY_INDEX JsonGetObjectArrayIndex;
139145
PUTIL_GET_JSON_OBJECT_ARRAY_LIST JsonGetObjectArrayList;
@@ -367,6 +373,31 @@ GetJsonArrayString(
367373
return NULL;
368374
}
369375

376+
FORCEINLINE
377+
INT64
378+
GetJsonArrayUlong(
379+
_In_ PVOID Object,
380+
_In_ INT Index
381+
)
382+
{
383+
PPH_PLUGIN toolStatusPlugin;
384+
385+
if (toolStatusPlugin = PhFindPlugin(COMMONUTIL_PLUGIN_NAME))
386+
{
387+
P_COMMONUTIL_INTERFACE Interface;
388+
389+
if (Interface = PhGetPluginInformation(toolStatusPlugin)->Interface)
390+
{
391+
if (Interface->Version <= COMMONUTIL_INTERFACE_VERSION)
392+
{
393+
return Interface->GetJsonArrayUlong(Object, Index);
394+
}
395+
}
396+
}
397+
398+
return 0;
399+
}
400+
370401
FORCEINLINE
371402
INT
372403
JsonGetArrayLength(
@@ -440,7 +471,6 @@ JsonGetObjectArrayList(
440471
return NULL;
441472
}
442473

443-
444474
FORCEINLINE
445475
PVOID
446476
CreateJsonObject(

0 commit comments

Comments
 (0)