Skip to content

Commit af0be72

Browse files
committed
objmgr cleanup and improvements
- Handles tab Refresh (F5) button added. - EtTreeViewFindItem add reverse scan for more reliable result. - [Resolver] Extract Section information for more kernel objects using driver.
1 parent c7ee979 commit af0be72

File tree

7 files changed

+456
-327
lines changed

7 files changed

+456
-327
lines changed

phlib/delayhook.c

+10
Original file line numberDiff line numberDiff line change
@@ -2158,6 +2158,16 @@ VOID PhInitializeSuperclassControls(
21582158
if (PhEnableThemeAcrylicSupport)
21592159
PhEnableThemeAcrylicSupport = PhIsThemeTransparencyEnabled();
21602160

2161+
// If PreferredAppMode is not set, PhShouldAppsUseDarkMode returns current system app color mode.
2162+
// When app mode set to always dark/light all subsequent calls to PhShouldAppsUseDarkMode always ignore
2163+
// the current system app color mode and return:
2164+
// AppMode = PreferredAppModeDarkAlways always return TRUE
2165+
// AppMode = PreferredAppModeLightAlways always return FALSE
2166+
//
2167+
// It's very convenient because all new opened windows (especially plugin windows) will always have same theme
2168+
// even if the system theme was changed while SI is running. To update theme in this case SI restart is required.
2169+
PhSetPreferredAppMode(PhEnableThemeSupport ? PreferredAppModeDarkAlways : PreferredAppModeLightAlways);
2170+
21612171
if (PhEnableThemeSupport || PhEnableStreamerMode)
21622172
{
21632173
if (WindowsVersion >= WINDOWS_11)

phlib/include/guisup.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,8 @@ typedef enum _PreferredAppMode
241241
{
242242
PreferredAppModeDisabled,
243243
PreferredAppModeDarkOnDark,
244-
PreferredAppModeDarkAlways
244+
PreferredAppModeDarkAlways,
245+
PreferredAppModeLightAlways
245246
} PreferredAppMode;
246247

247248
PHLIBAPI

phlib/theme.c

-15
Original file line numberDiff line numberDiff line change
@@ -160,21 +160,6 @@ VOID PhInitializeWindowTheme(
160160
_In_ BOOLEAN EnableThemeSupport
161161
)
162162
{
163-
if (EnableThemeSupport && WindowsVersion >= WINDOWS_10_RS5)
164-
{
165-
static PH_INITONCE initOnce = PH_INITONCE_INIT;
166-
167-
if (PhBeginInitOnce(&initOnce))
168-
{
169-
PhSetPreferredAppMode(PreferredAppModeDarkAlways);
170-
171-
//if (FlushMenuThemes_I)
172-
// FlushMenuThemes_I();
173-
174-
PhEndInitOnce(&initOnce);
175-
}
176-
}
177-
178163
PhInitializeThemeWindowFrame(WindowHandle);
179164

180165
if (!PhThemeWindowBackgroundBrush)

plugins/ExtendedTools/ExtendedTools.rc

+5-4
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,11 @@ BEGIN
485485
CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,7,286,262
486486
LTEXT "Total handles found:",IDC_STATIC,10,273,67,8
487487
LTEXT "100000",IDC_OBJ_HANDLESTOTAL,78,273,32,8
488-
LTEXT "By address:",IDC_STATIC,137,273,39,8
489-
LTEXT "100000",IDC_OBJ_HANDLESBYOBJECT,177,273,27,8
490-
LTEXT "By name:", IDC_OBJ_HANDLESBYNAME_L,235,273,31,8
491-
LTEXT "100000",IDC_OBJ_HANDLESBYNAME,267,273,27,8
488+
LTEXT "By address:",IDC_STATIC,110,273,39,8
489+
LTEXT "100000",IDC_OBJ_HANDLESBYOBJECT,150,273,27,8
490+
LTEXT "By name:", IDC_OBJ_HANDLESBYNAME_L,182,273,31,8
491+
LTEXT "100000",IDC_OBJ_HANDLESBYNAME,214,273,27,8
492+
PUSHBUTTON "Refresh (F5)",IDC_REFRESH,245,271,48,13
492493
END
493494

494495
IDD_OBJWINSTA DIALOGEX 0, 0, 260, 200

plugins/ExtendedTools/exttools.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,8 @@ VOID EtShowObjectManagerDialog(
16621662
NTSTATUS EtDuplicateHandleFromProcessEx(
16631663
_Out_ PHANDLE Handle,
16641664
_In_ ACCESS_MASK DesiredAccess,
1665-
_In_ HANDLE ProcessId,
1665+
_In_opt_ HANDLE ProcessId,
1666+
_In_opt_ HANDLE ProcessHandle,
16661667
_In_ HANDLE SourceHandle
16671668
);
16681669

0 commit comments

Comments
 (0)