Tidy up #221
This commit is contained in:
@@ -810,4 +810,10 @@ HPROPSHEETPAGE PhCreateTokenPage(
|
||||
_In_opt_ DLGPROC HookProc
|
||||
);
|
||||
|
||||
// prpggen
|
||||
|
||||
PPH_STRING PhGetProcessItemProtectionText(
|
||||
_In_ PPH_PROCESS_ITEM ProcessItem
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
+11
-12
@@ -1454,22 +1454,21 @@ VOID PhpFillProcessItem(
|
||||
}
|
||||
|
||||
// Protection
|
||||
if (ProcessItem->QueryHandle)
|
||||
if (WindowsVersion >= WINDOWS_8_1 && ProcessItem->QueryHandle)
|
||||
{
|
||||
if (WindowsVersion >= WINDOWS_8_1)
|
||||
PS_PROTECTION protection;
|
||||
|
||||
if (NT_SUCCESS(NtQueryInformationProcess(
|
||||
ProcessItem->QueryHandle,
|
||||
ProcessProtectionInformation,
|
||||
&protection,
|
||||
sizeof(PS_PROTECTION),
|
||||
NULL
|
||||
)))
|
||||
{
|
||||
NtQueryInformationProcess(
|
||||
ProcessItem->QueryHandle,
|
||||
ProcessProtectionInformation,
|
||||
&ProcessItem->Protection,
|
||||
sizeof(ProcessItem->Protection),
|
||||
NULL);
|
||||
ProcessItem->Protection.Level = protection.Level;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessItem->Protection.Level = (UCHAR)-1;
|
||||
}
|
||||
|
||||
// On Windows 8.1 and above, processes without threads are reflected processes
|
||||
// which will not terminate if we have a handle open.
|
||||
|
||||
@@ -2801,10 +2801,11 @@ BOOLEAN NTAPI PhpProcessTreeNewCallback(
|
||||
break;
|
||||
case PHPRTLC_PROTECTION:
|
||||
{
|
||||
extern PPH_STRING PhpFormatProcessProtection(_In_ PPH_PROCESS_ITEM ProcessItem);
|
||||
|
||||
PhMoveReference(&node->ProtectionText, PhpFormatProcessProtection(processItem));
|
||||
getCellText->Text = node->ProtectionText->sr;
|
||||
if (processItem->Protection.Level != 0)
|
||||
{
|
||||
PhMoveReference(&node->ProtectionText, PhGetProcessItemProtectionText(processItem));
|
||||
getCellText->Text = node->ProtectionText->sr;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -38,11 +38,13 @@
|
||||
static PWSTR ProtectedSignerStrings[] =
|
||||
{ L"", L" (Authenticode)", L" (CodeGen)", L" (Antimalware)", L" (Lsa)", L" (Windows)", L" (WinTcb)", L" (WinSystem)", L" (StoreApp)" };
|
||||
|
||||
PPH_STRING PhpFormatProcessProtection(_In_ PPH_PROCESS_ITEM ProcessItem)
|
||||
PPH_STRING PhGetProcessItemProtectionText(
|
||||
_In_ PPH_PROCESS_ITEM ProcessItem
|
||||
)
|
||||
{
|
||||
if (ProcessItem->Protection.Level != (UCHAR)-1)
|
||||
if (WindowsVersion >= WINDOWS_8_1)
|
||||
{
|
||||
if (WindowsVersion >= WINDOWS_8_1)
|
||||
if (ProcessItem->Protection.Level != 0)
|
||||
{
|
||||
PWSTR type;
|
||||
PWSTR signer;
|
||||
@@ -350,13 +352,11 @@ INT_PTR CALLBACK PhpProcessGeneralDlgProc(
|
||||
|
||||
SetDlgItemText(hwndDlg, IDC_PEBADDRESS, L"N/A");
|
||||
|
||||
PhOpenProcess(
|
||||
if (NT_SUCCESS(PhOpenProcess(
|
||||
&processHandle,
|
||||
ProcessQueryAccess,
|
||||
processItem->ProcessId
|
||||
);
|
||||
|
||||
if (processHandle)
|
||||
)))
|
||||
{
|
||||
PhGetProcessBasicInformation(processHandle, &basicInfo);
|
||||
#ifdef _WIN64
|
||||
@@ -381,7 +381,7 @@ INT_PTR CALLBACK PhpProcessGeneralDlgProc(
|
||||
|
||||
// Protection
|
||||
|
||||
SetDlgItemText(hwndDlg, IDC_PROTECTION, PH_AUTO_T(PH_STRING, PhpFormatProcessProtection(processItem))->Buffer);
|
||||
SetDlgItemText(hwndDlg, IDC_PROTECTION, PH_AUTO_T(PH_STRING, PhGetProcessItemProtectionText(processItem))->Buffer);
|
||||
|
||||
#ifdef _WIN64
|
||||
if (processItem->IsWow64Valid)
|
||||
|
||||
Reference in New Issue
Block a user