Skip to content

Commit

Permalink
objmgr cleanup and improvements
Browse files Browse the repository at this point in the history
- Handles tab Refresh (F5) button added.
- EtTreeViewFindItem add reverse scan for more reliable result.
- [Resolver] Extract Section information for more kernel objects using driver.
  • Loading branch information
DartVanya committed Nov 20, 2024
1 parent c7ee979 commit 9fa8c81
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 331 deletions.
4 changes: 0 additions & 4 deletions SystemInformer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ VOID PhInitializeCommonControls(
VOID
);

VOID PhInitializeSuperclassControls( // delayhook.c
VOID
);

BOOLEAN PhInitializeAppSystem(
VOID
);
Expand Down
10 changes: 10 additions & 0 deletions phlib/delayhook.c
Original file line number Diff line number Diff line change
Expand Up @@ -2158,6 +2158,16 @@ VOID PhInitializeSuperclassControls(
if (PhEnableThemeAcrylicSupport)
PhEnableThemeAcrylicSupport = PhIsThemeTransparencyEnabled();

// If PreferredAppMode is not set, PhShouldAppsUseDarkMode returns current Windows app color mode.
// When app mode set to always dark/light all subsequent calls to PhShouldAppsUseDarkMode always ignore
// the current Windows app color mode and return:
// AppMode = PreferredAppModeDarkAlways always return TRUE
// AppMode = PreferredAppModeLightAlways always return FALSE
//
// It's very convenient because all new opened windows (especially plugin windows) will always have same theme
// even if the system theme was changed while SI is running. To update theme in this case SI restart is required.
PhSetPreferredAppMode(PhEnableThemeSupport ? PreferredAppModeDarkAlways : PreferredAppModeLightAlways);

if (PhEnableThemeSupport || PhEnableStreamerMode)
{
if (WindowsVersion >= WINDOWS_11)
Expand Down
3 changes: 2 additions & 1 deletion phlib/include/guisup.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ typedef enum _PreferredAppMode
{
PreferredAppModeDisabled,
PreferredAppModeDarkOnDark,
PreferredAppModeDarkAlways
PreferredAppModeDarkAlways,
PreferredAppModeLightAlways
} PreferredAppMode;

PHLIBAPI
Expand Down
15 changes: 0 additions & 15 deletions phlib/theme.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,6 @@ VOID PhInitializeWindowTheme(
_In_ BOOLEAN EnableThemeSupport
)
{
if (EnableThemeSupport && WindowsVersion >= WINDOWS_10_RS5)
{
static PH_INITONCE initOnce = PH_INITONCE_INIT;

if (PhBeginInitOnce(&initOnce))
{
PhSetPreferredAppMode(PreferredAppModeDarkAlways);

//if (FlushMenuThemes_I)
// FlushMenuThemes_I();

PhEndInitOnce(&initOnce);
}
}

PhInitializeThemeWindowFrame(WindowHandle);

if (!PhThemeWindowBackgroundBrush)
Expand Down
9 changes: 5 additions & 4 deletions plugins/ExtendedTools/ExtendedTools.rc
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,11 @@ BEGIN
CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,7,286,262
LTEXT "Total handles found:",IDC_STATIC,10,273,67,8
LTEXT "100000",IDC_OBJ_HANDLESTOTAL,78,273,32,8
LTEXT "By address:",IDC_STATIC,137,273,39,8
LTEXT "100000",IDC_OBJ_HANDLESBYOBJECT,177,273,27,8
LTEXT "By name:", IDC_OBJ_HANDLESBYNAME_L,235,273,31,8
LTEXT "100000",IDC_OBJ_HANDLESBYNAME,267,273,27,8
LTEXT "By address:",IDC_STATIC,110,273,39,8
LTEXT "100000",IDC_OBJ_HANDLESBYOBJECT,150,273,27,8
LTEXT "By name:", IDC_OBJ_HANDLESBYNAME_L,182,273,31,8
LTEXT "100000",IDC_OBJ_HANDLESBYNAME,214,273,27,8
PUSHBUTTON "Refresh (F5)",IDC_REFRESH,245,271,48,13
END

IDD_OBJWINSTA DIALOGEX 0, 0, 260, 200
Expand Down
3 changes: 2 additions & 1 deletion plugins/ExtendedTools/exttools.h
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,8 @@ VOID EtShowObjectManagerDialog(
NTSTATUS EtDuplicateHandleFromProcessEx(
_Out_ PHANDLE Handle,
_In_ ACCESS_MASK DesiredAccess,
_In_ HANDLE ProcessId,
_In_opt_ HANDLE ProcessId,
_In_opt_ HANDLE ProcessHandle,
_In_ HANDLE SourceHandle
);

Expand Down
Loading

0 comments on commit 9fa8c81

Please sign in to comment.