peview: Add settings support for all tabs, Move settings support from main into phlib
This commit is contained in:
+1
-1
@@ -75,7 +75,7 @@ Desktop.ini
|
||||
|
||||
build/*.exe
|
||||
build/*.zip
|
||||
ProcessHacker/include/phapprev.h
|
||||
build/*.h
|
||||
ProcessHacker/sdk/phapppub.h
|
||||
plugins-extra/
|
||||
/sdk/
|
||||
|
||||
@@ -523,6 +523,33 @@ EXPORTS
|
||||
PhInitializeMappedImage
|
||||
PhLoadMappedImage
|
||||
|
||||
; settings
|
||||
PhAddSetting
|
||||
PhAddSettings
|
||||
PhClearIgnoredSettings
|
||||
PhConvertIgnoredSettings
|
||||
PhGetIntegerSetting
|
||||
PhGetIntegerPairSetting
|
||||
PhGetScalableIntegerPairSetting
|
||||
PhGetStringSetting
|
||||
PhLoadSettings
|
||||
PhLoadListViewColumnSettings
|
||||
PhLoadListViewColumnsFromSetting
|
||||
PhLoadWindowPlacementFromSetting
|
||||
PhResetSettings
|
||||
PhSaveListViewColumnSettings
|
||||
PhSaveListViewColumnsToSetting
|
||||
PhSaveWindowPlacementToSetting
|
||||
PhSettingsInitialization
|
||||
PhSetIntegerSetting
|
||||
PhSetIntegerPairSetting
|
||||
PhSetScalableIntegerPairSetting
|
||||
PhSetScalableIntegerPairSetting2
|
||||
PhSetStringSetting
|
||||
PhSetStringSetting2
|
||||
PhSaveSettings
|
||||
PhUpdateCachedSettings
|
||||
|
||||
; secedit
|
||||
PhCreateSecurityPage
|
||||
PhEditSecurity
|
||||
@@ -576,3 +603,12 @@ EXPORTS
|
||||
PhQueueItemWorkQueue
|
||||
PhQueueItemWorkQueueEx
|
||||
PhWaitForWorkQueue
|
||||
|
||||
; mxml
|
||||
mxmlDelete
|
||||
mxmlElementSetAttr
|
||||
mxmlLoadFd
|
||||
mxmlNewOpaque
|
||||
mxmlNewElement
|
||||
mxmlSaveFd
|
||||
mxml_opaque_cb
|
||||
@@ -317,15 +317,6 @@
|
||||
<ClCompile Include="thrdprv.c" />
|
||||
<ClCompile Include="thrdstk.c" />
|
||||
<ClCompile Include="tokprp.c" />
|
||||
<ClCompile Include="mxml\mxml-attr.c" />
|
||||
<ClCompile Include="mxml\mxml-entity.c" />
|
||||
<ClCompile Include="mxml\mxml-file.c" />
|
||||
<ClCompile Include="mxml\mxml-index.c" />
|
||||
<ClCompile Include="mxml\mxml-node.c" />
|
||||
<ClCompile Include="mxml\mxml-private.c" />
|
||||
<ClCompile Include="mxml\mxml-search.c" />
|
||||
<ClCompile Include="mxml\mxml-set.c" />
|
||||
<ClCompile Include="mxml\mxml-string.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\actions.h" />
|
||||
@@ -353,6 +344,7 @@
|
||||
<ClInclude Include="include\procprp.h" />
|
||||
<ClInclude Include="include\procprv.h" />
|
||||
<ClInclude Include="include\proctree.h" />
|
||||
<ClInclude Include="include\phsettings.h" />
|
||||
<ClInclude Include="include\splitter.h" />
|
||||
<ClInclude Include="include\srvlist.h" />
|
||||
<ClInclude Include="include\srvprv.h" />
|
||||
@@ -361,11 +353,8 @@
|
||||
<ClInclude Include="include\thrdprv.h" />
|
||||
<ClInclude Include="include\phuisup.h" />
|
||||
<ClInclude Include="include\miniinfo.h" />
|
||||
<ClInclude Include="mxml\config.h" />
|
||||
<ClInclude Include="include\hidnproc.h" />
|
||||
<ClInclude Include="include\memsrch.h" />
|
||||
<ClInclude Include="mxml\mxml-private.h" />
|
||||
<ClInclude Include="mxml\mxml.h" />
|
||||
<ClInclude Include="include\phapp.h" />
|
||||
<ClInclude Include="include\phsvc.h" />
|
||||
<ClInclude Include="include\phsvcapi.h" />
|
||||
@@ -382,8 +371,6 @@
|
||||
<ClInclude Include="include\procprpp.h" />
|
||||
<ClInclude Include="include\memprv.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="include\settings.h" />
|
||||
<ClInclude Include="include\settingsp.h" />
|
||||
<ClInclude Include="include\sysinfop.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,18 +16,12 @@
|
||||
<Filter Include="PCRE">
|
||||
<UniqueIdentifier>{3fa0b151-12c1-4832-94fb-e16c52584b65}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Mini-XML">
|
||||
<UniqueIdentifier>{eaabb14f-9091-4b18-8764-45c8350f4887}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="phsvc">
|
||||
<UniqueIdentifier>{84a3be0b-42cf-42ae-bcd3-16f165caa0db}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="PCRE\Headers">
|
||||
<UniqueIdentifier>{e72b6c69-b510-4578-9ed5-34a16d8dffc1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Mini-XML\Headers">
|
||||
<UniqueIdentifier>{c4b014d0-6bd0-4848-a23f-e639563d998e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Module">
|
||||
<UniqueIdentifier>{67c40321-0b28-4c16-8c48-dc0b64c148d7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -165,9 +159,6 @@
|
||||
<ClCompile Include="sessprp.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="settings.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="srvcr.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
@@ -189,33 +180,6 @@
|
||||
<ClCompile Include="tokprp.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-attr.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-entity.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-file.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-index.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-node.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-private.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-search.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-set.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-string.c">
|
||||
<Filter>Mini-XML</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="srvctl.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
@@ -414,6 +378,9 @@
|
||||
<ClCompile Include="splitter.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="settings.c">
|
||||
<Filter>Process Hacker</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\hidnproc.h">
|
||||
@@ -437,12 +404,6 @@
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\settings.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\settingsp.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\phsvcapi.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
@@ -506,15 +467,6 @@
|
||||
<ClInclude Include="pcre\pcre2posix.h">
|
||||
<Filter>PCRE\Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\config.h">
|
||||
<Filter>Mini-XML\Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\mxml-private.h">
|
||||
<Filter>Mini-XML\Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\mxml.h">
|
||||
<Filter>Mini-XML\Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\notificop.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
@@ -587,6 +539,9 @@
|
||||
<ClInclude Include="include\splitter.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\phsettings.h">
|
||||
<Filter>Headers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="resources\cross.bmp">
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <apiimport.h>
|
||||
#include <kphuser.h>
|
||||
#include <svcsup.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <hndlprv.h>
|
||||
#include <memprv.h>
|
||||
@@ -43,7 +44,7 @@
|
||||
#include <netprv.h>
|
||||
#include <phsvccl.h>
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
#include <srvprv.h>
|
||||
#include <thrdprv.h>
|
||||
|
||||
|
||||
+2
-124
@@ -30,13 +30,13 @@
|
||||
#include <emenu.h>
|
||||
#include <svcsup.h>
|
||||
#include <symprv.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <actions.h>
|
||||
#include <phappres.h>
|
||||
#include <phsvccl.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
#include "mxml/mxml.h"
|
||||
#include "pcre/pcre2.h"
|
||||
|
||||
typedef LONG (WINAPI *_GetPackageFullName)(
|
||||
@@ -901,20 +901,6 @@ PPH_STRING PhUnescapeStringForDelimiter(
|
||||
return PhFinalStringBuilderString(&stringBuilder);
|
||||
}
|
||||
|
||||
PPH_STRING PhGetOpaqueXmlNodeText(
|
||||
_In_ mxml_node_t *node
|
||||
)
|
||||
{
|
||||
if (node->child && node->child->type == MXML_OPAQUE && node->child->value.opaque)
|
||||
{
|
||||
return PhConvertUtf8ToUtf16(node->child->value.opaque);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PhReferenceEmptyString();
|
||||
}
|
||||
}
|
||||
|
||||
VOID PhSearchOnlineString(
|
||||
_In_ HWND hWnd,
|
||||
_In_ PWSTR String
|
||||
@@ -1184,114 +1170,6 @@ VOID PhSetWindowOpacity(
|
||||
);
|
||||
}
|
||||
|
||||
VOID PhLoadWindowPlacementFromSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
)
|
||||
{
|
||||
PH_RECTANGLE windowRectangle;
|
||||
|
||||
if (PositionSettingName && SizeSettingName)
|
||||
{
|
||||
RECT rectForAdjust;
|
||||
|
||||
windowRectangle.Position = PhGetIntegerPairSetting(PositionSettingName);
|
||||
windowRectangle.Size = PhGetScalableIntegerPairSetting(SizeSettingName, TRUE).Pair;
|
||||
PhAdjustRectangleToWorkingArea(NULL, &windowRectangle);
|
||||
|
||||
// Let the window adjust for the minimum size if needed.
|
||||
rectForAdjust = PhRectangleToRect(windowRectangle);
|
||||
SendMessage(WindowHandle, WM_SIZING, WMSZ_BOTTOMRIGHT, (LPARAM)&rectForAdjust);
|
||||
windowRectangle = PhRectToRectangle(rectForAdjust);
|
||||
|
||||
MoveWindow(WindowHandle, windowRectangle.Left, windowRectangle.Top,
|
||||
windowRectangle.Width, windowRectangle.Height, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
PH_INTEGER_PAIR position;
|
||||
PH_INTEGER_PAIR size;
|
||||
ULONG flags;
|
||||
|
||||
flags = SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSIZE | SWP_NOZORDER;
|
||||
|
||||
if (PositionSettingName)
|
||||
{
|
||||
position = PhGetIntegerPairSetting(PositionSettingName);
|
||||
flags &= ~SWP_NOMOVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
position.X = 0;
|
||||
position.Y = 0;
|
||||
}
|
||||
|
||||
if (SizeSettingName)
|
||||
{
|
||||
size = PhGetScalableIntegerPairSetting(SizeSettingName, TRUE).Pair;
|
||||
flags &= ~SWP_NOSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
size.X = 16;
|
||||
size.Y = 16;
|
||||
}
|
||||
|
||||
SetWindowPos(WindowHandle, NULL, position.X, position.Y, size.X, size.Y, flags);
|
||||
}
|
||||
}
|
||||
|
||||
VOID PhSaveWindowPlacementToSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
)
|
||||
{
|
||||
WINDOWPLACEMENT placement = { sizeof(placement) };
|
||||
PH_RECTANGLE windowRectangle;
|
||||
MONITORINFO monitorInfo = { sizeof(MONITORINFO) };
|
||||
|
||||
GetWindowPlacement(WindowHandle, &placement);
|
||||
windowRectangle = PhRectToRectangle(placement.rcNormalPosition);
|
||||
|
||||
// The rectangle is in workspace coordinates. Convert the values back to screen coordinates.
|
||||
if (GetMonitorInfo(MonitorFromRect(&placement.rcNormalPosition, MONITOR_DEFAULTTOPRIMARY), &monitorInfo))
|
||||
{
|
||||
windowRectangle.Left += monitorInfo.rcWork.left - monitorInfo.rcMonitor.left;
|
||||
windowRectangle.Top += monitorInfo.rcWork.top - monitorInfo.rcMonitor.top;
|
||||
}
|
||||
|
||||
if (PositionSettingName)
|
||||
PhSetIntegerPairSetting(PositionSettingName, windowRectangle.Position);
|
||||
if (SizeSettingName)
|
||||
PhSetScalableIntegerPairSetting2(SizeSettingName, windowRectangle.Size);
|
||||
}
|
||||
|
||||
VOID PhLoadListViewColumnsFromSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
)
|
||||
{
|
||||
PPH_STRING string;
|
||||
|
||||
string = PhGetStringSetting(Name);
|
||||
PhLoadListViewColumnSettings(ListViewHandle, string);
|
||||
PhDereferenceObject(string);
|
||||
}
|
||||
|
||||
VOID PhSaveListViewColumnsToSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
)
|
||||
{
|
||||
PPH_STRING string;
|
||||
|
||||
string = PhSaveListViewColumnSettings(ListViewHandle);
|
||||
PhSetStringSetting2(Name, &string->sr);
|
||||
PhDereferenceObject(string);
|
||||
}
|
||||
|
||||
PPH_STRING PhGetPhVersion(
|
||||
VOID
|
||||
)
|
||||
|
||||
@@ -26,11 +26,12 @@
|
||||
|
||||
#include <emenu.h>
|
||||
#include <secedit.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <extmgri.h>
|
||||
#include <hndlprv.h>
|
||||
#include <phplug.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
BOOLEAN PhpHandleNodeHashtableEqualFunction(
|
||||
_In_ PVOID Entry1,
|
||||
|
||||
@@ -124,12 +124,6 @@ PPH_STRING PhUnescapeStringForDelimiter(
|
||||
_In_ WCHAR Delimiter
|
||||
);
|
||||
|
||||
typedef struct mxml_node_s mxml_node_t;
|
||||
|
||||
PPH_STRING PhGetOpaqueXmlNodeText(
|
||||
_In_ mxml_node_t *node
|
||||
);
|
||||
|
||||
// begin_phapppub
|
||||
PHAPPAPI
|
||||
VOID
|
||||
@@ -221,40 +215,6 @@ VOID PhSetWindowOpacity(
|
||||
#define PH_ID_TO_OPACITY(Id) (100 - (((Id) - ID_OPACITY_10) + 1) * 10)
|
||||
|
||||
// begin_phapppub
|
||||
PHAPPAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhLoadWindowPlacementFromSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
);
|
||||
|
||||
PHAPPAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSaveWindowPlacementToSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
);
|
||||
|
||||
PHAPPAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhLoadListViewColumnsFromSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
|
||||
PHAPPAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSaveListViewColumnsToSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
|
||||
PHAPPAPI
|
||||
PPH_STRING
|
||||
NTAPI
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
#ifndef PH_SETTINGS_H
|
||||
#define PH_SETTINGS_H
|
||||
|
||||
// Cached settings
|
||||
|
||||
#undef EXT
|
||||
|
||||
#ifdef PH_SETTINGS_PRIVATE
|
||||
#define EXT
|
||||
#else
|
||||
#define EXT extern
|
||||
#endif
|
||||
|
||||
EXT ULONG PhCsCollapseServicesOnStart;
|
||||
EXT ULONG PhCsForceNoParent;
|
||||
EXT ULONG PhCsHighlightingDuration;
|
||||
EXT ULONG PhCsPropagateCpuUsage;
|
||||
EXT ULONG PhCsScrollToNewProcesses;
|
||||
EXT ULONG PhCsShowCpuBelow001;
|
||||
EXT ULONG PhCsUpdateInterval;
|
||||
|
||||
EXT ULONG PhCsColorNew;
|
||||
EXT ULONG PhCsColorRemoved;
|
||||
EXT ULONG PhCsUseColorOwnProcesses;
|
||||
EXT ULONG PhCsColorOwnProcesses;
|
||||
EXT ULONG PhCsUseColorSystemProcesses;
|
||||
EXT ULONG PhCsColorSystemProcesses;
|
||||
EXT ULONG PhCsUseColorServiceProcesses;
|
||||
EXT ULONG PhCsColorServiceProcesses;
|
||||
EXT ULONG PhCsUseColorJobProcesses;
|
||||
EXT ULONG PhCsColorJobProcesses;
|
||||
EXT ULONG PhCsUseColorWow64Processes;
|
||||
EXT ULONG PhCsColorWow64Processes;
|
||||
EXT ULONG PhCsUseColorDebuggedProcesses;
|
||||
EXT ULONG PhCsColorDebuggedProcesses;
|
||||
EXT ULONG PhCsUseColorElevatedProcesses;
|
||||
EXT ULONG PhCsColorElevatedProcesses;
|
||||
EXT ULONG PhCsUseColorPicoProcesses;
|
||||
EXT ULONG PhCsColorPicoProcesses;
|
||||
EXT ULONG PhCsUseColorImmersiveProcesses;
|
||||
EXT ULONG PhCsColorImmersiveProcesses;
|
||||
EXT ULONG PhCsUseColorSuspended;
|
||||
EXT ULONG PhCsColorSuspended;
|
||||
EXT ULONG PhCsUseColorDotNet;
|
||||
EXT ULONG PhCsColorDotNet;
|
||||
EXT ULONG PhCsUseColorPacked;
|
||||
EXT ULONG PhCsColorPacked;
|
||||
EXT ULONG PhCsUseColorGuiThreads;
|
||||
EXT ULONG PhCsColorGuiThreads;
|
||||
EXT ULONG PhCsUseColorRelocatedModules;
|
||||
EXT ULONG PhCsColorRelocatedModules;
|
||||
EXT ULONG PhCsUseColorProtectedHandles;
|
||||
EXT ULONG PhCsColorProtectedHandles;
|
||||
EXT ULONG PhCsUseColorInheritHandles;
|
||||
EXT ULONG PhCsColorInheritHandles;
|
||||
EXT ULONG PhCsGraphShowText;
|
||||
EXT ULONG PhCsGraphColorMode;
|
||||
EXT ULONG PhCsColorCpuKernel;
|
||||
EXT ULONG PhCsColorCpuUser;
|
||||
EXT ULONG PhCsColorIoReadOther;
|
||||
EXT ULONG PhCsColorIoWrite;
|
||||
EXT ULONG PhCsColorPrivate;
|
||||
EXT ULONG PhCsColorPhysical;
|
||||
|
||||
#define PH_SET_INTEGER_CACHED_SETTING(Name, Value) (PhSetIntegerSetting(L#Name, PhCs##Name = (Value)))
|
||||
|
||||
#endif
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifndef PH_SETTINGSP_H
|
||||
#define PH_SETTINGSP_H
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
BOOLEAN NTAPI PhpSettingsHashtableEqualFunction(
|
||||
_In_ PVOID Entry1,
|
||||
_In_ PVOID Entry2
|
||||
);
|
||||
|
||||
ULONG NTAPI PhpSettingsHashtableHashFunction(
|
||||
_In_ PVOID Entry
|
||||
);
|
||||
|
||||
VOID PhpAddSetting(
|
||||
_In_ PH_SETTING_TYPE Type,
|
||||
_In_ PPH_STRINGREF Name,
|
||||
_In_ PPH_STRINGREF DefaultValue
|
||||
);
|
||||
|
||||
ULONG PhpGetCurrentScale(
|
||||
VOID
|
||||
);
|
||||
|
||||
PPH_STRING PhpSettingToString(
|
||||
_In_ PH_SETTING_TYPE Type,
|
||||
_In_ PPH_SETTING Setting
|
||||
);
|
||||
|
||||
BOOLEAN PhpSettingFromString(
|
||||
_In_ PH_SETTING_TYPE Type,
|
||||
_In_ PPH_STRINGREF StringRef,
|
||||
_In_opt_ PPH_STRING String,
|
||||
_Inout_ PPH_SETTING Setting
|
||||
);
|
||||
|
||||
VOID PhpFreeSettingValue(
|
||||
_In_ PH_SETTING_TYPE Type,
|
||||
_In_ PPH_SETTING Setting
|
||||
);
|
||||
|
||||
PVOID PhpLookupSetting(
|
||||
_In_ PPH_STRINGREF Name
|
||||
);
|
||||
|
||||
#endif
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <windowsx.h>
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <symprv.h>
|
||||
#include <verify.h>
|
||||
#include <workqueue.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
#include <actions.h>
|
||||
#include <memsrch.h>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <phapp.h>
|
||||
|
||||
#include <emenu.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <actions.h>
|
||||
#include <phsvccl.h>
|
||||
|
||||
@@ -25,11 +25,12 @@
|
||||
|
||||
#include <emenu.h>
|
||||
#include <verify.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <extmgri.h>
|
||||
#include <modprv.h>
|
||||
#include <phplug.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
BOOLEAN PhpModuleNodeHashtableEqualFunction(
|
||||
_In_ PVOID Entry1,
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <cpysave.h>
|
||||
#include <emenu.h>
|
||||
#include <verify.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
#include <actions.h>
|
||||
#include <phplug.h>
|
||||
|
||||
@@ -25,14 +25,15 @@
|
||||
|
||||
#include <cpysave.h>
|
||||
#include <emenu.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <colmgr.h>
|
||||
#include <extmgri.h>
|
||||
#include <mainwnd.h>
|
||||
#include <netprv.h>
|
||||
#include <phplug.h>
|
||||
#include <phsettings.h>
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
|
||||
BOOLEAN PhpNetworkNodeHashtableEqualFunction(
|
||||
_In_ PVOID Entry1,
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <phsettings.h>
|
||||
#include <notifico.h>
|
||||
|
||||
#include <shellapi.h>
|
||||
@@ -757,7 +758,7 @@ VOID PhNfpBeginBitmap2(
|
||||
{
|
||||
HDC screenHdc;
|
||||
|
||||
screenHdc = GetDC(NULL);
|
||||
screenHdc = CreateIC(L"DISPLAY", NULL, NULL, NULL);
|
||||
Context->Hdc = CreateCompatibleDC(screenHdc);
|
||||
|
||||
memset(&Context->Header, 0, sizeof(BITMAPINFOHEADER));
|
||||
@@ -768,7 +769,7 @@ VOID PhNfpBeginBitmap2(
|
||||
Context->Header.biBitCount = 32;
|
||||
Context->Bitmap = CreateDIBSection(screenHdc, (BITMAPINFO *)&Context->Header, DIB_RGB_COLORS, &Context->Bits, NULL, 0);
|
||||
|
||||
ReleaseDC(NULL, screenHdc);
|
||||
DeleteDC(screenHdc);
|
||||
|
||||
Context->Initialized = TRUE;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
#include <windowsx.h>
|
||||
|
||||
#include <colorbox.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <mainwnd.h>
|
||||
#include <proctree.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
#include <sysinfo.h>
|
||||
|
||||
#define WM_PH_CHILD_EXIT (WM_APP + 301)
|
||||
|
||||
@@ -27,10 +27,11 @@
|
||||
#include <uxtheme.h>
|
||||
|
||||
#include <kphuser.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <phplug.h>
|
||||
#include <phsettings.h>
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
|
||||
PPH_OBJECT_TYPE PhpProcessPropContextType;
|
||||
PPH_OBJECT_TYPE PhpProcessPropPageContextType;
|
||||
|
||||
@@ -34,13 +34,14 @@
|
||||
#include <emenu.h>
|
||||
#include <mapimg.h>
|
||||
#include <verify.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <colmgr.h>
|
||||
#include <extmgri.h>
|
||||
#include <mainwnd.h>
|
||||
#include <phplug.h>
|
||||
#include <phsettings.h>
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
|
||||
typedef enum _PHP_AGGREGATE_TYPE
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <cpysave.h>
|
||||
#include <emenu.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <procprv.h>
|
||||
|
||||
|
||||
@@ -25,10 +25,12 @@
|
||||
#include <procprpp.h>
|
||||
|
||||
#include <graph.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
#include <sysinfo.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
static VOID NTAPI PerformanceUpdateHandler(
|
||||
_In_opt_ PVOID Parameter,
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <winsta.h>
|
||||
|
||||
#include <settings.h>
|
||||
|
||||
#define SIP(String, Integer) { (String), (PVOID)(Integer) }
|
||||
|
||||
static PH_KEY_VALUE_PAIR VirtualKeyPairs[] =
|
||||
|
||||
+58
-1009
File diff suppressed because it is too large
Load Diff
@@ -23,6 +23,7 @@
|
||||
#include <phapp.h>
|
||||
|
||||
#include <svcsup.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <actions.h>
|
||||
#include <mainwnd.h>
|
||||
|
||||
@@ -26,12 +26,13 @@
|
||||
#include <cpysave.h>
|
||||
#include <emenu.h>
|
||||
#include <svcsup.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <colmgr.h>
|
||||
#include <extmgri.h>
|
||||
#include <mainwnd.h>
|
||||
#include <phplug.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
#include <srvprv.h>
|
||||
|
||||
BOOLEAN PhpServiceNodeHashtableEqualFunction(
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <settings.h>
|
||||
#include <sysinfo.h>
|
||||
#include <sysinfop.h>
|
||||
|
||||
@@ -55,8 +56,8 @@
|
||||
|
||||
#include <mainwnd.h>
|
||||
#include <phplug.h>
|
||||
#include <phsettings.h>
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
|
||||
static HANDLE PhSipThread = NULL;
|
||||
HWND PhSipWindow = NULL;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <settings.h>
|
||||
#include <sysinfo.h>
|
||||
#include <sysinfop.h>
|
||||
|
||||
@@ -28,7 +29,7 @@
|
||||
#include <windowsx.h>
|
||||
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
static PPH_SYSINFO_SECTION CpuSection;
|
||||
static HWND CpuDialog;
|
||||
|
||||
@@ -21,11 +21,12 @@
|
||||
*/
|
||||
|
||||
#include <phapp.h>
|
||||
#include <settings.h>
|
||||
#include <sysinfo.h>
|
||||
#include <sysinfop.h>
|
||||
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
static PPH_SYSINFO_SECTION IoSection;
|
||||
static HWND IoDialog;
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
#include <kphuser.h>
|
||||
#include <symprv.h>
|
||||
#include <workqueue.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <procprv.h>
|
||||
#include <settings.h>
|
||||
#include <phsettings.h>
|
||||
|
||||
static PPH_SYSINFO_SECTION MemorySection;
|
||||
static HWND MemoryDialog;
|
||||
|
||||
@@ -24,12 +24,13 @@
|
||||
#include <thrdlist.h>
|
||||
|
||||
#include <emenu.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <extmgri.h>
|
||||
#include <phplug.h>
|
||||
#include <phsettings.h>
|
||||
#include <procprp.h>
|
||||
#include <procprpp.h>
|
||||
#include <settings.h>
|
||||
#include <thrdprv.h>
|
||||
|
||||
BOOLEAN PhpThreadNodeHashtableEqualFunction(
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <emenu.h>
|
||||
#include <lsasup.h>
|
||||
#include <secedit.h>
|
||||
#include <settings.h>
|
||||
#include <splitter.h>
|
||||
|
||||
#include <uxtheme.h>
|
||||
|
||||
-126
@@ -219,132 +219,6 @@ VOID PhSetListViewSubItem(
|
||||
ListView_SetItem(ListViewHandle, &item);
|
||||
}
|
||||
|
||||
BOOLEAN PhLoadListViewColumnSettings(
|
||||
_In_ HWND ListViewHandle,
|
||||
_In_ PPH_STRING Settings
|
||||
)
|
||||
{
|
||||
#define ORDER_LIMIT 50
|
||||
PH_STRINGREF remainingPart;
|
||||
ULONG columnIndex;
|
||||
ULONG orderArray[ORDER_LIMIT]; // HACK, but reasonable limit
|
||||
ULONG maxOrder;
|
||||
ULONG scale;
|
||||
|
||||
if (Settings->Length == 0)
|
||||
return FALSE;
|
||||
|
||||
remainingPart = Settings->sr;
|
||||
columnIndex = 0;
|
||||
memset(orderArray, 0, sizeof(orderArray));
|
||||
maxOrder = 0;
|
||||
|
||||
if (remainingPart.Length != 0 && remainingPart.Buffer[0] == '@')
|
||||
{
|
||||
PH_STRINGREF scalePart;
|
||||
ULONG64 integer;
|
||||
|
||||
PhSkipStringRef(&remainingPart, sizeof(WCHAR));
|
||||
PhSplitStringRefAtChar(&remainingPart, '|', &scalePart, &remainingPart);
|
||||
|
||||
if (scalePart.Length == 0 || !PhStringToInteger64(&scalePart, 10, &integer))
|
||||
return FALSE;
|
||||
|
||||
scale = (ULONG)integer;
|
||||
}
|
||||
else
|
||||
{
|
||||
scale = PhGlobalDpi;
|
||||
}
|
||||
|
||||
while (remainingPart.Length != 0)
|
||||
{
|
||||
PH_STRINGREF columnPart;
|
||||
PH_STRINGREF orderPart;
|
||||
PH_STRINGREF widthPart;
|
||||
ULONG64 integer;
|
||||
ULONG order;
|
||||
ULONG width;
|
||||
LVCOLUMN lvColumn;
|
||||
|
||||
PhSplitStringRefAtChar(&remainingPart, '|', &columnPart, &remainingPart);
|
||||
|
||||
if (columnPart.Length == 0)
|
||||
return FALSE;
|
||||
|
||||
PhSplitStringRefAtChar(&columnPart, ',', &orderPart, &widthPart);
|
||||
|
||||
if (orderPart.Length == 0 || widthPart.Length == 0)
|
||||
return FALSE;
|
||||
|
||||
// Order
|
||||
|
||||
if (!PhStringToInteger64(&orderPart, 10, &integer))
|
||||
return FALSE;
|
||||
|
||||
order = (ULONG)integer;
|
||||
|
||||
if (order < ORDER_LIMIT)
|
||||
{
|
||||
orderArray[order] = columnIndex;
|
||||
|
||||
if (maxOrder < order + 1)
|
||||
maxOrder = order + 1;
|
||||
}
|
||||
|
||||
// Width
|
||||
|
||||
if (!PhStringToInteger64(&widthPart, 10, &integer))
|
||||
return FALSE;
|
||||
|
||||
width = (ULONG)integer;
|
||||
|
||||
if (scale != PhGlobalDpi && scale != 0)
|
||||
width = PhMultiplyDivide(width, PhGlobalDpi, scale);
|
||||
|
||||
lvColumn.mask = LVCF_WIDTH;
|
||||
lvColumn.cx = width;
|
||||
ListView_SetColumn(ListViewHandle, columnIndex, &lvColumn);
|
||||
|
||||
columnIndex++;
|
||||
}
|
||||
|
||||
ListView_SetColumnOrderArray(ListViewHandle, maxOrder, orderArray);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
PPH_STRING PhSaveListViewColumnSettings(
|
||||
_In_ HWND ListViewHandle
|
||||
)
|
||||
{
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
ULONG i = 0;
|
||||
LVCOLUMN lvColumn;
|
||||
|
||||
PhInitializeStringBuilder(&stringBuilder, 20);
|
||||
|
||||
PhAppendFormatStringBuilder(&stringBuilder, L"@%u|", PhGlobalDpi);
|
||||
|
||||
lvColumn.mask = LVCF_WIDTH | LVCF_ORDER;
|
||||
|
||||
while (ListView_GetColumn(ListViewHandle, i, &lvColumn))
|
||||
{
|
||||
PhAppendFormatStringBuilder(
|
||||
&stringBuilder,
|
||||
L"%u,%u|",
|
||||
lvColumn.iOrder,
|
||||
lvColumn.cx
|
||||
);
|
||||
i++;
|
||||
}
|
||||
|
||||
if (stringBuilder.String->Length != 0)
|
||||
PhRemoveEndStringBuilder(&stringBuilder, 1);
|
||||
|
||||
return PhFinalStringBuilderString(&stringBuilder);
|
||||
}
|
||||
|
||||
INT PhAddTabControlTab(
|
||||
_In_ HWND TabControlHandle,
|
||||
_In_ INT Index,
|
||||
|
||||
+2
-2
@@ -160,10 +160,10 @@ HBITMAP PhIconToBitmap(
|
||||
iconRectangle.right = Width;
|
||||
iconRectangle.bottom = Height;
|
||||
|
||||
screenHdc = GetDC(NULL);
|
||||
screenHdc = CreateIC(L"DISPLAY", NULL, NULL, NULL);
|
||||
hdc = CreateCompatibleDC(screenHdc);
|
||||
bitmap = PhpCreateBitmap32(screenHdc, Width, Height, NULL);
|
||||
ReleaseDC(NULL, screenHdc);
|
||||
DeleteDC(screenHdc);
|
||||
oldBitmap = SelectObject(hdc, bitmap);
|
||||
|
||||
paintParams.dwFlags = BPPF_ERASE;
|
||||
|
||||
@@ -251,17 +251,6 @@ VOID PhSetListViewSubItem(
|
||||
_In_ PWSTR Text
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
BOOLEAN PhLoadListViewColumnSettings(
|
||||
_In_ HWND ListViewHandle,
|
||||
_In_ PPH_STRING Settings
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
PPH_STRING PhSaveListViewColumnSettings(
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
|
||||
PHLIBAPI
|
||||
INT PhAddTabControlTab(
|
||||
_In_ HWND TabControlHandle,
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
#ifndef PH_SETTINGS_H
|
||||
#define PH_SETTINGS_H
|
||||
#ifndef PHLIB_SETTINGS_H
|
||||
#define PHLIB_SETTINGS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// begin_phapppub
|
||||
|
||||
// These macros make sure the C strings can be seamlessly converted into
|
||||
// PH_STRINGREFs at compile time, for a small speed boost.
|
||||
|
||||
#define ADD_SETTING_WRAPPER(Type, Name, DefaultValue) \
|
||||
{ \
|
||||
static PH_STRINGREF name = PH_STRINGREF_INIT(Name); \
|
||||
static PH_STRINGREF defaultValue = PH_STRINGREF_INIT(DefaultValue); \
|
||||
PhAddSetting(Type, &name, &defaultValue); \
|
||||
}
|
||||
|
||||
#define PhpAddStringSetting(A, B) ADD_SETTING_WRAPPER(StringSettingType, A, B)
|
||||
#define PhpAddIntegerSetting(A, B) ADD_SETTING_WRAPPER(IntegerSettingType, A, B)
|
||||
#define PhpAddIntegerPairSetting(A, B) ADD_SETTING_WRAPPER(IntegerPairSettingType, A, B)
|
||||
#define PhpAddScalableIntegerPairSetting(A, B) ADD_SETTING_WRAPPER(ScalableIntegerPairSettingType, A, B)
|
||||
|
||||
typedef enum _PH_SETTING_TYPE
|
||||
{
|
||||
StringSettingType,
|
||||
@@ -25,17 +45,25 @@ typedef struct _PH_SETTING
|
||||
} u;
|
||||
} PH_SETTING, *PPH_SETTING;
|
||||
|
||||
VOID PhSettingsInitialization(
|
||||
PHLIBAPI
|
||||
VOID
|
||||
PhSettingsInitialization(
|
||||
VOID
|
||||
);
|
||||
|
||||
// Note: Program specific function.
|
||||
VOID PhAddDefaultSettings(
|
||||
VOID
|
||||
);
|
||||
|
||||
// Note: Program specific function.
|
||||
VOID PhUpdateCachedSettings(
|
||||
VOID
|
||||
);
|
||||
|
||||
// begin_phapppub
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
ULONG
|
||||
NTAPI
|
||||
PhGetIntegerSetting(
|
||||
@@ -43,7 +71,7 @@ PhGetIntegerSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
PH_INTEGER_PAIR
|
||||
NTAPI
|
||||
PhGetIntegerPairSetting(
|
||||
@@ -51,7 +79,7 @@ PhGetIntegerPairSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
PH_SCALABLE_INTEGER_PAIR
|
||||
NTAPI
|
||||
PhGetScalableIntegerPairSetting(
|
||||
@@ -60,7 +88,7 @@ PhGetScalableIntegerPairSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
PPH_STRING
|
||||
NTAPI
|
||||
PhGetStringSetting(
|
||||
@@ -68,7 +96,7 @@ PhGetStringSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetIntegerSetting(
|
||||
@@ -77,7 +105,7 @@ PhSetIntegerSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetIntegerPairSetting(
|
||||
@@ -86,7 +114,7 @@ PhSetIntegerPairSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetScalableIntegerPairSetting(
|
||||
@@ -95,7 +123,7 @@ PhSetScalableIntegerPairSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetScalableIntegerPairSetting2(
|
||||
@@ -104,7 +132,7 @@ PhSetScalableIntegerPairSetting2(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetStringSetting(
|
||||
@@ -113,7 +141,7 @@ PhSetStringSetting(
|
||||
);
|
||||
|
||||
_May_raise_
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhSetStringSetting2(
|
||||
@@ -147,6 +175,12 @@ VOID PhResetSettings(
|
||||
// begin_phapppub
|
||||
// High-level settings creation
|
||||
|
||||
VOID PhAddSetting(
|
||||
_In_ PH_SETTING_TYPE Type,
|
||||
_In_ PPH_STRINGREF Name,
|
||||
_In_ PPH_STRINGREF DefaultValue
|
||||
);
|
||||
|
||||
typedef struct _PH_SETTING_CREATE
|
||||
{
|
||||
PH_SETTING_TYPE Type;
|
||||
@@ -154,76 +188,49 @@ typedef struct _PH_SETTING_CREATE
|
||||
PWSTR DefaultValue;
|
||||
} PH_SETTING_CREATE, *PPH_SETTING_CREATE;
|
||||
|
||||
PHAPPAPI
|
||||
PHLIBAPI
|
||||
VOID
|
||||
NTAPI
|
||||
PhAddSettings(
|
||||
_In_ PPH_SETTING_CREATE Settings,
|
||||
_In_ ULONG NumberOfSettings
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PhLoadWindowPlacementFromSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PhSaveWindowPlacementToSetting(
|
||||
_In_opt_ PWSTR PositionSettingName,
|
||||
_In_opt_ PWSTR SizeSettingName,
|
||||
_In_ HWND WindowHandle
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PhLoadListViewColumnsFromSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
PhSaveListViewColumnsToSetting(
|
||||
_In_ PWSTR Name,
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
// end_phapppub
|
||||
|
||||
// Cached settings
|
||||
|
||||
#undef EXT
|
||||
|
||||
#ifdef PH_SETTINGS_PRIVATE
|
||||
#define EXT
|
||||
#else
|
||||
#define EXT extern
|
||||
#endif
|
||||
|
||||
EXT ULONG PhCsCollapseServicesOnStart;
|
||||
EXT ULONG PhCsForceNoParent;
|
||||
EXT ULONG PhCsHighlightingDuration;
|
||||
EXT ULONG PhCsPropagateCpuUsage;
|
||||
EXT ULONG PhCsScrollToNewProcesses;
|
||||
EXT ULONG PhCsShowCpuBelow001;
|
||||
EXT ULONG PhCsUpdateInterval;
|
||||
|
||||
EXT ULONG PhCsColorNew;
|
||||
EXT ULONG PhCsColorRemoved;
|
||||
EXT ULONG PhCsUseColorOwnProcesses;
|
||||
EXT ULONG PhCsColorOwnProcesses;
|
||||
EXT ULONG PhCsUseColorSystemProcesses;
|
||||
EXT ULONG PhCsColorSystemProcesses;
|
||||
EXT ULONG PhCsUseColorServiceProcesses;
|
||||
EXT ULONG PhCsColorServiceProcesses;
|
||||
EXT ULONG PhCsUseColorJobProcesses;
|
||||
EXT ULONG PhCsColorJobProcesses;
|
||||
EXT ULONG PhCsUseColorWow64Processes;
|
||||
EXT ULONG PhCsColorWow64Processes;
|
||||
EXT ULONG PhCsUseColorDebuggedProcesses;
|
||||
EXT ULONG PhCsColorDebuggedProcesses;
|
||||
EXT ULONG PhCsUseColorElevatedProcesses;
|
||||
EXT ULONG PhCsColorElevatedProcesses;
|
||||
EXT ULONG PhCsUseColorPicoProcesses;
|
||||
EXT ULONG PhCsColorPicoProcesses;
|
||||
EXT ULONG PhCsUseColorImmersiveProcesses;
|
||||
EXT ULONG PhCsColorImmersiveProcesses;
|
||||
EXT ULONG PhCsUseColorSuspended;
|
||||
EXT ULONG PhCsColorSuspended;
|
||||
EXT ULONG PhCsUseColorDotNet;
|
||||
EXT ULONG PhCsColorDotNet;
|
||||
EXT ULONG PhCsUseColorPacked;
|
||||
EXT ULONG PhCsColorPacked;
|
||||
EXT ULONG PhCsUseColorGuiThreads;
|
||||
EXT ULONG PhCsColorGuiThreads;
|
||||
EXT ULONG PhCsUseColorRelocatedModules;
|
||||
EXT ULONG PhCsColorRelocatedModules;
|
||||
EXT ULONG PhCsUseColorProtectedHandles;
|
||||
EXT ULONG PhCsColorProtectedHandles;
|
||||
EXT ULONG PhCsUseColorInheritHandles;
|
||||
EXT ULONG PhCsColorInheritHandles;
|
||||
EXT ULONG PhCsGraphShowText;
|
||||
EXT ULONG PhCsGraphColorMode;
|
||||
EXT ULONG PhCsColorCpuKernel;
|
||||
EXT ULONG PhCsColorCpuUser;
|
||||
EXT ULONG PhCsColorIoReadOther;
|
||||
EXT ULONG PhCsColorIoWrite;
|
||||
EXT ULONG PhCsColorPrivate;
|
||||
EXT ULONG PhCsColorPhysical;
|
||||
|
||||
#define PH_SET_INTEGER_CACHED_SETTING(Name, Value) (PhSetIntegerSetting(L#Name, PhCs##Name = (Value)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -167,12 +167,22 @@
|
||||
<ClCompile Include="mapimg.c" />
|
||||
<ClCompile Include="maplib.c" />
|
||||
<ClCompile Include="md5.c" />
|
||||
<ClCompile Include="mxml\mxml-attr.c" />
|
||||
<ClCompile Include="mxml\mxml-entity.c" />
|
||||
<ClCompile Include="mxml\mxml-file.c" />
|
||||
<ClCompile Include="mxml\mxml-index.c" />
|
||||
<ClCompile Include="mxml\mxml-node.c" />
|
||||
<ClCompile Include="mxml\mxml-private.c" />
|
||||
<ClCompile Include="mxml\mxml-search.c" />
|
||||
<ClCompile Include="mxml\mxml-set.c" />
|
||||
<ClCompile Include="mxml\mxml-string.c" />
|
||||
<ClCompile Include="native.c" />
|
||||
<ClCompile Include="provider.c" />
|
||||
<ClCompile Include="queuedlock.c" />
|
||||
<ClCompile Include="ref.c" />
|
||||
<ClCompile Include="secdata.c" />
|
||||
<ClCompile Include="secedit.c" />
|
||||
<ClCompile Include="settings.c" />
|
||||
<ClCompile Include="sha.c" />
|
||||
<ClCompile Include="sha256.c" />
|
||||
<ClCompile Include="util.c" />
|
||||
@@ -208,6 +218,7 @@
|
||||
<ClInclude Include="include\phutil.h" />
|
||||
<ClInclude Include="include\provider.h" />
|
||||
<ClInclude Include="include\secedit.h" />
|
||||
<ClInclude Include="include\settings.h" />
|
||||
<ClInclude Include="include\svcsup.h" />
|
||||
<ClInclude Include="include\symprvp.h" />
|
||||
<ClInclude Include="include\treenew.h" />
|
||||
@@ -235,6 +246,9 @@
|
||||
<ClInclude Include="include\ref.h" />
|
||||
<ClInclude Include="include\refp.h" />
|
||||
<ClInclude Include="include\seceditp.h" />
|
||||
<ClInclude Include="mxml\config.h" />
|
||||
<ClInclude Include="mxml\mxml-private.h" />
|
||||
<ClInclude Include="mxml\mxml.h" />
|
||||
<ClInclude Include="sha.h" />
|
||||
<ClInclude Include="include\symprv.h" />
|
||||
<ClInclude Include="include\templ.h" />
|
||||
|
||||
@@ -140,6 +140,36 @@
|
||||
<ClCompile Include="sha256.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-attr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-entity.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-file.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-index.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-node.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-private.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-search.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-set.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="mxml\mxml-string.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="settings.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\circbuf.h">
|
||||
@@ -316,5 +346,17 @@
|
||||
<ClInclude Include="sha256.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\mxml.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="mxml\mxml-private.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\settings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+1251
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,7 @@
|
||||
#define CINTERFACE
|
||||
#define COBJMACROS
|
||||
#include <phdk.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <phdk.h>
|
||||
#include <settings.h>
|
||||
#include "extnoti.h"
|
||||
|
||||
VOID NTAPI LoggedCallback(
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <phdk.h>
|
||||
#include <workqueue.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
#include "extnoti.h"
|
||||
#include "resource.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define ES_EXTSRV_H
|
||||
|
||||
#include <phdk.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define EXTTOOLS_H
|
||||
|
||||
#include <phdk.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
#include <math.h>
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#define COBJMACROS
|
||||
#include <phdk.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
#include <mxml.h>
|
||||
#include <verify.h>
|
||||
#include <workqueue.h>
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define COBJMACROS
|
||||
#include <phdk.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <uxtheme.h>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <phdk.h>
|
||||
#include <phapppub.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
#include <workqueue.h>
|
||||
#include <windowsx.h>
|
||||
#include <winsock2.h>
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#define COBJMACROS
|
||||
#include <phdk.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
#include <mxml.h>
|
||||
#include <commonutil.h>
|
||||
#include <workqueue.h>
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include <phdk.h>
|
||||
#include <settings.h>
|
||||
#include "resource.h"
|
||||
#include "sbiedll.h"
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <phdk.h>
|
||||
#include <phapppub.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
#include <uxtheme.h>
|
||||
#include <vssym32.h>
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include <verify.h>
|
||||
#include <workqueue.h>
|
||||
#include <mxml.h>
|
||||
#include <settings.h>
|
||||
#include <windowsx.h>
|
||||
#include <winhttp.h>
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <phdk.h>
|
||||
#include <phappresource.h>
|
||||
#include <settings.h>
|
||||
#include <mxml.h>
|
||||
|
||||
#include <windowsx.h>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <phdk.h>
|
||||
#include <phapppub.h>
|
||||
#include <settings.h>
|
||||
#include "wndtree.h"
|
||||
|
||||
extern BOOLEAN IsHookClient;
|
||||
|
||||
@@ -108,6 +108,7 @@ namespace CustomBuildTool
|
||||
"queuedlock.h",
|
||||
"ref.h",
|
||||
"secedit.h",
|
||||
"settings.h",
|
||||
"svcsup.h",
|
||||
"symprv.h",
|
||||
"templ.h",
|
||||
@@ -436,14 +437,10 @@ namespace CustomBuildTool
|
||||
|
||||
// Copy the plugin SDK headers
|
||||
foreach (string file in phnt_headers)
|
||||
{
|
||||
File.Copy("phnt\\include\\" + file, "sdk\\include\\" + file, true);
|
||||
}
|
||||
|
||||
foreach (string file in phlib_headers)
|
||||
{
|
||||
File.Copy("phlib\\include\\" + file, "sdk\\include\\" + file, true);
|
||||
}
|
||||
File.Copy("phlib\\mxml\\mxml.h", "sdk\\include\\mxml.h", true);
|
||||
|
||||
// Copy readme
|
||||
File.Copy("ProcessHacker\\sdk\\readme.txt", "sdk\\readme.txt", true);
|
||||
@@ -482,7 +479,6 @@ namespace CustomBuildTool
|
||||
|
||||
File.Copy("ProcessHacker\\sdk\\phapppub.h", "sdk\\include\\phapppub.h", true);
|
||||
File.Copy("ProcessHacker\\sdk\\phdk.h", "sdk\\include\\phdk.h", true);
|
||||
File.Copy("ProcessHacker\\mxml\\mxml.h", "sdk\\include\\mxml.h", true);
|
||||
File.Copy("ProcessHacker\\resource.h", "sdk\\include\\phappresource.h", true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -680,7 +676,7 @@ namespace CustomBuildTool
|
||||
{
|
||||
Verify.Decrypt("build\\kph.s", "build\\kph.key", kphKey);
|
||||
Verify.Decrypt("build\\nightly.s", "build\\nightly.key", buildKey);
|
||||
Verify.Decrypt("plugins\\OnlineChecks\\virustotal.s", "plugins\\OnlineChecks\\virustotal.h", vtBuildKey);
|
||||
Verify.Decrypt("build\\virustotal.s", "build\\virustotal.h", vtBuildKey);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -723,8 +719,6 @@ namespace CustomBuildTool
|
||||
|
||||
try
|
||||
{
|
||||
File.Copy("ProcessHacker\\sdk\\readme.txt", "sdk\\readme.txt", true);
|
||||
|
||||
Zip.CreateCompressedSdkFromFolder("sdk", BuildOutputFolder + "\\processhacker-build-sdk.zip");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -810,9 +804,6 @@ namespace CustomBuildTool
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(BuildOutputFolder + "\\processhacker-build-pdb.zip"))
|
||||
File.Delete(BuildOutputFolder + "\\processhacker-build-pdb.zip");
|
||||
|
||||
Zip.CreateCompressedPdbFromFolder(".\\", BuildOutputFolder + "\\processhacker-build-pdb.zip");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace CustomBuildTool
|
||||
"extmgr.h",
|
||||
"mainwnd.h",
|
||||
"notifico.h",
|
||||
"settings.h",
|
||||
"phplug.h",
|
||||
"actions.h",
|
||||
"procprp.h",
|
||||
|
||||
@@ -14,11 +14,13 @@ namespace CustomBuildTool
|
||||
|
||||
if (ProgramArgs.ContainsKey("-cleanup"))
|
||||
{
|
||||
if (Restart("-cleanup"))
|
||||
return;
|
||||
|
||||
if (!Build.InitializeBuildEnvironment(true))
|
||||
return;
|
||||
|
||||
Build.CleanupAppxSignature();
|
||||
|
||||
Build.CleanupBuildEnvironment();
|
||||
|
||||
Build.ShowBuildStats(true);
|
||||
@@ -283,26 +285,8 @@ namespace CustomBuildTool
|
||||
}
|
||||
else if (ProgramArgs.ContainsKey("-appxmakecert"))
|
||||
{
|
||||
WindowsIdentity identity = WindowsIdentity.GetCurrent();
|
||||
WindowsPrincipal principal = new WindowsPrincipal(identity);
|
||||
|
||||
if (!principal.IsInRole(WindowsBuiltInRole.Administrator))
|
||||
{
|
||||
Win32.ShowWindow(Win32.GetConsoleWindow(), Win32.SW_HIDE);
|
||||
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName,
|
||||
Arguments = "-appxmakecert",
|
||||
Verb = "runas"
|
||||
});
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
if (Restart("-appxmakecert"))
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Build.InitializeBuildEnvironment(false))
|
||||
return;
|
||||
@@ -363,6 +347,30 @@ namespace CustomBuildTool
|
||||
Console.Write(Message);
|
||||
Console.ResetColor();
|
||||
}
|
||||
|
||||
private static bool Restart(string Arguments)
|
||||
{
|
||||
WindowsIdentity identity = WindowsIdentity.GetCurrent();
|
||||
WindowsPrincipal principal = new WindowsPrincipal(identity);
|
||||
|
||||
if (principal.IsInRole(WindowsBuiltInRole.Administrator))
|
||||
return false;
|
||||
|
||||
Win32.ShowWindow(Win32.GetConsoleWindow(), Win32.SW_HIDE);
|
||||
|
||||
try
|
||||
{
|
||||
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo
|
||||
{
|
||||
FileName = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName,
|
||||
Arguments = Arguments,
|
||||
Verb = "runas"
|
||||
});
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Flags]
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <guisup.h>
|
||||
#include <prsht.h>
|
||||
#include <prpsh.h>
|
||||
#include <settings.h>
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
extern PPH_STRING PvFileName;
|
||||
@@ -36,4 +38,14 @@ VOID PvHandleListViewNotifyForCopy(
|
||||
_In_ HWND ListViewHandle
|
||||
);
|
||||
|
||||
// settings
|
||||
|
||||
VOID PeInitializeSettings(
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID PeSaveSettings(
|
||||
VOID
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,7 @@ typedef struct _PV_PROPSHEETCONTEXT
|
||||
typedef struct _PV_PROPCONTEXT
|
||||
{
|
||||
PPH_STRING Title;
|
||||
PPH_STRING StartPage;
|
||||
PROPSHEETHEADER PropSheetHeader;
|
||||
HPROPSHEETPAGE *PropSheetPages;
|
||||
} PV_PROPCONTEXT, *PPV_PROPCONTEXT;
|
||||
|
||||
+5
-1
@@ -46,7 +46,7 @@ static VOID PvpInitializeDpi(
|
||||
if (hdc = CreateIC(L"DISPLAY", NULL, NULL, NULL))
|
||||
{
|
||||
PhGlobalDpi = GetDeviceCaps(hdc, LOGPIXELSY);
|
||||
ReleaseDC(NULL, hdc);
|
||||
DeleteDC(hdc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,8 @@ INT WINAPI wWinMain(
|
||||
|
||||
PhGuiSupportInitialization();
|
||||
PvpInitializeDpi();
|
||||
PhSettingsInitialization();
|
||||
PeInitializeSettings();
|
||||
PvPropInitialization();
|
||||
|
||||
PhApplicationName = L"PE Viewer";
|
||||
@@ -124,5 +126,7 @@ INT WINAPI wWinMain(
|
||||
else
|
||||
PvLibProperties();
|
||||
|
||||
PeSaveSettings();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+47
-20
@@ -344,8 +344,6 @@ INT_PTR CALLBACK PvpPeGeneralDlgProc(
|
||||
PWSTR type;
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
|
||||
PhCenterWindow(GetParent(hwndDlg), NULL);
|
||||
|
||||
// File version information
|
||||
|
||||
{
|
||||
@@ -755,6 +753,7 @@ INT_PTR CALLBACK PvpPeImportsDlgProc(
|
||||
PhAddListViewColumn(lvHandle, 2, 2, 2, LVCFMT_LEFT, 50, L"Hint");
|
||||
PhSetExtendedListView(lvHandle);
|
||||
ExtendedListView_AddFallbackColumns(lvHandle, 3, fallbackColumns);
|
||||
PhLoadListViewColumnsFromSetting(L"ImageImportsListViewColumns", lvHandle);
|
||||
|
||||
if (NT_SUCCESS(PhGetMappedImageImports(&imports, &PvMappedImage)))
|
||||
{
|
||||
@@ -771,6 +770,11 @@ INT_PTR CALLBACK PvpPeImportsDlgProc(
|
||||
EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PhSaveListViewColumnsToSetting(L"ImageImportsListViewColumns", GetDlgItem(hwndDlg, IDC_LIST));
|
||||
}
|
||||
break;
|
||||
case WM_SHOWWINDOW:
|
||||
{
|
||||
if (!propPageContext->LayoutInitialized)
|
||||
@@ -824,10 +828,12 @@ INT_PTR CALLBACK PvpPeExportsDlgProc(
|
||||
lvHandle = GetDlgItem(hwndDlg, IDC_LIST);
|
||||
PhSetListViewStyle(lvHandle, FALSE, TRUE);
|
||||
PhSetControlTheme(lvHandle, L"explorer");
|
||||
PhAddListViewColumn(lvHandle, 0, 0, 0, LVCFMT_LEFT, 220, L"Name");
|
||||
PhAddListViewColumn(lvHandle, 1, 1, 1, LVCFMT_LEFT, 50, L"Ordinal");
|
||||
PhAddListViewColumn(lvHandle, 2, 2, 2, LVCFMT_LEFT, 120, L"RVA");
|
||||
PhAddListViewColumn(lvHandle, 0, 0, 0, LVCFMT_LEFT, 40, L"#");
|
||||
PhAddListViewColumn(lvHandle, 1, 1, 1, LVCFMT_RIGHT, 80, L"RVA");
|
||||
PhAddListViewColumn(lvHandle, 2, 2, 2, LVCFMT_LEFT, 250, L"Name");
|
||||
PhAddListViewColumn(lvHandle, 3, 3, 3, LVCFMT_LEFT, 50, L"Ordinal");
|
||||
PhSetExtendedListView(lvHandle);
|
||||
PhLoadListViewColumnsFromSetting(L"ImageExportsListViewColumns", lvHandle);
|
||||
|
||||
if (NT_SUCCESS(PhGetMappedImageExports(&exports, &PvMappedImage)))
|
||||
{
|
||||
@@ -849,31 +855,34 @@ INT_PTR CALLBACK PvpPeExportsDlgProc(
|
||||
if (!exportFunction.Function)
|
||||
continue;
|
||||
|
||||
if (exportEntry.Name)
|
||||
{
|
||||
name = PhZeroExtendToUtf16(exportEntry.Name);
|
||||
lvItemIndex = PhAddListViewItem(lvHandle, MAXINT, name->Buffer, NULL);
|
||||
PhDereferenceObject(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
lvItemIndex = PhAddListViewItem(lvHandle, MAXINT, L"(unnamed)", NULL);
|
||||
}
|
||||
|
||||
PhPrintUInt32(number, exportEntry.Ordinal);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 1, number);
|
||||
PhPrintUInt64(number, i + 1);
|
||||
lvItemIndex = PhAddListViewItem(lvHandle, MAXINT, number, NULL);
|
||||
|
||||
if (exportFunction.ForwardedName)
|
||||
{
|
||||
name = PhZeroExtendToUtf16(exportFunction.ForwardedName);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 2, name->Buffer);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 1, name->Buffer);
|
||||
PhDereferenceObject(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhPrintPointer(pointer, exportFunction.Function);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 2, pointer);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 1, pointer);
|
||||
}
|
||||
|
||||
if (exportEntry.Name)
|
||||
{
|
||||
name = PhZeroExtendToUtf16(exportEntry.Name);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 2, name->Buffer);
|
||||
PhDereferenceObject(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 2, L"(unnamed)");
|
||||
}
|
||||
|
||||
PhPrintUInt32(number, exportEntry.Ordinal);
|
||||
PhSetListViewSubItem(lvHandle, lvItemIndex, 3, number);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -883,6 +892,11 @@ INT_PTR CALLBACK PvpPeExportsDlgProc(
|
||||
EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PhSaveListViewColumnsToSetting(L"ImageExportsListViewColumns", GetDlgItem(hwndDlg, IDC_LIST));
|
||||
}
|
||||
break;
|
||||
case WM_SHOWWINDOW:
|
||||
{
|
||||
if (!propPageContext->LayoutInitialized)
|
||||
@@ -936,6 +950,8 @@ INT_PTR CALLBACK PvpPeLoadConfigDlgProc(
|
||||
PhSetControlTheme(lvHandle, L"explorer");
|
||||
PhAddListViewColumn(lvHandle, 0, 0, 0, LVCFMT_LEFT, 220, L"Name");
|
||||
PhAddListViewColumn(lvHandle, 1, 1, 1, LVCFMT_LEFT, 170, L"Value");
|
||||
PhSetExtendedListView(lvHandle);
|
||||
PhLoadListViewColumnsFromSetting(L"ImageLoadCfgListViewColumns", lvHandle);
|
||||
|
||||
#define ADD_VALUE(Name, Value) \
|
||||
{ \
|
||||
@@ -1012,6 +1028,11 @@ INT_PTR CALLBACK PvpPeLoadConfigDlgProc(
|
||||
EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PhSaveListViewColumnsToSetting(L"ImageLoadCfgListViewColumns", GetDlgItem(hwndDlg, IDC_LIST));
|
||||
}
|
||||
break;
|
||||
case WM_SHOWWINDOW:
|
||||
{
|
||||
if (!propPageContext->LayoutInitialized)
|
||||
@@ -1148,6 +1169,7 @@ INT_PTR CALLBACK PvpPeCgfDlgProc(
|
||||
PhAddListViewColumn(lvHandle, 2, 2, 2, LVCFMT_LEFT, 250, L"Name");
|
||||
PhAddListViewColumn(lvHandle, 3, 3, 3, LVCFMT_LEFT, 100, L"Flags");
|
||||
PhSetExtendedListView(lvHandle);
|
||||
PhLoadListViewColumnsFromSetting(L"ImageCfgListViewColumns", lvHandle);
|
||||
|
||||
// Init symbol resolver
|
||||
if (PvpLoadDbgHelp(&symbolProvider))
|
||||
@@ -1247,6 +1269,11 @@ INT_PTR CALLBACK PvpPeCgfDlgProc(
|
||||
EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
{
|
||||
PhSaveListViewColumnsToSetting(L"ImageCfgListViewColumns", GetDlgItem(hwndDlg, IDC_LIST));
|
||||
}
|
||||
break;
|
||||
case WM_SHOWWINDOW:
|
||||
{
|
||||
if (!propPageContext->LayoutInitialized)
|
||||
|
||||
@@ -196,6 +196,7 @@
|
||||
<ClCompile Include="misc.c" />
|
||||
<ClCompile Include="peprp.c" />
|
||||
<ClCompile Include="prpsh.c" />
|
||||
<ClCompile Include="settings.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\peview.h" />
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
<ClCompile Include="prpsh.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="settings.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="include\peview.h">
|
||||
|
||||
+62
-1
@@ -23,6 +23,7 @@
|
||||
// NOTE: Copied from processhacker2\ProcessHacker\procprp.c
|
||||
|
||||
#include <peview.h>
|
||||
#include <settings.h>
|
||||
|
||||
PPH_OBJECT_TYPE PvpPropContextType;
|
||||
PPH_OBJECT_TYPE PvpPropPageContextType;
|
||||
@@ -80,6 +81,7 @@ PPV_PROPCONTEXT PvCreatePropContext(
|
||||
memset(propContext, 0, sizeof(PV_PROPCONTEXT));
|
||||
|
||||
propContext->Title = Caption;
|
||||
propContext->StartPage = PhGetStringSetting(L"MainWindowPage");
|
||||
propContext->PropSheetPages = PhAllocate(sizeof(HPROPSHEETPAGE) * PV_PROPCONTEXT_MAXPAGES);
|
||||
|
||||
memset(&propSheetHeader, 0, sizeof(PROPSHEETHEADER));
|
||||
@@ -97,6 +99,9 @@ PPV_PROPCONTEXT PvCreatePropContext(
|
||||
propSheetHeader.nStartPage = 0;
|
||||
propSheetHeader.phpage = propContext->PropSheetPages;
|
||||
|
||||
propSheetHeader.dwFlags |= PSH_USEPSTARTPAGE;
|
||||
propSheetHeader.pStartPage = propContext->StartPage->Buffer;
|
||||
|
||||
memcpy(&propContext->PropSheetHeader, &propSheetHeader, sizeof(PROPSHEETHEADER));
|
||||
|
||||
return propContext;
|
||||
@@ -110,7 +115,9 @@ VOID NTAPI PvpPropContextDeleteProcedure(
|
||||
PPV_PROPCONTEXT propContext = (PPV_PROPCONTEXT)Object;
|
||||
|
||||
PhFree(propContext->PropSheetPages);
|
||||
|
||||
PhDereferenceObject(propContext->Title);
|
||||
PhDereferenceObject(propContext->StartPage);
|
||||
}
|
||||
|
||||
INT CALLBACK PvpPropSheetProc(
|
||||
@@ -189,6 +196,30 @@ LRESULT CALLBACK PvpPropSheetWndProc(
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_DESTROY:
|
||||
{
|
||||
HWND tabControl;
|
||||
TCITEM tabItem;
|
||||
WCHAR text[128];
|
||||
|
||||
// Save the window position and size.
|
||||
|
||||
PhSaveWindowPlacementToSetting(L"MainWindowPosition", L"MainWindowSize", hWnd);
|
||||
|
||||
// Save the selected tab.
|
||||
|
||||
tabControl = PropSheet_GetTabControl(hWnd);
|
||||
|
||||
tabItem.mask = TCIF_TEXT;
|
||||
tabItem.pszText = text;
|
||||
tabItem.cchTextMax = sizeof(text) / 2 - 1;
|
||||
|
||||
if (TabCtrl_GetItem(tabControl, TabCtrl_GetCurSel(tabControl), &tabItem))
|
||||
{
|
||||
PhSetStringSetting(L"MainWindowPage", text);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_NCDESTROY:
|
||||
{
|
||||
RemoveWindowSubclass(hWnd, PvpPropSheetWndProc, uIdSubclass);
|
||||
@@ -262,6 +293,32 @@ BOOLEAN PhpInitializePropSheetLayoutStage1(
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
VOID PhpInitializePropSheetLayoutStage2(
|
||||
_In_ HWND hwnd
|
||||
)
|
||||
{
|
||||
PH_RECTANGLE windowRectangle;
|
||||
|
||||
windowRectangle.Position = PhGetIntegerPairSetting(L"MainWindowPosition");
|
||||
windowRectangle.Size = PhGetScalableIntegerPairSetting(L"MainWindowSize", TRUE).Pair;
|
||||
|
||||
if (windowRectangle.Size.X < MinimumSize.right)
|
||||
windowRectangle.Size.X = MinimumSize.right;
|
||||
if (windowRectangle.Size.Y < MinimumSize.bottom)
|
||||
windowRectangle.Size.Y = MinimumSize.bottom;
|
||||
|
||||
PhAdjustRectangleToWorkingArea(NULL, &windowRectangle);
|
||||
|
||||
MoveWindow(hwnd, windowRectangle.Left, windowRectangle.Top,
|
||||
windowRectangle.Width, windowRectangle.Height, FALSE);
|
||||
|
||||
// Implement cascading by saving an offsetted rectangle.
|
||||
windowRectangle.Left += 20;
|
||||
windowRectangle.Top += 20;
|
||||
|
||||
PhSetIntegerPairSetting(L"MainWindowPosition", windowRectangle.Position);
|
||||
}
|
||||
|
||||
BOOLEAN PvAddPropPage(
|
||||
_Inout_ PPV_PROPCONTEXT PropContext,
|
||||
_In_ _Assume_refs_(1) PPV_PROPPAGECONTEXT PropPageContext
|
||||
@@ -378,13 +435,14 @@ PPH_LAYOUT_ITEM PvAddPropPageLayoutItem(
|
||||
PPV_PROPSHEETCONTEXT propSheetContext;
|
||||
PPH_LAYOUT_MANAGER layoutManager;
|
||||
PPH_LAYOUT_ITEM realParentItem;
|
||||
BOOLEAN doLayoutStage2;
|
||||
PPH_LAYOUT_ITEM item;
|
||||
|
||||
parent = GetParent(hwnd);
|
||||
propSheetContext = PvpGetPropSheetContext(parent);
|
||||
layoutManager = &propSheetContext->LayoutManager;
|
||||
|
||||
PhpInitializePropSheetLayoutStage1(propSheetContext, parent);
|
||||
doLayoutStage2 = PhpInitializePropSheetLayoutStage1(propSheetContext, parent);
|
||||
|
||||
if (ParentItem != PH_PROP_PAGE_TAB_CONTROL_PARENT)
|
||||
realParentItem = ParentItem;
|
||||
@@ -424,6 +482,9 @@ PPH_LAYOUT_ITEM PvAddPropPageLayoutItem(
|
||||
item = PhAddLayoutItem(layoutManager, Handle, realParentItem, Anchor);
|
||||
}
|
||||
|
||||
if (doLayoutStage2)
|
||||
PhpInitializePropSheetLayoutStage2(parent);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* PE viewer -
|
||||
* program settings
|
||||
*
|
||||
* 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 <peview.h>
|
||||
#include <shlobj.h>
|
||||
|
||||
static PPH_STRING PeSettingsFileName = NULL;
|
||||
|
||||
VOID PhAddDefaultSettings(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
PhpAddIntegerSetting(L"FirstRun", L"1");
|
||||
PhpAddStringSetting(L"Font", L""); // null
|
||||
PhpAddIntegerSetting(L"MaxSizeUnit", L"6");
|
||||
PhpAddStringSetting(L"MainWindowPage", L"General");
|
||||
PhpAddIntegerPairSetting(L"MainWindowPosition", L"150,150");
|
||||
PhpAddScalableIntegerPairSetting(L"MainWindowSize", L"@96|550,580");
|
||||
PhpAddStringSetting(L"ImageCfgListViewColumns", L"");
|
||||
PhpAddStringSetting(L"ImageExportsListViewColumns", L"");
|
||||
PhpAddStringSetting(L"ImageImportsListViewColumns", L"");
|
||||
PhpAddStringSetting(L"ImageLoadCfgListViewColumns", L"");
|
||||
}
|
||||
|
||||
VOID PhUpdateCachedSettings(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
NOTHING;
|
||||
}
|
||||
|
||||
VOID PeInitializeSettings(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
static PH_STRINGREF settingsSuffix = PH_STRINGREF_INIT(L".peview.xml");
|
||||
NTSTATUS status;
|
||||
PPH_STRING appFileName;
|
||||
PPH_STRING tempFileName;
|
||||
|
||||
// There are three possible locations for the settings file:
|
||||
// 1. A file named peview.exe.peview.xml in the program directory. (This changes
|
||||
// based on the executable file name.)
|
||||
// 2. The default location.
|
||||
|
||||
// 1. File in program directory
|
||||
|
||||
appFileName = PhGetApplicationFileName();
|
||||
tempFileName = PhConcatStringRef2(&appFileName->sr, &settingsSuffix);
|
||||
PhDereferenceObject(appFileName);
|
||||
|
||||
if (RtlDoesFileExists_U(tempFileName->Buffer))
|
||||
{
|
||||
PeSettingsFileName = tempFileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
PhDereferenceObject(tempFileName);
|
||||
}
|
||||
|
||||
// 2. Default location
|
||||
if (!PeSettingsFileName)
|
||||
{
|
||||
PeSettingsFileName = PhGetKnownLocation(CSIDL_APPDATA, L"\\Process Hacker\\peview.xml");
|
||||
}
|
||||
|
||||
if (PeSettingsFileName)
|
||||
{
|
||||
status = PhLoadSettings(PeSettingsFileName->Buffer);
|
||||
|
||||
// If we didn't find the file, it will be created. Otherwise,
|
||||
// there was probably a parsing error and we don't want to
|
||||
// change anything.
|
||||
if (status == STATUS_FILE_CORRUPT_ERROR)
|
||||
{
|
||||
if (PhShowMessage(
|
||||
NULL,
|
||||
MB_ICONWARNING | MB_YESNO,
|
||||
L"PE View's settings file is corrupt. Do you want to reset it?\n"
|
||||
L"If you select No, the settings system will not function properly."
|
||||
) == IDYES)
|
||||
{
|
||||
HANDLE fileHandle;
|
||||
IO_STATUS_BLOCK isb;
|
||||
CHAR data[] = "<settings></settings>";
|
||||
|
||||
// This used to delete the file. But it's better to keep the file there
|
||||
// and overwrite it with some valid XML, especially with case (2) above.
|
||||
if (NT_SUCCESS(PhCreateFileWin32(
|
||||
&fileHandle,
|
||||
PeSettingsFileName->Buffer,
|
||||
FILE_GENERIC_WRITE,
|
||||
0,
|
||||
FILE_SHARE_READ | FILE_SHARE_DELETE,
|
||||
FILE_OVERWRITE,
|
||||
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT
|
||||
)))
|
||||
{
|
||||
NtWriteFile(fileHandle, NULL, NULL, NULL, &isb, data, sizeof(data) - 1, NULL, NULL);
|
||||
NtClose(fileHandle);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Pretend we don't have a settings store so bad things don't happen.
|
||||
PhDereferenceObject(PeSettingsFileName);
|
||||
PeSettingsFileName = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply basic global settings.
|
||||
PhMaxSizeUnit = PhGetIntegerSetting(L"MaxSizeUnit");
|
||||
}
|
||||
|
||||
VOID PeSaveSettings(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
if (PeSettingsFileName)
|
||||
PhSaveSettings(PeSettingsFileName->Buffer);
|
||||
}
|
||||
Reference in New Issue
Block a user