Skip to content

Commit

Permalink
remove objmgr code
Browse files Browse the repository at this point in the history
  • Loading branch information
DartVanya committed Nov 23, 2024
1 parent 165f3a5 commit a96cb9b
Show file tree
Hide file tree
Showing 7 changed files with 401 additions and 766 deletions.
34 changes: 7 additions & 27 deletions KSystemInformer/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -2086,16 +2086,13 @@ NTSTATUS KphQueryInformationObject(

break;
}
case KphObjectExtendedInformation:
case KphObjectAttributesInformation:
{
POBJECT_TYPE objectType;
USHORT objectTypeIndex;

if (!ObjectInformation ||
(ObjectInformationLength < sizeof(KPH_OBJECT_EXTENDED_INFORMATION)))
(ObjectInformationLength < sizeof(KPH_OBJECT_ATTRIBUTES_INFORMATION)))
{
status = STATUS_INFO_LENGTH_MISMATCH;
returnLength = sizeof(KPH_OBJECT_EXTENDED_INFORMATION);
returnLength = sizeof(KPH_OBJECT_ATTRIBUTES_INFORMATION);
goto Exit;
}

Expand All @@ -2118,30 +2115,13 @@ NTSTATUS KphQueryInformationObject(
goto Exit;
}

objectTypeIndex = USHORT_MAX;

objectType = ObGetObjectType(object);
if (objectType)
{
dyn = KphReferenceDynData();
if (dyn && (dyn->OtIndex != ULONG_MAX)) {
UCHAR typeIndex;

typeIndex = *(PUCHAR)Add2Ptr(objectType, dyn->OtIndex);

objectTypeIndex = (USHORT)typeIndex;
}
}

__try
{
PKPH_OBJECT_EXTENDED_INFORMATION extendedInfo;
PKPH_OBJECT_ATTRIBUTES_INFORMATION attributesInfo;

extendedInfo = ObjectInformation;
extendedInfo->Object = object;
extendedInfo->ObjectTypeIndex = objectTypeIndex;
extendedInfo->Flags = OBJECT_TO_OBJECT_HEADER(object)->Flags;
returnLength = sizeof(KPH_OBJECT_EXTENDED_INFORMATION);
attributesInfo = ObjectInformation;
attributesInfo->Flags = OBJECT_TO_OBJECT_HEADER(object)->Flags;
returnLength = sizeof(KPH_OBJECT_ATTRIBUTES_INFORMATION);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
Expand Down
5 changes: 1 addition & 4 deletions SystemInformer/srvprp.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,7 @@ INT_PTR CALLBACK PhpServiceGeneralDlgProc(

context->Ready = TRUE;

if (PhEnableThemeSupport) // TODO: Required for compat (dmex)
PhInitializeWindowTheme(GetParent(hwndDlg), PhEnableThemeSupport); // HACK (GetParent)
else
PhInitializeWindowTheme(hwndDlg, FALSE);
PhInitializeWindowTheme(GetParent(hwndDlg), PhEnableThemeSupport); // HACK (GetParent)
}
break;
case WM_DESTROY:
Expand Down
5 changes: 1 addition & 4 deletions SystemInformer/tokprp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2586,10 +2586,7 @@ INT_PTR CALLBACK PhpTokenGeneralPageProc(

EnableWindow(GetDlgItem(hwndDlg, IDC_LINKEDTOKEN), !!hasLinkedToken);

if (PhEnableThemeSupport) // TODO: Required for compat (dmex)
PhInitializeWindowTheme(GetParent(hwndDlg), PhEnableThemeSupport); // HACK (GetParent)
else
PhInitializeWindowTheme(hwndDlg, FALSE);
PhInitializeWindowTheme(GetParent(hwndDlg), PhEnableThemeSupport); // HACK (GetParent)
}
break;
case WM_COMMAND:
Expand Down
8 changes: 3 additions & 5 deletions kphlib/include/kphapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ typedef enum _KPH_OBJECT_INFORMATION_CLASS
KphObjectSectionOriginalBaseInformation, // q: PVOID BaseAddress
KphObjectSectionInternalImageInformation, // q: SECTION_INTERNAL_IMAGE_INFORMATION
KphObjectSectionMappingsInformation, // q: KPH_SECTION_MAPPINGS_INFORMATION
KphObjectExtendedInformation, // q: KPH_OBJECT_EXTENDED_INFORMATION
KphObjectAttributesInformation, // q: KPH_OBJECT_ATTRIBUTES_INFORMATION
MaxKphObjectInfoClass
} KPH_OBJECT_INFORMATION_CLASS;

Expand Down Expand Up @@ -255,10 +255,8 @@ typedef struct _KPH_FILE_OBJECT_DRIVER
HANDLE DriverHandle;
} KPH_FILE_OBJECT_DRIVER, *PKPH_FILE_OBJECT_DRIVER;

typedef struct _KPH_OBJECT_EXTENDED_INFORMATION
typedef struct _KPH_OBJECT_ATTRIBUTES_INFORMATION
{
PVOID Object;
USHORT ObjectTypeIndex;
union
{
UCHAR Flags;
Expand All @@ -274,7 +272,7 @@ typedef struct _KPH_OBJECT_EXTENDED_INFORMATION
UCHAR DeletedInline : 1;
};
};
} KPH_OBJECT_EXTENDED_INFORMATION, *PKPH_OBJECT_EXTENDED_INFORMATION;
} KPH_OBJECT_ATTRIBUTES_INFORMATION, *PKPH_OBJECT_ATTRIBUTES_INFORMATION;

// Driver information

Expand Down
5 changes: 4 additions & 1 deletion phlib/treenew.c
Original file line number Diff line number Diff line change
Expand Up @@ -5364,7 +5364,10 @@ VOID PhTnpPaint(
BLENDFUNCTION blendFunction;

// Fix ForeColor for theme, previously it was always white. Plus 90-100 brightness adjustments seems fine for good contrast. (Dart Vanya)
SetTextColor(hdc, !node->UseAutoForeColor && node->s.DrawForeColor != 0 ? PhMakeColorBrighter(node->s.DrawForeColor, 95) : PhThemeWindowTextColor);
SetTextColor(hdc,
!node->UseAutoForeColor && node->s.DrawForeColor != 0 ?
PhMakeColorBrighter(node->s.DrawForeColor, node->s.DrawBackColor == 16777215 ? 95 : 105) :
PhThemeWindowTextColor);
SetDCBrushColor(hdc, PhThemeWindowBackgroundColor);
FillRect(hdc, &rowRect, PhGetStockBrush(DC_BRUSH));

Expand Down
Loading

0 comments on commit a96cb9b

Please sign in to comment.