Tidy up
This commit is contained in:
@@ -305,7 +305,7 @@ PPH_STRING PhGetApplicationVersionString(
|
||||
PhInitFormatC(&format[6], L'.');
|
||||
PhInitFormatU(&format[7], PHAPP_VERSION_REVISION);
|
||||
PhInitFormatC(&format[8], L' ');
|
||||
PhInitFormatS(&format[9], (PWSTR)channelName);
|
||||
PhInitFormatS(&format[9], channelName);
|
||||
|
||||
return PhFormat(format, RTL_NUMBER_OF(format), 0);
|
||||
#endif
|
||||
|
||||
@@ -1235,7 +1235,7 @@ BOOLEAN PhUiConnectSession(
|
||||
PPH_STRING oldSelectedChoice = NULL;
|
||||
|
||||
// Try once with no password.
|
||||
if (WinStationConnectW(NULL, SessionId, LOGONID_CURRENT, L"", TRUE))
|
||||
if (WinStationConnectW(WINSTATION_CURRENT_SERVER, SessionId, LOGONID_CURRENT, L"", TRUE))
|
||||
return TRUE;
|
||||
|
||||
while (PhaChoiceDialog(
|
||||
@@ -1259,7 +1259,7 @@ BOOLEAN PhUiConnectSession(
|
||||
|
||||
oldSelectedChoice = selectedChoice;
|
||||
|
||||
if (WinStationConnectW(NULL, SessionId, LOGONID_CURRENT, selectedChoice->Buffer, TRUE))
|
||||
if (WinStationConnectW(WINSTATION_CURRENT_SERVER, SessionId, LOGONID_CURRENT, selectedChoice->Buffer, TRUE))
|
||||
{
|
||||
success = TRUE;
|
||||
break;
|
||||
@@ -1285,7 +1285,7 @@ BOOLEAN PhUiDisconnectSession(
|
||||
_In_ ULONG SessionId
|
||||
)
|
||||
{
|
||||
if (WinStationDisconnect(NULL, SessionId, FALSE))
|
||||
if (WinStationDisconnect(WINSTATION_CURRENT_SERVER, SessionId, FALSE))
|
||||
return TRUE;
|
||||
else
|
||||
PhShowStatus(WindowHandle, L"Unable to disconnect the session", 0, GetLastError());
|
||||
@@ -1306,7 +1306,7 @@ BOOLEAN PhUiLogoffSession(
|
||||
FALSE
|
||||
))
|
||||
{
|
||||
if (WinStationReset(NULL, SessionId, FALSE))
|
||||
if (WinStationReset(WINSTATION_CURRENT_SERVER, SessionId, FALSE))
|
||||
return TRUE;
|
||||
else
|
||||
PhShowStatus(WindowHandle, L"Unable to logoff the session", 0, GetLastError());
|
||||
@@ -2280,7 +2280,7 @@ BOOLEAN PhUiRestartProcess(
|
||||
|
||||
if (PhGetIntegerSetting(L"EnableWarnings"))
|
||||
{
|
||||
cont = PhShowConfirmMessage(
|
||||
result = PhShowConfirmMessage(
|
||||
WindowHandle,
|
||||
L"restart",
|
||||
Process->ProcessName->Buffer,
|
||||
@@ -2291,10 +2291,10 @@ BOOLEAN PhUiRestartProcess(
|
||||
}
|
||||
else
|
||||
{
|
||||
cont = TRUE;
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
if (!cont)
|
||||
if (!result)
|
||||
return FALSE;
|
||||
|
||||
// Fail when restarting the current process otherwise
|
||||
|
||||
@@ -340,7 +340,6 @@ NTSTATUS PhGetProcessKnownType(
|
||||
NTSTATUS status;
|
||||
PROCESS_BASIC_INFORMATION basicInfo;
|
||||
PPH_STRING fileName;
|
||||
PPH_STRING newFileName;
|
||||
|
||||
if (!NT_SUCCESS(status = PhGetProcessBasicInformation(
|
||||
ProcessHandle,
|
||||
@@ -362,15 +361,12 @@ NTSTATUS PhGetProcessKnownType(
|
||||
return status;
|
||||
}
|
||||
|
||||
newFileName = PhGetFileName(fileName);
|
||||
PhDereferenceObject(fileName);
|
||||
|
||||
*KnownProcessType = PhGetProcessKnownTypeEx(
|
||||
basicInfo.UniqueProcessId,
|
||||
newFileName
|
||||
fileName
|
||||
);
|
||||
|
||||
PhDereferenceObject(newFileName);
|
||||
PhDereferenceObject(fileName);
|
||||
|
||||
return status;
|
||||
}
|
||||
@@ -394,7 +390,7 @@ PH_KNOWN_PROCESS_TYPE PhGetProcessKnownTypeEx(
|
||||
if (PhIsNullOrEmptyString(FileName))
|
||||
return UnknownProcessType;
|
||||
|
||||
PhGetSystemRoot(&systemRootPrefix);
|
||||
PhGetNtSystemRoot(&systemRootPrefix);
|
||||
|
||||
fileName = PhReferenceObject(FileName);
|
||||
name = fileName->sr;
|
||||
|
||||
@@ -224,9 +224,9 @@ INT_PTR CALLBACK PhpChoiceDlgProc(
|
||||
|
||||
ShowWindow(checkBoxHandle, SW_HIDE);
|
||||
GetWindowRect(checkBoxHandle, &checkBoxRect);
|
||||
MapWindowPoints(NULL, hwndDlg, (POINT *)&checkBoxRect, 2);
|
||||
MapWindowRect(NULL, hwndDlg, &checkBoxRect);
|
||||
GetWindowRect(GetDlgItem(hwndDlg, IDOK), &rect);
|
||||
MapWindowPoints(NULL, hwndDlg, (POINT *)&rect, 2);
|
||||
MapWindowRect(NULL, hwndDlg, &rect);
|
||||
diff = rect.top - checkBoxRect.top;
|
||||
|
||||
// OK
|
||||
@@ -238,7 +238,7 @@ INT_PTR CALLBACK PhpChoiceDlgProc(
|
||||
|
||||
// Cancel
|
||||
GetWindowRect(GetDlgItem(hwndDlg, IDCANCEL), &rect);
|
||||
MapWindowPoints(NULL, hwndDlg, (POINT *)&rect, 2);
|
||||
MapWindowRect(NULL, hwndDlg, &rect);
|
||||
rect.top -= diff;
|
||||
rect.bottom -= diff;
|
||||
SetWindowPos(GetDlgItem(hwndDlg, IDCANCEL), NULL, rect.left, rect.top,
|
||||
|
||||
@@ -334,8 +334,8 @@ BOOLEAN PhCmLoadSettingsEx(
|
||||
PPH_HASHTABLE columnHashtable;
|
||||
PH_HASHTABLE_ENUM_CONTEXT enumContext;
|
||||
PPH_KEY_VALUE_PAIR pair;
|
||||
LONG orderArray[PH_CM_ORDER_LIMIT];
|
||||
LONG maxOrder;
|
||||
ULONG orderArray[PH_CM_ORDER_LIMIT];
|
||||
ULONG maxOrder;
|
||||
LONG dpiValue;
|
||||
|
||||
dpiValue = PhGetWindowDpi(TreeNewHandle);
|
||||
@@ -431,7 +431,7 @@ BOOLEAN PhCmLoadSettingsEx(
|
||||
if (columnPart.Length == 0 || !PhStringToInteger64(&columnPart, 10, &integer))
|
||||
goto CleanupExit;
|
||||
|
||||
width = (ULONG)integer;
|
||||
width = (LONG)integer;
|
||||
|
||||
if (scale != dpiValue && scale != 0)
|
||||
width = PhMultiplyDivideSigned(width, dpiValue, scale);
|
||||
@@ -483,7 +483,7 @@ BOOLEAN PhCmLoadSettingsEx(
|
||||
{
|
||||
orderArray[(*columnPtr)->DisplayIndex] = i;
|
||||
|
||||
if ((ULONG)maxOrder < (*columnPtr)->DisplayIndex + 1)
|
||||
if (maxOrder < (*columnPtr)->DisplayIndex + 1)
|
||||
maxOrder = (*columnPtr)->DisplayIndex + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1592,11 +1592,11 @@ HWND PhCreateWindowExHook(
|
||||
else if (PhEnableThemeSupport)
|
||||
{
|
||||
// Early subclassing of the SysLink control to eliminate blinking during page switches.
|
||||
if (!IS_INTRESOURCE(ClassName) && PhEqualStringZ((PWSTR)ClassName, WC_LINK, TRUE))
|
||||
if (!IS_INTRESOURCE(ClassName) && PhEqualStringZ(ClassName, WC_LINK, TRUE))
|
||||
{
|
||||
PhInitializeTaskDialogTheme(windowHandle, 0);
|
||||
}
|
||||
else if (!IS_INTRESOURCE(ClassName) && PhEqualStringZ((PWSTR)ClassName, WC_BUTTON, TRUE) &&
|
||||
else if (!IS_INTRESOURCE(ClassName) && PhEqualStringZ(ClassName, WC_BUTTON, TRUE) &&
|
||||
PhGetWindowContext(GetAncestor(Parent, GA_ROOT), LONG_MAX))
|
||||
{
|
||||
PhSetControlTheme(windowHandle, L"DarkMode_Explorer");
|
||||
|
||||
+207
-3
@@ -45,8 +45,6 @@ DEFINE_GUID(GUID_DEVINTERFACE_GRAPHICSPOWER, 0xea5c6870, 0xe93c, 0x4588, 0xbe, 0
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_GNSS, 0x3336e5e4, 0x18a, 0x4669, 0x84, 0xc5, 0xbd, 0x5, 0xf3, 0xbd, 0x36, 0x8b);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_HID, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_LAMP, 0x6c11e9e3, 0x8238, 0x4f0a, 0x0a, 0x19, 0xaa, 0xec, 0x26, 0xca, 0x5e, 0x98);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_NET, 0xcac88484, 0x7515, 0x4c03, 0x82, 0xe6, 0x71, 0xa8, 0x7a, 0xba, 0xc3, 0x61);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_NETUIO, 0x08336f60, 0x0679, 0x4c6c, 0x85, 0xd2, 0xae, 0x7c, 0xed, 0x65, 0xff, 0xf7);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_NFCDTA, 0x7fd3f30b, 0x5e49, 0x4be1, 0xb3, 0xaa, 0xaf, 0x06, 0x26, 0x0d, 0x23, 0x6a);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_NFCSE, 0x8dc7c854, 0xf5e5, 0x4bed, 0x81, 0x5d, 0xc, 0x85, 0xad, 0x4, 0x77, 0x25);
|
||||
DEFINE_GUID(GUID_DEVINTERFACE_NFP, 0xFB3842CD, 0x9E2A, 0x4F83, 0x8F, 0xCC, 0x4B, 0x07, 0x61, 0x13, 0x9A, 0xE9);
|
||||
@@ -112,11 +110,14 @@ DEFINE_DEVPROPKEY(DEVPKEY_Gpu_PhysicalAdapterIndex, 0x60b193cb, 0x5276, 0x4d0f,
|
||||
#include <wdmguid.h>
|
||||
#include <bthdef.h>
|
||||
#include <devguid.h>
|
||||
#include <ndisguid.h>
|
||||
#include <usbiodef.h>
|
||||
|
||||
#pragma push_macro("DEFINE_GUID")
|
||||
#undef DEFINE_GUID
|
||||
#include <pciprop.h>
|
||||
#include <ntddstor.h>
|
||||
#pragma pop_macro("DEFINE_GUID")
|
||||
|
||||
static PH_STRINGREF RootInstanceId = PH_STRINGREF_INIT(L"HTREE\\ROOT\\0");
|
||||
static ULONG RootInstanceIdHash = 2387464428; // PhHashStringRefEx(TRUE, PH_STRING_HASH_X65599);
|
||||
@@ -2005,7 +2006,7 @@ typedef struct _PH_WELL_KNOWN_GUID
|
||||
const GUID* Guid;
|
||||
PH_STRINGREF Symbol;
|
||||
} PH_WELL_KNOWN_GUID, *PPH_WELL_KNOWN_GUID;
|
||||
#define PH_DEFINE_WELL_KNOWN_GUID(guid) const PH_WELL_KNOWN_GUID PH_WELL_KNOWN_##guid = { &guid, PH_STRINGREF_INIT(TEXT(#guid)) }
|
||||
#define PH_DEFINE_WELL_KNOWN_GUID(guid) const PH_WELL_KNOWN_GUID PH_WELL_KNOWN_##guid = { &(guid), PH_STRINGREF_INIT(TEXT(#guid)) }
|
||||
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_HWPROFILE_QUERY_CHANGE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_HWPROFILE_CHANGE_CANCELLED);
|
||||
@@ -2299,6 +2300,7 @@ PH_DEFINE_WELL_KNOWN_GUID(GUID_DXGKDDI_FLEXIOV_DEVICE_INTERFACE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_SRIOV_DEVICE_INTERFACE_STANDARD);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_MITIGABLE_DEVICE_INTERFACE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_IO_VOLUME_DEVICE_INTERFACE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_NDIS_LAN_CLASS);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_NFC_RADIO_MEDIA_DEVICE_INTERFACE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_NFCSE_RADIO_MEDIA_DEVICE_INTERFACE);
|
||||
PH_DEFINE_WELL_KNOWN_GUID(GUID_BLUETOOTHLE_DEVICE_INTERFACE);
|
||||
@@ -2602,6 +2604,7 @@ static const PH_WELL_KNOWN_GUID* PhpWellKnownGuids[] =
|
||||
&PH_WELL_KNOWN_GUID_SRIOV_DEVICE_INTERFACE_STANDARD,
|
||||
&PH_WELL_KNOWN_GUID_MITIGABLE_DEVICE_INTERFACE,
|
||||
&PH_WELL_KNOWN_GUID_IO_VOLUME_DEVICE_INTERFACE,
|
||||
&PH_WELL_KNOWN_GUID_NDIS_LAN_CLASS,
|
||||
&PH_WELL_KNOWN_GUID_NFC_RADIO_MEDIA_DEVICE_INTERFACE,
|
||||
&PH_WELL_KNOWN_GUID_NFCSE_RADIO_MEDIA_DEVICE_INTERFACE,
|
||||
&PH_WELL_KNOWN_GUID_BLUETOOTHLE_DEVICE_INTERFACE,
|
||||
@@ -2741,6 +2744,81 @@ VOID NTAPI PhpDevPropFillGuid(
|
||||
}
|
||||
}
|
||||
|
||||
PPH_STRING PhpDevPropPciDeviceTypeToString(
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
WCHAR pointer[PH_PTR_STR_LEN_1];
|
||||
|
||||
PhInitializeStringBuilder(&stringBuilder, 10);
|
||||
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciConventional))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciConventional, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciX))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciX, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciExpressEndpoint))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressEndpoint, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciExpressLegacyEndpoint))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressLegacyEndpoint, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciExpressRootComplexIntegratedEndpoint))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressRootComplexIntegratedEndpoint, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_DeviceType_PciExpressTreatedAsPci))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressTreatedAsPci, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciConventional))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciConventional, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciX))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciX, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressRootPort))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressRootPort, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressUpstreamSwitchPort))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressUpstreamSwitchPort, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressDownstreamSwitchPort))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressDownstreamSwitchPort, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressToPciXBridge))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressToPciXBridge, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciXToExpressBridge))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciXToExpressBridge, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressTreatedAsPci))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressTreatedAsPci, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciDevice_BridgeType_PciExpressEventCollector))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"PciExpressEventCollector, ");
|
||||
|
||||
if (PhEndsWithString2(stringBuilder.String, L", ", FALSE))
|
||||
PhRemoveEndStringBuilder(&stringBuilder, 2);
|
||||
|
||||
if (Flags)
|
||||
{
|
||||
PhPrintPointer(pointer, UlongToPtr(Flags));
|
||||
PhAppendFormatStringBuilder(&stringBuilder, L" (%s)", pointer);
|
||||
}
|
||||
|
||||
return PhFinalStringBuilderString(&stringBuilder);
|
||||
}
|
||||
|
||||
_Function_class_(PH_DEVICE_PROPERTY_FILL_CALLBACK)
|
||||
VOID NTAPI PhpDevPropFillPciDeviceType(
|
||||
_In_ HDEVINFO DeviceInfoSet,
|
||||
_In_ PPH_DEVINFO_DATA DeviceInfoData,
|
||||
_In_ const DEVPROPKEY* PropertyKey,
|
||||
_Out_ PPH_DEVICE_PROPERTY Property,
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PhpDevPropFillUInt32Common(
|
||||
DeviceInfoSet,
|
||||
DeviceInfoData,
|
||||
PropertyKey,
|
||||
Property,
|
||||
Flags
|
||||
);
|
||||
|
||||
if (Property->Valid)
|
||||
{
|
||||
Property->AsString = PhpDevPropPciDeviceTypeToString(Property->UInt32);
|
||||
}
|
||||
}
|
||||
|
||||
PPH_STRING PhpDevPropPciDeviceInterruptSupportToString(
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
@@ -2789,6 +2867,112 @@ VOID NTAPI PhpDevPropFillPciDeviceInterruptSupport(
|
||||
}
|
||||
}
|
||||
|
||||
PPH_STRING PhpDevPropPciDeviceRequestSizeToString(
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
WCHAR pointer[PH_PTR_STR_LEN_1];
|
||||
|
||||
PhInitializeStringBuilder(&stringBuilder, 10);
|
||||
|
||||
if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_128Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"128B, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_256Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"256B, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_512Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"512B, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_1024Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"1024B, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_2048Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"2048B, ");
|
||||
else if (BooleanFlagOn(Flags, DevProp_PciExpressDevice_PayloadOrRequestSize_4096Bytes))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"4096B, ");
|
||||
|
||||
if (PhEndsWithString2(stringBuilder.String, L", ", FALSE))
|
||||
PhRemoveEndStringBuilder(&stringBuilder, 2);
|
||||
|
||||
PhPrintPointer(pointer, UlongToPtr(Flags));
|
||||
PhAppendFormatStringBuilder(&stringBuilder, L" (%s)", pointer);
|
||||
|
||||
return PhFinalStringBuilderString(&stringBuilder);
|
||||
}
|
||||
|
||||
_Function_class_(PH_DEVICE_PROPERTY_FILL_CALLBACK)
|
||||
VOID NTAPI PhpDevPropFillPciDeviceRequestSize(
|
||||
_In_ HDEVINFO DeviceInfoSet,
|
||||
_In_ PPH_DEVINFO_DATA DeviceInfoData,
|
||||
_In_ const DEVPROPKEY* PropertyKey,
|
||||
_Out_ PPH_DEVICE_PROPERTY Property,
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PhpDevPropFillUInt32Common(
|
||||
DeviceInfoSet,
|
||||
DeviceInfoData,
|
||||
PropertyKey,
|
||||
Property,
|
||||
Flags
|
||||
);
|
||||
|
||||
if (Property->Valid)
|
||||
{
|
||||
Property->AsString = PhpDevPropPciDeviceRequestSizeToString(Property->UInt32);
|
||||
}
|
||||
}
|
||||
|
||||
PPH_STRING PhpDevPropPciDeviceSriovSupportToString(
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
WCHAR pointer[PH_PTR_STR_LEN_1];
|
||||
|
||||
PhInitializeStringBuilder(&stringBuilder, 10);
|
||||
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_SriovSupport_Ok))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"Ok, ");
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_SriovSupport_MissingAcs))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"MissingAcs, ");
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_SriovSupport_MissingPfDriver))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"MissingPfDriver, ");
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_SriovSupport_NoBusResource))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"NoBusResource, ");
|
||||
if (BooleanFlagOn(Flags, DevProp_PciDevice_SriovSupport_DidntGetVfBarSpace))
|
||||
PhAppendStringBuilder2(&stringBuilder, L"DidntGetVfBarSpace, ");
|
||||
|
||||
if (PhEndsWithString2(stringBuilder.String, L", ", FALSE))
|
||||
PhRemoveEndStringBuilder(&stringBuilder, 2);
|
||||
|
||||
PhPrintPointer(pointer, UlongToPtr(Flags));
|
||||
PhAppendFormatStringBuilder(&stringBuilder, L" (%s)", pointer);
|
||||
|
||||
return PhFinalStringBuilderString(&stringBuilder);
|
||||
}
|
||||
|
||||
_Function_class_(PH_DEVICE_PROPERTY_FILL_CALLBACK)
|
||||
VOID NTAPI PhpDevPropFillPciDeviceSriovSupport(
|
||||
_In_ HDEVINFO DeviceInfoSet,
|
||||
_In_ PPH_DEVINFO_DATA DeviceInfoData,
|
||||
_In_ const DEVPROPKEY* PropertyKey,
|
||||
_Out_ PPH_DEVICE_PROPERTY Property,
|
||||
_In_ ULONG Flags
|
||||
)
|
||||
{
|
||||
PhpDevPropFillUInt32Common(
|
||||
DeviceInfoSet,
|
||||
DeviceInfoData,
|
||||
PropertyKey,
|
||||
Property,
|
||||
Flags
|
||||
);
|
||||
|
||||
if (Property->Valid)
|
||||
{
|
||||
Property->AsString = PhpDevPropPciDeviceSriovSupportToString(Property->UInt32);
|
||||
}
|
||||
}
|
||||
|
||||
_Function_class_(PH_DEVICE_PROPERTY_FILL_CALLBACK)
|
||||
VOID NTAPI PhpDevPropFillBoolean(
|
||||
_In_ HDEVINFO DeviceInfoSet,
|
||||
@@ -3613,7 +3797,27 @@ static const PH_DEVICE_PROPERTY_TABLE_ENTRY PhpDeviceItemPropertyTable[] =
|
||||
|
||||
{ PhDevicePropertyObjectType, &DEVPKEY_DevQuery_ObjectType, PhpDevPropFillUInt32, 0 },
|
||||
|
||||
{ PhDevicePropertyPciDeviceType, &DEVPKEY_PciDevice_DeviceType, PhpDevPropFillPciDeviceType, 0 },
|
||||
{ PhDevicePropertyPciCurrentSpeedAndMode, &DEVPKEY_PciDevice_CurrentSpeedAndMode, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciBaseClass, &DEVPKEY_PciDevice_BaseClass, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciSubClass, &DEVPKEY_PciDevice_SubClass, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciProgIf, &DEVPKEY_PciDevice_ProgIf, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciCurrentPayloadSize, &DEVPKEY_PciDevice_CurrentPayloadSize, PhpDevPropFillPciDeviceRequestSize, 0 },
|
||||
{ PhDevicePropertyPciMaxPayloadSize, &DEVPKEY_PciDevice_MaxPayloadSize, PhpDevPropFillPciDeviceRequestSize, 0 },
|
||||
{ PhDevicePropertyPciMaxReadRequestSize, &DEVPKEY_PciDevice_MaxReadRequestSize, PhpDevPropFillPciDeviceRequestSize, 0 },
|
||||
{ PhDevicePropertyPciCurrentLinkSpeed, &DEVPKEY_PciDevice_CurrentLinkSpeed, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciCurrentLinkWidth, &DEVPKEY_PciDevice_CurrentLinkWidth, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciMaxLinkSpeed, &DEVPKEY_PciDevice_MaxLinkSpeed, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciMaxLinkWidth, &DEVPKEY_PciDevice_MaxLinkWidth, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciExpressSpecVersion, &DEVPKEY_PciDevice_ExpressSpecVersion, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciInterruptSupport, &DEVPKEY_PciDevice_InterruptSupport, PhpDevPropFillPciDeviceInterruptSupport, 0 },
|
||||
{ PhDevicePropertyPciInterruptMessageMaximum, &DEVPKEY_PciDevice_InterruptMessageMaximum, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciBarTypes, &DEVPKEY_PciDevice_BarTypes, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciSriovSupport, &DEVPKEY_PciDevice_SriovSupport, PhpDevPropFillPciDeviceSriovSupport, 0 },
|
||||
{ PhDevicePropertyPciLabel_Id, &DEVPKEY_PciDevice_Label_Id, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciLabel_String, &DEVPKEY_PciDevice_Label_String, PhpDevPropFillUInt32, 0 },
|
||||
{ PhDevicePropertyPciSerialNumber, &DEVPKEY_PciDevice_SerialNumber, PhpDevPropFillUInt32, 0 },
|
||||
|
||||
{ PhDevicePropertyPciExpressCapabilityControl, &DEVPKEY_PciRootBus_PCIExpressCapabilityControl, PhpDevPropFillBoolean, 0 },
|
||||
{ PhDevicePropertyPciNativeExpressControl, &DEVPKEY_PciRootBus_NativePciExpressControl, PhpDevPropFillBoolean, 0 },
|
||||
{ PhDevicePropertyPciSystemMsiSupport, &DEVPKEY_PciRootBus_SystemMsiSupport, PhpDevPropFillBoolean, 0 },
|
||||
|
||||
@@ -613,12 +613,11 @@ BOOLEAN NTAPI PhpHandleTreeNewCallback(
|
||||
|
||||
if (!handleItem)
|
||||
; // Dummy
|
||||
else if (PhCsUseColorProtectedHandles && PhCsUseColorInheritHandles &&
|
||||
(handleItem->Attributes & OBJ_PROTECT_CLOSE) && (handleItem->Attributes & OBJ_INHERIT))
|
||||
getNodeColor->BackColor = PhCsColorPartiallySuspended;
|
||||
else if (PhCsUseColorProtectedHandles && (handleItem->Attributes & OBJ_PROTECT_CLOSE))
|
||||
else if (PhCsUseColorProtectedInheritHandles && FlagOn(handleItem->Attributes, OBJ_PROTECT_CLOSE) && FlagOn(handleItem->Attributes, OBJ_INHERIT))
|
||||
getNodeColor->BackColor = PhCsColorProtectedInheritHandles;
|
||||
else if (PhCsUseColorProtectedHandles && FlagOn(handleItem->Attributes, OBJ_PROTECT_CLOSE))
|
||||
getNodeColor->BackColor = PhCsColorProtectedHandles;
|
||||
else if (PhCsUseColorInheritHandles && (handleItem->Attributes & OBJ_INHERIT))
|
||||
else if (PhCsUseColorInheritHandles && FlagOn(handleItem->Attributes, OBJ_INHERIT))
|
||||
getNodeColor->BackColor = PhCsColorInheritHandles;
|
||||
|
||||
getNodeColor->Flags = TN_AUTO_FORECOLOR;
|
||||
@@ -739,7 +738,7 @@ VOID PhGetSelectedHandleItems(
|
||||
PhAddItemArray(&array, &node->HandleItem);
|
||||
}
|
||||
|
||||
*NumberOfHandles = (ULONG)array.Count;
|
||||
*NumberOfHandles = (ULONG)PhFinalArrayCount(&array);
|
||||
*Handles = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,7 @@ NTSTATUS PhpShowHandlePropertiesThread(
|
||||
HANDLE_PROPERTIES_CONTEXT context;
|
||||
PH_AUTO_POOL autoPool;
|
||||
|
||||
memset(&context, 0, sizeof(HANDLE_PROPERTIES_CONTEXT));
|
||||
context.ProcessId = handleContext->ProcessId;
|
||||
context.HandleItem = handleContext->HandleItem;
|
||||
context.OwnerPlugin = handleContext->OwnerPlugin;
|
||||
@@ -308,11 +309,13 @@ NTSTATUS PhpShowHandlePropertiesThread(
|
||||
PH_PLUGIN_OBJECT_PROPERTIES objectProperties;
|
||||
PH_PLUGIN_HANDLE_PROPERTIES_CONTEXT propertiesContext;
|
||||
|
||||
memset(&propertiesContext, 0, sizeof(PH_PLUGIN_HANDLE_PROPERTIES_CONTEXT));
|
||||
propertiesContext.ParentWindowHandle = handleContext->ParentWindowHandle;
|
||||
propertiesContext.ProcessId = handleContext->ProcessId;
|
||||
propertiesContext.HandleItem = handleContext->HandleItem;
|
||||
propertiesContext.OwnerPlugin = handleContext->OwnerPlugin;
|
||||
|
||||
memset(&objectProperties, 0, sizeof(PH_PLUGIN_OBJECT_PROPERTIES));
|
||||
objectProperties.Parameter = &propertiesContext;
|
||||
objectProperties.NumberOfPages = propSheetHeader.nPages;
|
||||
objectProperties.MaximumNumberOfPages = RTL_NUMBER_OF(pages);
|
||||
@@ -352,7 +355,7 @@ VOID PhShowHandlePropertiesEx(
|
||||
{
|
||||
PHANDLE_PROPERTIES_THREAD_CONTEXT context;
|
||||
|
||||
context = PhAllocate(sizeof(HANDLE_PROPERTIES_THREAD_CONTEXT));
|
||||
context = PhAllocateZero(sizeof(HANDLE_PROPERTIES_THREAD_CONTEXT));
|
||||
context->ParentWindowHandle = PhCsForceNoParent ? NULL : ParentWindowHandle;
|
||||
context->ProcessId = ProcessId;
|
||||
context->HandleItem = HandleItem;
|
||||
|
||||
@@ -223,7 +223,27 @@ typedef enum _PH_DEVICE_PROPERTY_CLASS
|
||||
|
||||
PhDevicePropertyObjectType,
|
||||
|
||||
PhDevicePropertyPciDeviceType,
|
||||
PhDevicePropertyPciCurrentSpeedAndMode,
|
||||
PhDevicePropertyPciBaseClass,
|
||||
PhDevicePropertyPciSubClass,
|
||||
PhDevicePropertyPciProgIf,
|
||||
PhDevicePropertyPciCurrentPayloadSize,
|
||||
PhDevicePropertyPciMaxPayloadSize,
|
||||
PhDevicePropertyPciMaxReadRequestSize,
|
||||
PhDevicePropertyPciCurrentLinkSpeed,
|
||||
PhDevicePropertyPciCurrentLinkWidth,
|
||||
PhDevicePropertyPciMaxLinkSpeed,
|
||||
PhDevicePropertyPciMaxLinkWidth,
|
||||
PhDevicePropertyPciExpressSpecVersion,
|
||||
PhDevicePropertyPciInterruptSupport,
|
||||
PhDevicePropertyPciInterruptMessageMaximum,
|
||||
PhDevicePropertyPciBarTypes,
|
||||
PhDevicePropertyPciSriovSupport,
|
||||
PhDevicePropertyPciLabel_Id,
|
||||
PhDevicePropertyPciLabel_String,
|
||||
PhDevicePropertyPciSerialNumber,
|
||||
|
||||
PhDevicePropertyPciExpressCapabilityControl,
|
||||
PhDevicePropertyPciNativeExpressControl,
|
||||
PhDevicePropertyPciSystemMsiSupport,
|
||||
|
||||
@@ -25,8 +25,6 @@ typedef struct _PH_HANDLE_ITEM_INFO
|
||||
PPH_STRING BestObjectName;
|
||||
} PH_HANDLE_ITEM_INFO, *PPH_HANDLE_ITEM_INFO;
|
||||
|
||||
#define ID_HANDLE_OBJECTPROPERTIES1 40282
|
||||
#define ID_HANDLE_OBJECTPROPERTIES2 40283
|
||||
|
||||
VOID PhInsertHandleObjectPropertiesEMenuItems(
|
||||
_In_ struct _PH_EMENU_ITEM *Menu,
|
||||
|
||||
@@ -61,6 +61,8 @@ typedef enum _PH_MAINWINDOW_CALLBACK_TYPE
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_VERSION,
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_PORTABLE,
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_PAGEINDEX,
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_WINDOWDPI,
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_WINDOWNAME,
|
||||
PH_MAINWINDOW_CALLBACK_TYPE_MAXIMUM
|
||||
} PH_MAINWINDOW_CALLBACK_TYPE;
|
||||
|
||||
@@ -133,6 +135,10 @@ PhPluginInvokeWindowCallback(
|
||||
((BOOLEAN)PtrToUlong(PhPluginInvokeWindowCallback(PH_MAINWINDOW_CALLBACK_TYPE_PORTABLE, 0, 0)))
|
||||
#define SystemInformer_GetTabIndex(Value) \
|
||||
(PtrToUlong(PhPluginInvokeWindowCallback(PH_MAINWINDOW_CALLBACK_TYPE_PAGEINDEX, (PVOID)(ULONG_PTR)(Value), 0)))
|
||||
#define SystemInformer_GetWindowDpi() \
|
||||
(PtrToUlong(PhPluginInvokeWindowCallback(PH_MAINWINDOW_CALLBACK_TYPE_WINDOWDPI, 0, 0)))
|
||||
#define SystemInformer_GetWindowName() \
|
||||
(PWSTR)(PhPluginInvokeWindowCallback(PH_MAINWINDOW_CALLBACK_TYPE_WINDOWNAME, 0, 0))
|
||||
|
||||
#define PhWindowsVersion SystemInformer_GetWindowsVersion() // Temporary backwards compat (dmex)
|
||||
// end_phapppub
|
||||
|
||||
@@ -67,7 +67,8 @@ VOID PhMwpApplyUpdateInterval(
|
||||
);
|
||||
|
||||
VOID PhMwpInitializeMetrics(
|
||||
_In_ HWND WindowHandle
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
);
|
||||
|
||||
VOID PhMwpInitializeControls(
|
||||
@@ -165,7 +166,8 @@ VOID PhMwpOnDeviceChanged(
|
||||
);
|
||||
|
||||
VOID PhMwpOnDpiChanged(
|
||||
_In_ HWND WindowHandle
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
);
|
||||
|
||||
LRESULT PhMwpOnUserMessage(
|
||||
|
||||
@@ -98,6 +98,8 @@ EXT ULONG PhCsUseColorRelocatedModules;
|
||||
EXT ULONG PhCsColorRelocatedModules;
|
||||
EXT ULONG PhCsUseColorProtectedHandles;
|
||||
EXT ULONG PhCsColorProtectedHandles;
|
||||
EXT ULONG PhCsUseColorProtectedInheritHandles;
|
||||
EXT ULONG PhCsColorProtectedInheritHandles;
|
||||
EXT ULONG PhCsUseColorProtectedProcess;
|
||||
EXT ULONG PhCsColorProtectedProcess;
|
||||
EXT ULONG PhCsUseColorInheritHandles;
|
||||
|
||||
@@ -105,13 +105,13 @@ PPH_STRING PhGetProcessTooltipText(
|
||||
PH_STRING_BUILDER stringBuilder;
|
||||
ULONG validForMs = 60 * 60 * 1000; // 1 hour
|
||||
PPH_STRING tempString;
|
||||
PPH_STRING fileNameWin32;
|
||||
PPH_STRING fileName;
|
||||
|
||||
PhInitializeStringBuilder(&stringBuilder, 200);
|
||||
|
||||
// Command line
|
||||
|
||||
if (Process->CommandLine)
|
||||
if (PhGetIntegerSetting(L"EnableCommandLineTooltips") && Process->CommandLine)
|
||||
{
|
||||
tempString = PhEllipsisString(Process->CommandLine, 100 * 10);
|
||||
|
||||
@@ -125,12 +125,12 @@ PPH_STRING PhGetProcessTooltipText(
|
||||
|
||||
// File information
|
||||
|
||||
fileNameWin32 = Process->FileName ? PhGetFileName(Process->FileName) : NULL;
|
||||
fileName = Process->FileName ? PhGetFileName(Process->FileName) : NULL;
|
||||
|
||||
if (fileNameWin32)
|
||||
if (fileName)
|
||||
{
|
||||
tempString = PhFormatImageVersionInfo(
|
||||
fileNameWin32,
|
||||
fileName,
|
||||
&Process->VersionInfo,
|
||||
&StandardIndent,
|
||||
0
|
||||
@@ -145,7 +145,7 @@ PPH_STRING PhGetProcessTooltipText(
|
||||
|
||||
if (tempString)
|
||||
PhDereferenceObject(tempString);
|
||||
PhDereferenceObject(fileNameWin32);
|
||||
PhDereferenceObject(fileName);
|
||||
}
|
||||
|
||||
// Known command line information
|
||||
|
||||
+15
-15
@@ -447,6 +447,7 @@ NTSTATUS PhRestartSelf(
|
||||
// PROCESS_CREATION_MITIGATION_POLICY2_XTENDED_CONTROL_FLOW_GUARD_ALWAYS_ON
|
||||
#endif
|
||||
NTSTATUS status;
|
||||
PPROC_THREAD_ATTRIBUTE_LIST attributeList = NULL;
|
||||
PH_STRINGREF commandlineSr;
|
||||
PPH_STRING commandline;
|
||||
STARTUPINFOEX startupInfo;
|
||||
@@ -461,11 +462,8 @@ NTSTATUS PhRestartSelf(
|
||||
AdditionalCommandLine
|
||||
);
|
||||
|
||||
memset(&startupInfo, 0, sizeof(STARTUPINFOEX));
|
||||
startupInfo.StartupInfo.cb = sizeof(STARTUPINFOEX);
|
||||
|
||||
#ifndef DEBUG
|
||||
status = PhInitializeProcThreadAttributeList(&startupInfo.lpAttributeList, 1);
|
||||
status = PhInitializeProcThreadAttributeList(&attributeList, 1);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
return status;
|
||||
@@ -473,7 +471,7 @@ NTSTATUS PhRestartSelf(
|
||||
if (WindowsVersion >= WINDOWS_10_22H2)
|
||||
{
|
||||
status = PhUpdateProcThreadAttribute(
|
||||
startupInfo.lpAttributeList,
|
||||
attributeList,
|
||||
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY,
|
||||
&(ULONG64[2]){ DEFAULT_MITIGATION_POLICY_FLAGS, DEFAULT_MITIGATION_POLICY_FLAGS2 },
|
||||
sizeof(ULONG64[2])
|
||||
@@ -482,7 +480,7 @@ NTSTATUS PhRestartSelf(
|
||||
else
|
||||
{
|
||||
status = PhUpdateProcThreadAttribute(
|
||||
startupInfo.lpAttributeList,
|
||||
attributeList,
|
||||
PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY,
|
||||
&(ULONG64[1]) { DEFAULT_MITIGATION_POLICY_FLAGS },
|
||||
sizeof(ULONG64[1])
|
||||
@@ -493,12 +491,16 @@ NTSTATUS PhRestartSelf(
|
||||
if (!NT_SUCCESS(status))
|
||||
return status;
|
||||
|
||||
memset(&startupInfo, 0, sizeof(STARTUPINFOEX));
|
||||
startupInfo.StartupInfo.cb = sizeof(STARTUPINFOEX);
|
||||
startupInfo.lpAttributeList = attributeList;
|
||||
|
||||
status = PhCreateProcessWin32Ex(
|
||||
NULL,
|
||||
PhGetString(commandline),
|
||||
NULL,
|
||||
NULL,
|
||||
&startupInfo.StartupInfo,
|
||||
&startupInfo,
|
||||
PH_CREATE_PROCESS_DEFAULT_ERROR_MODE | PH_CREATE_PROCESS_EXTENDED_STARTUPINFO,
|
||||
NULL,
|
||||
NULL,
|
||||
@@ -511,8 +513,8 @@ NTSTATUS PhRestartSelf(
|
||||
PhExitApplication(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
if (startupInfo.lpAttributeList)
|
||||
PhDeleteProcThreadAttributeList(startupInfo.lpAttributeList);
|
||||
if (attributeList)
|
||||
PhDeleteProcThreadAttributeList(attributeList);
|
||||
|
||||
PhDereferenceObject(commandline);
|
||||
|
||||
@@ -1333,18 +1335,16 @@ PVOID PhCreateKsiSettingsBlob(
|
||||
#else
|
||||
directory = PhGetApplicationDirectoryWin32();
|
||||
#endif
|
||||
value = PhConvertUtf16ToUtf8Ex(directory->Buffer, directory->Length);
|
||||
PhDereferenceObject(directory);
|
||||
|
||||
value = PhConvertStringToUtf8(directory);
|
||||
PhAddJsonObject2(object, "KsiDirectory", value->Buffer, value->Length);
|
||||
PhDereferenceObject(value);
|
||||
PhDereferenceObject(directory);
|
||||
|
||||
serviceName = PhGetKsiServiceName();
|
||||
value = PhConvertUtf16ToUtf8Ex(serviceName->Buffer, serviceName->Length);
|
||||
PhDereferenceObject(serviceName);
|
||||
|
||||
value = PhConvertStringToUtf8(serviceName);
|
||||
PhAddJsonObject2(object, "KsiServiceName", value->Buffer, value->Length);
|
||||
PhDereferenceObject(value);
|
||||
PhDereferenceObject(serviceName);
|
||||
|
||||
value = PhGetJsonArrayString(object, FALSE);
|
||||
string = PhBufferToHexString((PUCHAR)value->Buffer, (ULONG)value->Length);
|
||||
|
||||
+61
-35
@@ -119,7 +119,7 @@ BOOLEAN PhMainWndInitialization(
|
||||
return FALSE;
|
||||
|
||||
// Initialize window metrics.
|
||||
PhMwpInitializeMetrics(PhMainWndHandle);
|
||||
PhMwpInitializeMetrics(PhMainWndHandle, 0);
|
||||
|
||||
// Initialize window controls.
|
||||
PhMwpInitializeControls(PhMainWndHandle);
|
||||
@@ -231,7 +231,7 @@ LRESULT CALLBACK PhMwpWndProc(
|
||||
break;
|
||||
case WM_DPICHANGED:
|
||||
{
|
||||
PhMwpOnDpiChanged(hWnd);
|
||||
PhMwpOnDpiChanged(hWnd, LOWORD(wParam));
|
||||
}
|
||||
break;
|
||||
case WM_NCPAINT:
|
||||
@@ -427,7 +427,8 @@ VOID PhMwpApplyUpdateInterval(
|
||||
}
|
||||
|
||||
VOID PhMwpInitializeMetrics(
|
||||
_In_ HWND WindowHandle
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
)
|
||||
{
|
||||
LayoutWindowDpi = PhGetWindowDpi(WindowHandle);
|
||||
@@ -640,11 +641,11 @@ VOID PhMwpOnSettingChange(
|
||||
_In_opt_ PCWSTR Metric
|
||||
)
|
||||
{
|
||||
PhInitializeFont(WindowHandle);
|
||||
PhInitializeFont(WindowHandle, 0);
|
||||
|
||||
if (PhGetIntegerSetting(L"EnableMonospaceFont"))
|
||||
{
|
||||
PhInitializeMonospaceFont(WindowHandle);
|
||||
PhInitializeMonospaceFont(WindowHandle, 0);
|
||||
}
|
||||
|
||||
if (Action == 0 && Metric)
|
||||
@@ -1715,10 +1716,21 @@ VOID PhMwpOnCommand(
|
||||
{
|
||||
PPH_PROCESS_ITEM processItem = PhGetSelectedProcessItem();
|
||||
|
||||
if (processItem && processItem->FileNameWin32)
|
||||
if (processItem && processItem->QueryHandle)
|
||||
{
|
||||
PhSetStringSetting2(L"RunAsProgram", &processItem->FileNameWin32->sr);
|
||||
PhShowRunAsDialog(WindowHandle, NULL);
|
||||
NTSTATUS status;
|
||||
PPH_STRING fileNameWin32;
|
||||
|
||||
if (NT_SUCCESS(status = PhGetProcessImageFileNameWin32(processItem->QueryHandle, &fileNameWin32)))
|
||||
{
|
||||
PhSetStringSetting2(L"RunAsProgram", &fileNameWin32->sr);
|
||||
PhShowRunAsDialog(WindowHandle, NULL);
|
||||
PhDereferenceObject(fileNameWin32);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhShowStatus(WindowHandle, L"Unable to locate the file.", STATUS_NOT_FOUND, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1862,21 +1874,27 @@ VOID PhMwpOnCommand(
|
||||
{
|
||||
PPH_PROCESS_ITEM processItem = PhGetSelectedProcessItem();
|
||||
|
||||
if (
|
||||
processItem &&
|
||||
!PhIsNullOrEmptyString(processItem->FileNameWin32) &&
|
||||
PhDoesFileExistWin32(PhGetString(processItem->FileNameWin32))
|
||||
)
|
||||
if (processItem && processItem->QueryHandle)
|
||||
{
|
||||
PhReferenceObject(processItem);
|
||||
PhShellExecuteUserString(
|
||||
WindowHandle,
|
||||
L"FileBrowseExecutable",
|
||||
processItem->FileNameWin32->Buffer,
|
||||
FALSE,
|
||||
L"Make sure the Explorer executable file is present."
|
||||
);
|
||||
PhDereferenceObject(processItem);
|
||||
NTSTATUS status;
|
||||
PPH_STRING fileNameWin32;
|
||||
|
||||
if (NT_SUCCESS(status = PhGetProcessImageFileNameWin32(processItem->QueryHandle, &fileNameWin32)))
|
||||
{
|
||||
PhShellExecuteUserString(
|
||||
WindowHandle,
|
||||
L"FileBrowseExecutable",
|
||||
PhGetString(fileNameWin32),
|
||||
FALSE,
|
||||
L"Make sure the Explorer executable file is present."
|
||||
);
|
||||
|
||||
PhDereferenceObject(fileNameWin32);
|
||||
}
|
||||
else
|
||||
{
|
||||
PhShowStatus(WindowHandle, L"Unable to locate the file.", STATUS_NOT_FOUND, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2376,18 +2394,16 @@ VOID PhMwpOnDeviceChanged(
|
||||
}
|
||||
|
||||
VOID PhMwpOnDpiChanged(
|
||||
_In_ HWND WindowHandle
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ LONG WindowDpi
|
||||
)
|
||||
{
|
||||
PhGuiSupportUpdateSystemMetrics(WindowHandle);
|
||||
PhGuiSupportUpdateSystemMetrics(WindowHandle, WindowDpi);
|
||||
|
||||
PhMwpInitializeMetrics(WindowHandle);
|
||||
PhMwpInitializeMetrics(WindowHandle, WindowDpi);
|
||||
|
||||
if (PhEnableWindowText)
|
||||
{
|
||||
//PhSetApplicationWindowIcon(WindowHandle);
|
||||
PhSetApplicationWindowIconEx(WindowHandle, LayoutWindowDpi);
|
||||
}
|
||||
|
||||
PhMwpOnSettingChange(WindowHandle, 0, NULL);
|
||||
|
||||
@@ -2397,8 +2413,6 @@ VOID PhMwpOnDpiChanged(
|
||||
|
||||
PhMwpNotifyAllPages(MainTabPageDpiChanged, NULL, NULL);
|
||||
|
||||
InvalidateRect(WindowHandle, NULL, TRUE);
|
||||
|
||||
{
|
||||
MSG message;
|
||||
|
||||
@@ -2408,6 +2422,8 @@ VOID PhMwpOnDpiChanged(
|
||||
|
||||
PhInvokeCallback(PhGetGeneralCallback(GeneralCallbackWindowNotifyEvent), &message);
|
||||
}
|
||||
|
||||
InvalidateRect(WindowHandle, NULL, TRUE);
|
||||
}
|
||||
|
||||
LRESULT PhMwpOnUserMessage(
|
||||
@@ -3424,7 +3440,7 @@ VOID PhMwpInitializeSubMenu(
|
||||
{
|
||||
HBITMAP shieldBitmap;
|
||||
|
||||
if (shieldBitmap = PhGetShieldBitmap(LayoutWindowDpi, 0, 0))
|
||||
if (shieldBitmap = PhGetShieldBitmap(LayoutWindowDpi, PhSmallIconSize.X, PhSmallIconSize.Y))
|
||||
{
|
||||
if (menuItem = PhFindEMenuItem(Menu, 0, NULL, ID_HACKER_SHOWDETAILSFORALLPROCESSES))
|
||||
menuItem->Bitmap = shieldBitmap;
|
||||
@@ -3527,7 +3543,7 @@ VOID PhMwpInitializeSubMenu(
|
||||
{
|
||||
HBITMAP shieldBitmap;
|
||||
|
||||
if (shieldBitmap = PhGetShieldBitmap(LayoutWindowDpi, 0, 0))
|
||||
if (shieldBitmap = PhGetShieldBitmap(LayoutWindowDpi, PhSmallIconSize.X, PhSmallIconSize.Y))
|
||||
{
|
||||
if (menuItem = PhFindEMenuItem(Menu, 0, NULL, ID_TOOLS_STARTTASKMANAGER))
|
||||
menuItem->Bitmap = shieldBitmap;
|
||||
@@ -4299,7 +4315,7 @@ VOID PhMwpInvokeUpdateWindowFontMonospace(
|
||||
}
|
||||
else
|
||||
{
|
||||
PhInitializeMonospaceFont(hwnd);
|
||||
PhInitializeMonospaceFont(hwnd, LayoutWindowDpi);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4432,14 +4448,14 @@ PVOID PhPluginInvokeWindowCallback(
|
||||
{
|
||||
PPH_SHOW_MEMORY_EDITOR showMemoryEditor = (PPH_SHOW_MEMORY_EDITOR)lparam;
|
||||
|
||||
PostMessage(PhMainWndHandle, WM_PH_INVOKE, (WPARAM)showMemoryEditor, (LPARAM)PhMwpInvokeShowMemoryEditorDialog);
|
||||
SendMessage(PhMainWndHandle, WM_PH_INVOKE, (WPARAM)showMemoryEditor, (LPARAM)PhMwpInvokeShowMemoryEditorDialog);
|
||||
}
|
||||
break;
|
||||
case PH_MAINWINDOW_CALLBACK_TYPE_SHOW_MEMORY_RESULTS:
|
||||
{
|
||||
PPH_SHOW_MEMORY_RESULTS showMemoryResults = (PPH_SHOW_MEMORY_RESULTS)lparam;
|
||||
|
||||
PostMessage(PhMainWndHandle, WM_PH_INVOKE, (WPARAM)showMemoryResults, (LPARAM)PhMwpInvokeShowMemoryResultsDialog);
|
||||
SendMessage(PhMainWndHandle, WM_PH_INVOKE, (WPARAM)showMemoryResults, (LPARAM)PhMwpInvokeShowMemoryResultsDialog);
|
||||
}
|
||||
break;
|
||||
case PH_MAINWINDOW_CALLBACK_TYPE_SELECT_TAB_PAGE:
|
||||
@@ -4540,6 +4556,16 @@ PVOID PhPluginInvokeWindowCallback(
|
||||
return (PVOID)UlongToPtr(PhPortableEnabled);
|
||||
}
|
||||
break;
|
||||
case PH_MAINWINDOW_CALLBACK_TYPE_WINDOWDPI:
|
||||
{
|
||||
return (PVOID)UlongToPtr(LayoutWindowDpi);
|
||||
}
|
||||
break;
|
||||
case PH_MAINWINDOW_CALLBACK_TYPE_WINDOWNAME:
|
||||
{
|
||||
return (PVOID)PhApplicationName;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
@@ -1247,7 +1247,7 @@ VOID PhGetSelectedMemoryNodes(
|
||||
PhAddItemArray(&array, &node);
|
||||
}
|
||||
|
||||
*NumberOfMemoryNodes = (ULONG)array.Count;
|
||||
*NumberOfMemoryNodes = (ULONG)PhFinalArrayCount(&array);
|
||||
*MemoryNodes = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
@@ -1510,7 +1510,7 @@ VOID PhGetSelectedModuleItems(
|
||||
PhAddItemArray(&array, &node->ModuleItem);
|
||||
}
|
||||
|
||||
*NumberOfModules = (ULONG)array.Count;
|
||||
*NumberOfModules = (ULONG)PhFinalArrayCount(&array);
|
||||
*Modules = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
@@ -891,7 +891,7 @@ PPH_EMENU PhpCreateProcessMenu(
|
||||
else if (WindowsVersion < WINDOWS_11)
|
||||
{
|
||||
// Minimal only captures thread stacks, not supported before Windows 11
|
||||
kernelMinimal->Flags |= PH_EMENU_DISABLED;
|
||||
PhSetDisabledEMenuItem(kernelMinimal);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1012,7 +1012,7 @@ VOID PhGetSelectedNetworkItems(
|
||||
PhAddItemArray(&array, &node->NetworkItem);
|
||||
}
|
||||
|
||||
*NumberOfNetworkItems = (ULONG)array.Count;
|
||||
*NumberOfNetworkItems = (ULONG)PhFinalArrayCount(&array);
|
||||
*NetworkItems = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
@@ -796,12 +796,10 @@ HICON PhNfBitmapToIcon(
|
||||
{
|
||||
ICONINFO iconInfo;
|
||||
|
||||
PhNfpGetBlackIcon();
|
||||
|
||||
iconInfo.fIcon = TRUE;
|
||||
iconInfo.xHotspot = 0;
|
||||
iconInfo.yHotspot = 0;
|
||||
iconInfo.hbmMask = PhNfpBlackBitmap;
|
||||
iconInfo.hbmMask = Bitmap;
|
||||
iconInfo.hbmColor = Bitmap;
|
||||
|
||||
return CreateIconIndirect(&iconInfo);
|
||||
|
||||
@@ -824,7 +824,7 @@ static VOID ReadCurrentUserRun(
|
||||
PhInitializeArray(&keyEntryArray, sizeof(PHP_HKURUN_ENTRY), 20);
|
||||
PhEnumerateValueKey(keyHandle, KeyValueFullInformation, PhpReadCurrentRunCallback, &keyEntryArray);
|
||||
|
||||
for (SIZE_T i = 0; i < keyEntryArray.Count; i++)
|
||||
for (SIZE_T i = 0; i < PhFinalArrayCount(&keyEntryArray); i++)
|
||||
{
|
||||
PPHP_HKURUN_ENTRY entry = PhItemArray(&keyEntryArray, i);
|
||||
PH_STRINGREF fileName;
|
||||
@@ -1409,7 +1409,6 @@ typedef enum _PHP_OPTIONS_INDEX
|
||||
PHP_OPTIONS_INDEX_ENABLE_THEME_SUPPORT,
|
||||
PHP_OPTIONS_INDEX_ENABLE_START_ASADMIN,
|
||||
PHP_OPTIONS_INDEX_ENABLE_STREAM_MODE,
|
||||
PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY,
|
||||
PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE,
|
||||
PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE_DOH,
|
||||
PHP_OPTIONS_INDEX_ENABLE_INSTANT_TOOLTIPS,
|
||||
@@ -1451,12 +1450,7 @@ static VOID PhpAdvancedPageLoad(
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_UNDECORATE_SYMBOLS, L"Enable undecorated symbols", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_AVX_EXTENSIONS, L"Enable AVX extensions (experimental)", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_COLUMN_HEADER_TOTALS, L"Enable column header totals (experimental)", NULL);
|
||||
#ifdef _ARM64_
|
||||
// see: PhpEstimateIdleCyclesForARM (jxy-s)
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_CYCLE_CPU_USAGE, L"Enable cycle-based CPU usage (experimental)", NULL);
|
||||
#else
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_CYCLE_CPU_USAGE, L"Enable cycle-based CPU usage", NULL);
|
||||
#endif
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_GRAPH_SCALING, L"Enable fixed graph scaling (experimental)", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_MINIINFO_WINDOW, L"Enable tray information window", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_MEMSTRINGS_TREE, L"Enable new memory strings dialog", NULL);
|
||||
@@ -1464,7 +1458,6 @@ static VOID PhpAdvancedPageLoad(
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_THEME_SUPPORT, L"Enable theme support (experimental)", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_START_ASADMIN, L"Enable start as admin (experimental)", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_STREAM_MODE, L"Enable streamer mode (disable window capture) (experimental)", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY, L"Enable silent crash notification (experimental)", NULL);
|
||||
//PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_LINUX_SUPPORT, L"Enable Windows subsystem for Linux support", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE, L"Resolve network addresses", NULL);
|
||||
PhAddListViewItem(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE_DOH, L"Resolve DNS over HTTPS (DoH)", NULL);
|
||||
@@ -1496,7 +1489,6 @@ static VOID PhpAdvancedPageLoad(
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_THEME_SUPPORT, L"EnableThemeSupport");
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_START_ASADMIN, L"EnableStartAsAdmin");
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_STREAM_MODE, L"EnableStreamerMode");
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY, L"EnableSilentCrashNotify");
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_MONOSPACE, L"EnableMonospaceFont");
|
||||
//SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_LINUX_SUPPORT, L"EnableLinuxSubsystemSupport");
|
||||
SetLvItemCheckForSetting(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE, L"EnableNetworkResolve");
|
||||
@@ -1687,7 +1679,6 @@ static VOID PhpAdvancedPageSave(
|
||||
SetSettingForLvItemCheckRestartRequired(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_THEME_SUPPORT, L"EnableThemeSupport");
|
||||
SetSettingForLvItemCheck(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_START_ASADMIN, L"EnableStartAsAdmin");
|
||||
SetSettingForLvItemCheckRestartRequired(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_STREAM_MODE, L"EnableStreamerMode");
|
||||
SetSettingForLvItemCheck(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY, L"EnableSilentCrashNotify");
|
||||
SetSettingForLvItemCheck(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_MONOSPACE, L"EnableMonospaceFont");
|
||||
//SetSettingForLvItemCheckRestartRequired(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_LINUX_SUPPORT, L"EnableLinuxSubsystemSupport");
|
||||
SetSettingForLvItemCheckRestartRequired(listViewHandle, PHP_OPTIONS_INDEX_ENABLE_NETWORK_RESOLVE, L"EnableNetworkResolve");
|
||||
@@ -2039,29 +2030,6 @@ INT_PTR CALLBACK PhpOptionsGeneralDlgProc(
|
||||
|
||||
switch (listView->uNewState & LVIS_STATEIMAGEMASK)
|
||||
{
|
||||
case INDEXTOSTATEIMAGEMASK(1): // unchecked
|
||||
{
|
||||
switch (listView->iItem)
|
||||
{
|
||||
case PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY:
|
||||
{
|
||||
if (!PhGetOwnTokenAttributes().Elevated)
|
||||
{
|
||||
PhShowInformation2(
|
||||
PhOptionsWindowHandle,
|
||||
L"Unable to change process exit notification.",
|
||||
L"%s",
|
||||
L"You need to disable this option with administrative privileges."
|
||||
);
|
||||
|
||||
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case INDEXTOSTATEIMAGEMASK(2): // checked
|
||||
{
|
||||
switch (listView->iItem)
|
||||
@@ -2124,31 +2092,6 @@ INT_PTR CALLBACK PhpOptionsGeneralDlgProc(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY:
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
if (!PhGetOwnTokenAttributes().Elevated)
|
||||
{
|
||||
PhShowInformation2(
|
||||
PhOptionsWindowHandle,
|
||||
L"Unable to change process exit notification.",
|
||||
L"%s",
|
||||
L"You need to enable this option with administrative privileges."
|
||||
);
|
||||
|
||||
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
status = PhpSetSilentProcessNotifyEnabled(TRUE);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
PhShowStatus(hwndDlg, L"Unable to change process exit notification.", status, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2178,8 +2121,6 @@ INT_PTR CALLBACK PhpOptionsGeneralDlgProc(
|
||||
break;
|
||||
case PHP_OPTIONS_INDEX_ENABLE_START_ASADMIN:
|
||||
break;
|
||||
case PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -2200,18 +2141,6 @@ INT_PTR CALLBACK PhpOptionsGeneralDlgProc(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PHP_OPTIONS_INDEX_ENABLE_SILENT_CRASH_NOTIFY:
|
||||
{
|
||||
NTSTATUS status;
|
||||
|
||||
status = PhpSetSilentProcessNotifyEnabled(FALSE);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
PhShowStatus(hwndDlg, L"Unable to change process exit notification.", status, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -420,12 +420,7 @@ VOID PhLoadPlugins(
|
||||
if (PhIsPluginDisabled(&PhpDefaultPluginName[i]))
|
||||
continue;
|
||||
|
||||
if (PhPluginsLoadNative)
|
||||
fileName = PhConcatStringRef3(&PhWin32ExtendedPathPrefix, &pluginsDirectory->sr, &PhpDefaultPluginName[i]);
|
||||
else
|
||||
fileName = PhConcatStringRef2(&pluginsDirectory->sr, &PhpDefaultPluginName[i]);
|
||||
|
||||
if (fileName)
|
||||
if (fileName = PhConcatStringRef2(&pluginsDirectory->sr, &PhpDefaultPluginName[i]))
|
||||
{
|
||||
status = PhLoadPlugin(&fileName->sr);
|
||||
|
||||
|
||||
+41
-46
@@ -1188,6 +1188,7 @@ VOID PhpFillProcessItemExtension(
|
||||
ProcessItem->SharedCommitCharge = processExtension->SharedCommitCharge;
|
||||
ProcessItem->ProcessSequenceNumber = processExtension->ProcessSequenceNumber;
|
||||
ProcessItem->IsSystemProcess = processExtension->Classification != SystemProcessClassificationNormal;
|
||||
ProcessItem->IsSecureSystem = processExtension->Classification == SystemProcessClassificationSecureSystem;
|
||||
}
|
||||
|
||||
VOID PhpFillProcessItem(
|
||||
@@ -1254,7 +1255,27 @@ VOID PhpFillProcessItem(
|
||||
// If we're dealing with System (PID 4), we need to get the
|
||||
// kernel file name. Otherwise, get the image file name. (wj32)
|
||||
|
||||
if (ProcessItem->ProcessId != SYSTEM_PROCESS_ID)
|
||||
if (ProcessItem->ProcessId == SYSTEM_PROCESS_ID)
|
||||
{
|
||||
PPH_STRING fileName;
|
||||
|
||||
if (fileName = PhGetKernelFileName())
|
||||
{
|
||||
ProcessItem->FileName = fileName;
|
||||
ProcessItem->FileNameWin32 = PhGetFileName(fileName);
|
||||
}
|
||||
}
|
||||
else if (ProcessItem->IsSecureSystem)
|
||||
{
|
||||
PPH_STRING fileName;
|
||||
|
||||
if (fileName = PhGetSecureKernelFileName())
|
||||
{
|
||||
ProcessItem->FileName = fileName;
|
||||
ProcessItem->FileNameWin32 = PhGetFileName(fileName);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (PH_IS_REAL_PROCESS_ID(ProcessItem->ProcessId))
|
||||
{
|
||||
@@ -1274,33 +1295,7 @@ VOID PhpFillProcessItem(
|
||||
{
|
||||
ProcessItem->FileNameWin32 = fileName;
|
||||
}
|
||||
|
||||
if (ProcessItem->FileName && PhIsNullOrEmptyString(ProcessItem->FileNameWin32))
|
||||
{
|
||||
PhMoveReference(&ProcessItem->FileNameWin32, PhGetFileName(ProcessItem->FileName));
|
||||
}
|
||||
}
|
||||
|
||||
if (!ProcessItem->FileName &&
|
||||
ProcessItem->IsSecureProcess &&
|
||||
PhEqualString2(ProcessItem->ProcessName, L"Secure System", FALSE))
|
||||
{
|
||||
if (fileName = PhGetSecureKernelFileName())
|
||||
{
|
||||
ProcessItem->FileName = fileName;
|
||||
ProcessItem->FileNameWin32 = PhGetFileName(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PPH_STRING fileName;
|
||||
|
||||
if (fileName = PhGetKernelFileName())
|
||||
{
|
||||
ProcessItem->FileName = fileName;
|
||||
ProcessItem->FileNameWin32 = PhGetFileName(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1363,7 +1358,7 @@ VOID PhpFillProcessItem(
|
||||
NtClose(tokenHandle);
|
||||
}
|
||||
}
|
||||
else
|
||||
// Token information
|
||||
{
|
||||
if (ProcessItem->ProcessId == SYSTEM_IDLE_PROCESS_ID ||
|
||||
ProcessItem->ProcessId == SYSTEM_PROCESS_ID)
|
||||
@@ -1378,11 +1373,11 @@ VOID PhpFillProcessItem(
|
||||
}
|
||||
|
||||
// Known Process Type
|
||||
if (ProcessItem->FileNameWin32)
|
||||
if (ProcessItem->FileName)
|
||||
{
|
||||
ProcessItem->KnownProcessType = PhGetProcessKnownTypeEx(
|
||||
ProcessItem->ProcessId,
|
||||
ProcessItem->FileNameWin32
|
||||
ProcessItem->FileName
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1403,6 +1398,7 @@ VOID PhpFillProcessItem(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (WindowsVersion >= WINDOWS_8_1)
|
||||
{
|
||||
if (haveProtection)
|
||||
@@ -1414,10 +1410,6 @@ VOID PhpFillProcessItem(
|
||||
{
|
||||
ProcessItem->ProtectionString = PhReferenceObject(PhpProtectionYesString);
|
||||
}
|
||||
else
|
||||
{
|
||||
ProcessItem->ProtectionString = PhReferenceEmptyString();
|
||||
}
|
||||
}
|
||||
|
||||
// Control Flow Guard
|
||||
@@ -2139,16 +2131,19 @@ VOID PhpGetProcessThreadInformation(
|
||||
|
||||
if (PH_IS_REAL_PROCESS_ID(Process->UniqueProcessId) && !ProcessItem->IsSystemProcess)
|
||||
{
|
||||
if (
|
||||
suspendedCount == Process->NumberOfThreads ||
|
||||
(suspendedCount + workqueueCount) == Process->NumberOfThreads // (NumberOfThreads - workQueueLength)
|
||||
)
|
||||
if (suspendedCount)
|
||||
{
|
||||
isSuspended = TRUE;
|
||||
}
|
||||
else if (suspendedCount)
|
||||
{
|
||||
isPartiallySuspended = TRUE;
|
||||
if (
|
||||
suspendedCount == Process->NumberOfThreads ||
|
||||
(suspendedCount + workqueueCount) == Process->NumberOfThreads // (NumberOfThreads - workQueueLength)
|
||||
)
|
||||
{
|
||||
isSuspended = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
isPartiallySuspended = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2550,9 +2545,9 @@ VOID PhProcessProviderUpdate(
|
||||
PhFlushProcessQueryData();
|
||||
|
||||
if (sysTotalTime == 0)
|
||||
sysTotalTime = -1; // max. value
|
||||
sysTotalTime = ULONG64_MAX; // max. value
|
||||
if (sysTotalCycleTime == 0)
|
||||
sysTotalCycleTime = -1;
|
||||
sysTotalCycleTime = ULONG64_MAX;
|
||||
|
||||
PhCpuTotalCycleDelta = sysTotalCycleTime;
|
||||
|
||||
@@ -2575,8 +2570,8 @@ VOID PhProcessProviderUpdate(
|
||||
|
||||
// Create the process item and fill in basic information.
|
||||
processItem = PhCreateProcessItem(process->UniqueProcessId);
|
||||
PhpFillProcessItem(processItem, process);
|
||||
PhpFillProcessItemExtension(processItem, process);
|
||||
PhpFillProcessItem(processItem, process);
|
||||
processItem->TimeSequenceNumber = PhTimeSequenceNumber;
|
||||
|
||||
processRecord = PhpCreateProcessRecord(processItem);
|
||||
|
||||
@@ -39,6 +39,7 @@ VOID PhAddDefaultSettings(
|
||||
PhpAddIntegerSetting(L"EnableBitmapSupport", L"1");
|
||||
PhpAddIntegerSetting(L"EnableBreakOnTermination", L"0");
|
||||
PhpAddIntegerSetting(L"EnableBootObjectsEnumerate", L"0");
|
||||
PhpAddIntegerSetting(L"EnableCommandLineTooltips", L"0");
|
||||
PhpAddIntegerSetting(L"EnableCycleCpuUsage", L"1");
|
||||
PhpAddIntegerSetting(L"EnableDeferredLayout", L"1");
|
||||
PhpAddIntegerSetting(L"EnableDeviceSupport", L"1");
|
||||
@@ -68,7 +69,7 @@ VOID PhAddDefaultSettings(
|
||||
PhpAddIntegerSetting(L"EnableServiceStage2", L"0");
|
||||
PhpAddIntegerSetting(L"EnableServiceProgressDialog", L"1");
|
||||
PhpAddIntegerSetting(L"EnableShellExecuteSkipIfeoDebugger", L"1");
|
||||
PhpAddIntegerSetting(L"EnableStage2", L"1");
|
||||
PhpAddIntegerSetting(L"EnableStage2", L"0");
|
||||
PhpAddIntegerSetting(L"EnableStreamerMode", L"0");
|
||||
PhpAddIntegerSetting(L"EnableStartAsAdmin", L"0");
|
||||
PhpAddIntegerSetting(L"EnableStartAsAdminAlwaysOnTop", L"0");
|
||||
@@ -139,7 +140,7 @@ VOID PhAddDefaultSettings(
|
||||
PhpAddIntegerSetting(L"IconTrayPersistGuidEnabled", L"0");
|
||||
PhpAddIntegerSetting(L"IconTrayLazyStartDelay", L"1");
|
||||
PhpAddIntegerSetting(L"IconIgnoreBalloonClick", L"0");
|
||||
PhpAddStringSetting(L"IconSettings", L"2|1");
|
||||
PhpAddStringSetting(L"IconSettings", L"");
|
||||
PhpAddIntegerSetting(L"IconNotifyMask", L"18c"); // PH_NOTIFY_SERVICE_CREATE | PH_NOTIFY_SERVICE_DELETE | PH_NOTIFY_DEVICE_ARRIVED | PH_NOTIFY_DEVICE_REMOVED
|
||||
PhpAddIntegerSetting(L"IconProcesses", L"f"); // 15
|
||||
PhpAddIntegerSetting(L"IconSingleClick", L"0");
|
||||
@@ -331,6 +332,8 @@ VOID PhAddDefaultSettings(
|
||||
PhpAddIntegerSetting(L"ColorRelocatedModules", L"80c0ff");
|
||||
PhpAddIntegerSetting(L"UseColorProtectedHandles", L"1");
|
||||
PhpAddIntegerSetting(L"ColorProtectedHandles", L"777777");
|
||||
PhpAddIntegerSetting(L"UseColorProtectedInheritHandles", L"1");
|
||||
PhpAddIntegerSetting(L"ColorProtectedInheritHandles", L"c0c0c0");
|
||||
PhpAddIntegerSetting(L"UseColorProtectedProcess", L"0");
|
||||
PhpAddIntegerSetting(L"ColorProtectedProcess", L"ff8080");
|
||||
PhpAddIntegerSetting(L"UseColorInheritHandles", L"1");
|
||||
@@ -440,12 +443,14 @@ VOID PhUpdateCachedSettings(
|
||||
PH_UPDATE_SETTING(ColorRelocatedModules);
|
||||
PH_UPDATE_SETTING(UseColorProtectedHandles);
|
||||
PH_UPDATE_SETTING(ColorProtectedHandles);
|
||||
PH_UPDATE_SETTING(UseColorProtectedInheritHandles);
|
||||
PH_UPDATE_SETTING(ColorProtectedInheritHandles);
|
||||
PH_UPDATE_SETTING(UseColorInheritHandles);
|
||||
PH_UPDATE_SETTING(ColorInheritHandles);
|
||||
PH_UPDATE_SETTING(ColorProtectedProcess);
|
||||
PH_UPDATE_SETTING(UseColorProtectedProcess);
|
||||
PH_UPDATE_SETTING(ColorEfficiencyMode);
|
||||
PH_UPDATE_SETTING(UseColorEfficiencyMode);
|
||||
PH_UPDATE_SETTING(ColorInheritHandles);
|
||||
PH_UPDATE_SETTING(UseColorServiceDisabled);
|
||||
PH_UPDATE_SETTING(ColorServiceDisabled);
|
||||
PH_UPDATE_SETTING(UseColorServiceStop);
|
||||
|
||||
@@ -1039,7 +1039,7 @@ VOID PhGetSelectedServiceItems(
|
||||
PhAddItemArray(&array, &node->ServiceItem);
|
||||
}
|
||||
|
||||
*NumberOfServices = (ULONG)array.Count;
|
||||
*NumberOfServices = (ULONG)PhFinalArrayCount(&array);
|
||||
*Services = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
@@ -2223,7 +2223,7 @@ VOID PhGetSelectedThreadItems(
|
||||
PhAddItemArray(&array, &node->ThreadItem);
|
||||
}
|
||||
|
||||
*NumberOfThreads = (ULONG)array.Count;
|
||||
*NumberOfThreads = (ULONG)PhFinalArrayCount(&array);
|
||||
*Threads = PhFinalArrayItems(&array);
|
||||
}
|
||||
|
||||
|
||||
+20
-12
@@ -18,7 +18,8 @@ static const PH_FLAG_MAPPING EMenuTypeMappings[] =
|
||||
{
|
||||
{ PH_EMENU_MENUBARBREAK, MFT_MENUBARBREAK },
|
||||
{ PH_EMENU_MENUBREAK, MFT_MENUBREAK },
|
||||
{ PH_EMENU_RADIOCHECK, MFT_RADIOCHECK }
|
||||
{ PH_EMENU_RADIOCHECK, MFT_RADIOCHECK },
|
||||
{ PH_EMENU_RIGHTORDER, MFT_RIGHTORDER },
|
||||
};
|
||||
|
||||
static const PH_FLAG_MAPPING EMenuStateMappings[] =
|
||||
@@ -527,7 +528,7 @@ VOID PhEMenuToHMenu2(
|
||||
|
||||
menuItemInfo.fMask = MIIM_FTYPE | MIIM_STATE;
|
||||
|
||||
if (item->Flags & PH_EMENU_SEPARATOR)
|
||||
if (FlagOn(item->Flags, PH_EMENU_SEPARATOR))
|
||||
{
|
||||
menuItemInfo.fType = MFT_SEPARATOR;
|
||||
}
|
||||
@@ -554,22 +555,24 @@ VOID PhEMenuToHMenu2(
|
||||
if (WindowsVersion < WINDOWS_10_19H2)
|
||||
{
|
||||
if (!PhEnableThemeSupport)
|
||||
menuItemInfo.fMask |= MIIM_BITMAP;
|
||||
{
|
||||
SetFlag(menuItemInfo.fMask, MIIM_BITMAP);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
menuItemInfo.fMask |= MIIM_BITMAP;
|
||||
SetFlag(menuItemInfo.fMask, MIIM_BITMAP);
|
||||
}
|
||||
}
|
||||
|
||||
// Id
|
||||
|
||||
if (Flags & PH_EMENU_CONVERT_ID)
|
||||
if (FlagOn(Flags, PH_EMENU_CONVERT_ID))
|
||||
{
|
||||
ULONG id;
|
||||
|
||||
if (Data)
|
||||
{
|
||||
ULONG id;
|
||||
|
||||
PhAddItemList(Data->IdToItem, item);
|
||||
id = Data->IdToItem->Count;
|
||||
|
||||
@@ -579,7 +582,7 @@ VOID PhEMenuToHMenu2(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!(Menu->Flags & PH_EMENU_SEPARATOR) && !(Menu->Flags & PH_EMENU_MAINMENU))
|
||||
if (!FlagOn(Menu->Flags, PH_EMENU_SEPARATOR) && !FlagOn(Menu->Flags, PH_EMENU_MAINMENU))
|
||||
{
|
||||
if (item->Id)
|
||||
{
|
||||
@@ -616,21 +619,26 @@ VOID PhEMenuToHMenu2(
|
||||
{
|
||||
if (PhEnableThemeSupport)
|
||||
{
|
||||
menuItemInfo.fType |= MFT_OWNERDRAW;
|
||||
SetFlag(menuItemInfo.fType, MFT_OWNERDRAW);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item->Flags & PH_EMENU_MAINMENU)
|
||||
if (FlagOn(item->Flags, PH_EMENU_MAINMENU))
|
||||
{
|
||||
if (PhEnableThemeSupport)
|
||||
{
|
||||
menuItemInfo.fType |= MFT_OWNERDRAW;
|
||||
SetFlag(menuItemInfo.fType, MFT_OWNERDRAW);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InsertMenuItem(MenuHandle, MAXUINT, TRUE, &menuItemInfo);
|
||||
if (FlagOn(Flags, PH_EMENU_RIGHTORDER))
|
||||
{
|
||||
SetFlag(menuItemInfo.fType, MFT_RIGHTORDER);
|
||||
}
|
||||
|
||||
InsertMenuItem(MenuHandle, ULONG_MAX, TRUE, &menuItemInfo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -1338,7 +1338,7 @@ BOOLEAN PhFppInsertFreeList(
|
||||
)
|
||||
{
|
||||
ULONG oldSegmentIndex;
|
||||
PPH_FP_BLOCK_HEADER oldSegmentFirstBlock;
|
||||
PPH_FP_BLOCK_HEADER oldSegmentFirstBlock = nullptr;
|
||||
PPH_FP_SEGMENT_HEADER oldSegmentHeader;
|
||||
|
||||
oldSegmentIndex = Pool->Header->FreeLists[FreeListIndex];
|
||||
@@ -1385,11 +1385,11 @@ BOOLEAN PhFppRemoveFreeList(
|
||||
)
|
||||
{
|
||||
ULONG flinkSegmentIndex;
|
||||
PPH_FP_BLOCK_HEADER flinkSegmentFirstBlock;
|
||||
PPH_FP_SEGMENT_HEADER flinkSegmentHeader;
|
||||
PPH_FP_BLOCK_HEADER flinkSegmentFirstBlock = nullptr;
|
||||
PPH_FP_SEGMENT_HEADER flinkSegmentHeader = nullptr;
|
||||
ULONG blinkSegmentIndex;
|
||||
PPH_FP_BLOCK_HEADER blinkSegmentFirstBlock;
|
||||
PPH_FP_SEGMENT_HEADER blinkSegmentHeader;
|
||||
PPH_FP_BLOCK_HEADER blinkSegmentFirstBlock = nullptr;
|
||||
PPH_FP_SEGMENT_HEADER blinkSegmentHeader = nullptr;
|
||||
|
||||
flinkSegmentIndex = SegmentHeader->FreeFlink;
|
||||
blinkSegmentIndex = SegmentHeader->FreeBlink;
|
||||
|
||||
@@ -99,9 +99,14 @@ VOID PhInitializeSystemInformation(
|
||||
{
|
||||
SYSTEM_BASIC_INFORMATION basicInfo = { 0 };
|
||||
|
||||
// Note: We can't check the return of SystemBasicInformation
|
||||
// due to third party software hooking the function and returnnig
|
||||
// a random error status.
|
||||
|
||||
PhSystemBasicInformation.PageSize = PAGE_SIZE;
|
||||
PhSystemBasicInformation.NumberOfProcessors = 1;
|
||||
PhSystemBasicInformation.NumberOfPhysicalPages = ULONG_MAX;
|
||||
PhSystemBasicInformation.MaximumTimerResolution = 0x2625A;
|
||||
PhSystemBasicInformation.AllocationGranularity = 0x10000;
|
||||
PhSystemBasicInformation.MaximumUserModeAddress = 0x10000;
|
||||
PhSystemBasicInformation.ActiveProcessorsAffinityMask = USHRT_MAX;
|
||||
@@ -116,6 +121,7 @@ VOID PhInitializeSystemInformation(
|
||||
PhSystemBasicInformation.PageSize = (USHORT)basicInfo.PageSize;
|
||||
PhSystemBasicInformation.NumberOfProcessors = (USHORT)basicInfo.NumberOfProcessors;
|
||||
PhSystemBasicInformation.NumberOfPhysicalPages = basicInfo.NumberOfPhysicalPages;
|
||||
PhSystemBasicInformation.MaximumTimerResolution = basicInfo.TimerResolution;
|
||||
PhSystemBasicInformation.AllocationGranularity = basicInfo.AllocationGranularity;
|
||||
PhSystemBasicInformation.MaximumUserModeAddress = basicInfo.MaximumUserModeAddress;
|
||||
PhSystemBasicInformation.ActiveProcessorsAffinityMask = basicInfo.ActiveProcessorsAffinityMask;
|
||||
|
||||
+31
-45
@@ -647,17 +647,17 @@ LONG PhGetWindowDpi(
|
||||
_In_ HWND WindowHandle
|
||||
)
|
||||
{
|
||||
LONG dpi = 0;
|
||||
LONG dpi;
|
||||
RECT windowRect;
|
||||
|
||||
if (PhGetWindowRect(WindowHandle, &windowRect))
|
||||
{
|
||||
dpi = PhGetDpiValue(NULL, &windowRect);
|
||||
}
|
||||
dpi = PhGetDpiValue(WindowHandle, NULL);
|
||||
|
||||
if (dpi == 0)
|
||||
{
|
||||
dpi = PhGetDpiValue(WindowHandle, NULL);
|
||||
if (PhGetWindowRect(WindowHandle, &windowRect))
|
||||
{
|
||||
dpi = PhGetDpiValue(NULL, &windowRect);
|
||||
}
|
||||
}
|
||||
|
||||
if (dpi == 0)
|
||||
@@ -2194,7 +2194,7 @@ PPH_LAYOUT_ITEM PhAddLayoutItemEx(
|
||||
item->LayoutParentItem->NumberOfChildren++;
|
||||
|
||||
GetWindowRect(Handle, &item->Rect);
|
||||
MapWindowPoints(HWND_DESKTOP, item->LayoutParentItem->Handle, (PPOINT)&item->Rect, 2);
|
||||
MapWindowRect(HWND_DESKTOP, item->LayoutParentItem->Handle, &item->Rect);
|
||||
|
||||
if (item->Anchor & PH_LAYOUT_TAB_CONTROL)
|
||||
{
|
||||
@@ -2245,7 +2245,7 @@ VOID PhpLayoutItemLayout(
|
||||
}
|
||||
|
||||
GetWindowRect(Item->Handle, &Item->Rect);
|
||||
MapWindowPoints(HWND_DESKTOP, Item->LayoutParentItem->Handle, (PPOINT)&Item->Rect, 2);
|
||||
MapWindowRect(HWND_DESKTOP, Item->LayoutParentItem->Handle, &Item->Rect);
|
||||
|
||||
if (Item->Anchor & PH_LAYOUT_TAB_CONTROL)
|
||||
{
|
||||
@@ -4033,26 +4033,6 @@ HBITMAP PhCreateBitmapHandle(
|
||||
return bitmapHandle;
|
||||
}
|
||||
|
||||
static PVOID PhpGetWicImagingFactoryInterface(
|
||||
VOID
|
||||
)
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static PVOID wicImagingFactory = NULL;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
if (WindowsVersion >= WINDOWS_8)
|
||||
PhGetClassObject(L"windowscodecs.dll", &CLSID_WICImagingFactory2, &IID_IWICImagingFactory, &wicImagingFactory);
|
||||
else
|
||||
PhGetClassObject(L"windowscodecs.dll", &CLSID_WICImagingFactory1, &IID_IWICImagingFactory, &wicImagingFactory);
|
||||
|
||||
PhEndInitOnce(&initOnce);
|
||||
}
|
||||
|
||||
return wicImagingFactory;
|
||||
}
|
||||
|
||||
static PGUID PhpGetImageFormatDecoderType(
|
||||
_In_ PH_IMAGE_FORMAT_TYPE Format
|
||||
)
|
||||
@@ -4086,7 +4066,7 @@ HBITMAP PhLoadImageFormatFromResource(
|
||||
ULONG resourceLength = 0;
|
||||
WICInProcPointer resourceBuffer = NULL;
|
||||
PVOID bitmapBuffer = NULL;
|
||||
IWICImagingFactory* wicImageFactory = NULL;
|
||||
IWICImagingFactory* wicImagingFactory = NULL;
|
||||
IWICStream* wicBitmapStream = NULL;
|
||||
IWICBitmapSource* wicBitmapSource = NULL;
|
||||
IWICBitmapDecoder* wicBitmapDecoder = NULL;
|
||||
@@ -4098,13 +4078,13 @@ HBITMAP PhLoadImageFormatFromResource(
|
||||
if (!PhLoadResource(DllBase, Name, Type, &resourceLength, &resourceBuffer))
|
||||
goto CleanupExit;
|
||||
|
||||
if (!(wicImageFactory = PhpGetWicImagingFactoryInterface()))
|
||||
if (FAILED(PhGetClassObject(L"windowscodecs.dll", &CLSID_WICImagingFactory1, &IID_IWICImagingFactory, &wicImagingFactory)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICImagingFactory_CreateStream(wicImageFactory, &wicBitmapStream)))
|
||||
if (FAILED(IWICImagingFactory_CreateStream(wicImagingFactory, &wicBitmapStream)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICStream_InitializeFromMemory(wicBitmapStream, resourceBuffer, resourceLength)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICImagingFactory_CreateDecoder(wicImageFactory, PhpGetImageFormatDecoderType(Format), &GUID_VendorMicrosoft, &wicBitmapDecoder)))
|
||||
if (FAILED(IWICImagingFactory_CreateDecoder(wicImagingFactory, PhpGetImageFormatDecoderType(Format), &GUID_VendorMicrosoft, &wicBitmapDecoder)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICBitmapDecoder_Initialize(wicBitmapDecoder, (IStream*)wicBitmapStream, WICDecodeMetadataCacheOnDemand)))
|
||||
goto CleanupExit;
|
||||
@@ -4122,7 +4102,7 @@ HBITMAP PhLoadImageFormatFromResource(
|
||||
{
|
||||
IWICFormatConverter* wicFormatConverter = NULL;
|
||||
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicImageFactory, &wicFormatConverter)))
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicImagingFactory, &wicFormatConverter)))
|
||||
goto CleanupExit;
|
||||
|
||||
if (FAILED(IWICFormatConverter_Initialize(
|
||||
@@ -4165,7 +4145,7 @@ HBITMAP PhLoadImageFormatFromResource(
|
||||
{
|
||||
IWICBitmapScaler* wicBitmapScaler = NULL;
|
||||
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicImageFactory, &wicBitmapScaler)))
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicImagingFactory, &wicBitmapScaler)))
|
||||
{
|
||||
if (SUCCEEDED(IWICBitmapScaler_Initialize(
|
||||
wicBitmapScaler,
|
||||
@@ -4201,6 +4181,8 @@ CleanupExit:
|
||||
IWICBitmapFrameDecode_Release(wicBitmapFrame);
|
||||
if (wicBitmapStream)
|
||||
IWICStream_Release(wicBitmapStream);
|
||||
if (wicImagingFactory)
|
||||
IWICImagingFactory_Release(wicImagingFactory);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -4221,7 +4203,7 @@ HBITMAP PhLoadImageFromAddress(
|
||||
BOOLEAN success = FALSE;
|
||||
HBITMAP bitmapHandle = NULL;
|
||||
PVOID bitmapBuffer = NULL;
|
||||
IWICImagingFactory* wicImageFactory;
|
||||
IWICImagingFactory* wicImagingFactory;
|
||||
IWICStream* wicBitmapStream = NULL;
|
||||
IWICBitmapSource* wicBitmapSource = NULL;
|
||||
IWICBitmapDecoder* wicBitmapDecoder = NULL;
|
||||
@@ -4230,13 +4212,13 @@ HBITMAP PhLoadImageFromAddress(
|
||||
UINT sourceWidth = 0;
|
||||
UINT sourceHeight = 0;
|
||||
|
||||
if (!(wicImageFactory = PhpGetWicImagingFactoryInterface()))
|
||||
if (FAILED(PhGetClassObject(L"windowscodecs.dll", &CLSID_WICImagingFactory1, &IID_IWICImagingFactory, &wicImagingFactory)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICImagingFactory_CreateStream(wicImageFactory, &wicBitmapStream)))
|
||||
if (FAILED(IWICImagingFactory_CreateStream(wicImagingFactory, &wicBitmapStream)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICStream_InitializeFromMemory(wicBitmapStream, Buffer, BufferLength)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICImagingFactory_CreateDecoderFromStream(wicImageFactory, (IStream*)wicBitmapStream, &GUID_VendorMicrosoft, WICDecodeMetadataCacheOnDemand, &wicBitmapDecoder)))
|
||||
if (FAILED(IWICImagingFactory_CreateDecoderFromStream(wicImagingFactory, (IStream*)wicBitmapStream, &GUID_VendorMicrosoft, WICDecodeMetadataCacheOnDemand, &wicBitmapDecoder)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICBitmapDecoder_GetFrame(wicBitmapDecoder, 0, &wicBitmapFrame)))
|
||||
goto CleanupExit;
|
||||
@@ -4252,7 +4234,7 @@ HBITMAP PhLoadImageFromAddress(
|
||||
{
|
||||
IWICFormatConverter* wicFormatConverter = NULL;
|
||||
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicImageFactory, &wicFormatConverter)))
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicImagingFactory, &wicFormatConverter)))
|
||||
goto CleanupExit;
|
||||
|
||||
if (FAILED(IWICFormatConverter_Initialize(
|
||||
@@ -4295,7 +4277,7 @@ HBITMAP PhLoadImageFromAddress(
|
||||
{
|
||||
IWICBitmapScaler* wicBitmapScaler = NULL;
|
||||
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicImageFactory, &wicBitmapScaler)))
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicImagingFactory, &wicBitmapScaler)))
|
||||
{
|
||||
if (SUCCEEDED(IWICBitmapScaler_Initialize(
|
||||
wicBitmapScaler,
|
||||
@@ -4331,6 +4313,8 @@ CleanupExit:
|
||||
IWICBitmapFrameDecode_Release(wicBitmapFrame);
|
||||
if (wicBitmapStream)
|
||||
IWICStream_Release(wicBitmapStream);
|
||||
if (wicImagingFactory)
|
||||
IWICImagingFactory_Release(wicImagingFactory);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -4369,7 +4353,7 @@ HBITMAP PhLoadImageFromFile(
|
||||
BOOLEAN success = FALSE;
|
||||
HBITMAP bitmapHandle = NULL;
|
||||
PVOID bitmapBuffer = NULL;
|
||||
IWICImagingFactory* wicFactory = NULL;
|
||||
IWICImagingFactory* wicImagingFactory = NULL;
|
||||
IWICBitmapSource* wicBitmapSource = NULL;
|
||||
IWICBitmapDecoder* wicBitmapDecoder = NULL;
|
||||
IWICBitmapFrameDecode* wicBitmapFrame = NULL;
|
||||
@@ -4377,9 +4361,9 @@ HBITMAP PhLoadImageFromFile(
|
||||
UINT sourceWidth = 0;
|
||||
UINT sourceHeight = 0;
|
||||
|
||||
if (!(wicFactory = PhpGetWicImagingFactoryInterface()))
|
||||
if (FAILED(PhGetClassObject(L"windowscodecs.dll", &CLSID_WICImagingFactory1, &IID_IWICImagingFactory, &wicImagingFactory)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICImagingFactory_CreateDecoderFromFilename(wicFactory, FileName, &GUID_VendorMicrosoft, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &wicBitmapDecoder)))
|
||||
if (FAILED(IWICImagingFactory_CreateDecoderFromFilename(wicImagingFactory, FileName, &GUID_VendorMicrosoft, GENERIC_READ, WICDecodeMetadataCacheOnDemand, &wicBitmapDecoder)))
|
||||
goto CleanupExit;
|
||||
if (FAILED(IWICBitmapDecoder_GetFrame(wicBitmapDecoder, 0, &wicBitmapFrame)))
|
||||
goto CleanupExit;
|
||||
@@ -4395,7 +4379,7 @@ HBITMAP PhLoadImageFromFile(
|
||||
{
|
||||
IWICFormatConverter* wicFormatConverter = NULL;
|
||||
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicFactory, &wicFormatConverter)))
|
||||
if (FAILED(IWICImagingFactory_CreateFormatConverter(wicImagingFactory, &wicFormatConverter)))
|
||||
goto CleanupExit;
|
||||
|
||||
if (FAILED(IWICFormatConverter_Initialize(
|
||||
@@ -4438,7 +4422,7 @@ HBITMAP PhLoadImageFromFile(
|
||||
{
|
||||
IWICBitmapScaler* wicBitmapScaler = NULL;
|
||||
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicFactory, &wicBitmapScaler)))
|
||||
if (SUCCEEDED(IWICImagingFactory_CreateBitmapScaler(wicImagingFactory, &wicBitmapScaler)))
|
||||
{
|
||||
if (SUCCEEDED(IWICBitmapScaler_Initialize(
|
||||
wicBitmapScaler,
|
||||
@@ -4472,6 +4456,8 @@ CleanupExit:
|
||||
IWICBitmapDecoder_Release(wicBitmapDecoder);
|
||||
if (wicBitmapFrame)
|
||||
IWICBitmapFrameDecode_Release(wicBitmapFrame);
|
||||
if (wicImagingFactory)
|
||||
IWICImagingFactory_Release(wicImagingFactory);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
|
||||
@@ -1886,7 +1886,7 @@ BOOLEAN DotNetAsmTreeFilterCallback(
|
||||
VOID NTAPI DotNetAsmSearchControlCallback(
|
||||
_In_ ULONG_PTR MatchHandle,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
)
|
||||
{
|
||||
PASMPAGE_CONTEXT context = Context;
|
||||
|
||||
|
||||
@@ -404,8 +404,8 @@ VOID NTAPI NotifyEventCallback(
|
||||
{
|
||||
processItem = notifyEvent->Parameter;
|
||||
|
||||
if (processItem->FileNameWin32)
|
||||
found = MatchFilterList(ProcessFilterList, processItem->FileNameWin32, &filterType);
|
||||
if (processItem->FileName)
|
||||
found = MatchFilterList(ProcessFilterList, processItem->FileName, &filterType);
|
||||
|
||||
if (!found)
|
||||
MatchFilterList(ProcessFilterList, processItem->ProcessName, &filterType);
|
||||
|
||||
@@ -470,7 +470,7 @@ END_SORT_FUNCTION
|
||||
|
||||
BEGIN_SORT_FUNCTION(File)
|
||||
{
|
||||
sortResult = PhCompareStringWithNullSortOrder(diskItem1->FileNameWin32, diskItem2->FileNameWin32, DiskTreeNewSortOrder, FALSE);
|
||||
sortResult = PhCompareStringWithNullSortOrder(diskItem1->FileName, diskItem2->FileName, DiskTreeNewSortOrder, FALSE);
|
||||
}
|
||||
END_SORT_FUNCTION
|
||||
|
||||
@@ -1224,7 +1224,7 @@ VOID NTAPI EtpDiskItemsUpdatedHandler(
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
SystemInformer_Invoke(EtpOnDiskItemsUpdated, EtRunCount);
|
||||
SystemInformer_Invoke(EtpOnDiskItemsUpdated, UlongToPtr(EtRunCount));
|
||||
}
|
||||
|
||||
VOID NTAPI EtpOnDiskItemsUpdated(
|
||||
|
||||
@@ -260,7 +260,7 @@ VOID EtwDiskLayoutGraphs(
|
||||
|
||||
// Limit the rectangle bottom to the top of the panel.
|
||||
GetWindowRect(Context->PanelHandle, &panelRect);
|
||||
MapWindowPoints(NULL, Context->WindowHandle, (PPOINT)&panelRect, 2);
|
||||
MapWindowRect(NULL, Context->WindowHandle, &panelRect);
|
||||
clientRect.bottom = panelRect.top + 10; // +10 removing extra spacing
|
||||
|
||||
graphWidth = clientRect.right - margin.left - margin.right;
|
||||
@@ -326,7 +326,7 @@ VOID EtwNetworkLayoutGraphs(
|
||||
|
||||
// Limit the rectangle bottom to the top of the panel.
|
||||
GetWindowRect(Context->PanelHandle, &panelRect);
|
||||
MapWindowPoints(NULL, Context->WindowHandle, (PPOINT)&panelRect, 2);
|
||||
MapWindowRect(NULL, Context->WindowHandle, &panelRect);
|
||||
clientRect.bottom = panelRect.top + 10; // +10 removing extra spacing
|
||||
|
||||
graphWidth = clientRect.right - margin.left - margin.right;
|
||||
|
||||
@@ -112,6 +112,8 @@ extern BOOLEAN EtEnableAvxSupport;
|
||||
#define SETTING_NAME_MODULE_SERVICES_WINDOW_POSITION (PLUGIN_NAME L".ModuleServiceWindowPosition")
|
||||
#define SETTING_NAME_MODULE_SERVICES_WINDOW_SIZE (PLUGIN_NAME L".ModuleServiceWindowSize")
|
||||
#define SETTING_NAME_MODULE_SERVICES_COLUMNS (PLUGIN_NAME L".ModuleServiceListColumns")
|
||||
#define SETTING_NAME_GPU_DETAILS_WINDOW_POSITION (PLUGIN_NAME L".GpuDetailsWindowPosition")
|
||||
#define SETTING_NAME_GPU_DETAILS_WINDOW_SIZE (PLUGIN_NAME L".GpuDetailsWindowSize")
|
||||
#define SETTING_NAME_GPU_NODES_WINDOW_POSITION (PLUGIN_NAME L".GpuNodesWindowPosition")
|
||||
#define SETTING_NAME_GPU_NODES_WINDOW_SIZE (PLUGIN_NAME L".GpuNodesWindowSize")
|
||||
#define SETTING_NAME_NPU_NODES_WINDOW_POSITION (PLUGIN_NAME L".NpuNodesWindowPosition")
|
||||
|
||||
@@ -1901,7 +1901,7 @@ VOID NTAPI FwItemsUpdatedHandler(
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
SystemInformer_Invoke(OnFwItemsUpdated, FwRunCount);
|
||||
SystemInformer_Invoke(OnFwItemsUpdated, UlongToPtr(FwRunCount));
|
||||
}
|
||||
|
||||
VOID NTAPI OnFwItemsUpdated(
|
||||
|
||||
@@ -589,13 +589,13 @@ VOID EtpGpuUpdateSystemNodeInformation(
|
||||
}
|
||||
|
||||
VOID NTAPI EtGpuProcessesUpdatedCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
_In_ PVOID Parameter,
|
||||
_In_ PVOID Context
|
||||
)
|
||||
{
|
||||
static ULONG runCount = 0; // MUST keep in sync with runCount in process provider
|
||||
FLOAT elapsedTime = 0; // total GPU node elapsed time in micro-seconds
|
||||
FLOAT tempGpuUsage = 0;
|
||||
ULONG runCount = PtrToUlong(Parameter);
|
||||
DOUBLE elapsedTime = 0; // total GPU node elapsed time in micro-seconds
|
||||
DOUBLE tempGpuUsage = 0;
|
||||
ULONG i;
|
||||
PLIST_ENTRY listEntry;
|
||||
FLOAT maxNodeValue = 0;
|
||||
@@ -611,13 +611,14 @@ VOID NTAPI EtGpuProcessesUpdatedCallback(
|
||||
dedicatedTotal = EtLookupTotalGpuDedicated();
|
||||
sharedTotal = EtLookupTotalGpuShared();
|
||||
|
||||
if (gpuTotal > 1)
|
||||
gpuTotal = 1;
|
||||
|
||||
if (gpuTotal > 100.0)
|
||||
gpuTotal = 100.0;
|
||||
if (gpuTotal < 0.0)
|
||||
gpuTotal = 0.0;
|
||||
if (gpuTotal > tempGpuUsage)
|
||||
tempGpuUsage = gpuTotal;
|
||||
|
||||
EtGpuNodeUsage = tempGpuUsage;
|
||||
EtGpuNodeUsage = (FLOAT)tempGpuUsage;
|
||||
EtGpuDedicatedUsage = dedicatedTotal;
|
||||
EtGpuSharedUsage = sharedTotal;
|
||||
}
|
||||
@@ -626,23 +627,25 @@ VOID NTAPI EtGpuProcessesUpdatedCallback(
|
||||
EtpGpuUpdateSystemSegmentInformation();
|
||||
EtpGpuUpdateSystemNodeInformation();
|
||||
|
||||
elapsedTime = (FLOAT)EtGpuClockTotalRunningTimeDelta.Delta * 10000000 / (FLOAT)EtGpuClockTotalRunningTimeFrequency.QuadPart;
|
||||
elapsedTime = (DOUBLE)EtGpuClockTotalRunningTimeDelta.Delta * 10000000 / EtGpuClockTotalRunningTimeFrequency.QuadPart;
|
||||
|
||||
if (elapsedTime != 0)
|
||||
{
|
||||
for (i = 0; i < EtGpuTotalNodeCount; i++)
|
||||
{
|
||||
FLOAT usage = (FLOAT)(EtGpuNodesTotalRunningTimeDelta[i].Delta / (FLOAT)elapsedTime);
|
||||
DOUBLE usage = (EtGpuNodesTotalRunningTimeDelta[i].Delta / elapsedTime) * 100.0;
|
||||
|
||||
if (usage > 1)
|
||||
usage = 1;
|
||||
if (usage > 100.0)
|
||||
usage = 100.0;
|
||||
if (usage < 0.0)
|
||||
usage = 0.0;
|
||||
|
||||
if (usage > tempGpuUsage)
|
||||
tempGpuUsage = usage;
|
||||
}
|
||||
}
|
||||
|
||||
EtGpuNodeUsage = tempGpuUsage;
|
||||
EtGpuNodeUsage = (FLOAT)tempGpuUsage;
|
||||
}
|
||||
|
||||
if (EtGpuSupported && EtpGpuAdapterList->Count)
|
||||
@@ -859,14 +862,14 @@ VOID NTAPI EtGpuProcessesUpdatedCallback(
|
||||
{
|
||||
for (i = 0; i < EtGpuTotalNodeCount; i++)
|
||||
{
|
||||
FLOAT usage;
|
||||
DOUBLE usage;
|
||||
|
||||
usage = (FLOAT)(EtGpuNodesTotalRunningTimeDelta[i].Delta / elapsedTime);
|
||||
usage = (DOUBLE)(EtGpuNodesTotalRunningTimeDelta[i].Delta / elapsedTime) * 100;
|
||||
|
||||
if (usage > 1)
|
||||
usage = 1;
|
||||
if (usage > 100)
|
||||
usage = 100;
|
||||
|
||||
PhAddItemCircularBuffer_FLOAT(&EtGpuNodesHistory[i], usage);
|
||||
PhAddItemCircularBuffer_FLOAT(&EtGpuNodesHistory[i], (FLOAT)usage);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -888,8 +891,6 @@ VOID NTAPI EtGpuProcessesUpdatedCallback(
|
||||
PhAddItemCircularBuffer_FLOAT(&EtMaxGpuNodeUsageHistory, 0);
|
||||
}
|
||||
}
|
||||
|
||||
runCount++;
|
||||
}
|
||||
|
||||
ULONG EtGetGpuAdapterCount(
|
||||
|
||||
@@ -1284,6 +1284,8 @@ LOGICAL DllMain(
|
||||
{ IntegerPairSettingType, SETTING_NAME_MODULE_SERVICES_WINDOW_POSITION, L"0,0" },
|
||||
{ ScalableIntegerPairSettingType, SETTING_NAME_MODULE_SERVICES_WINDOW_SIZE, L"@96|850,490" },
|
||||
{ StringSettingType, SETTING_NAME_MODULE_SERVICES_COLUMNS, L"" },
|
||||
{ IntegerPairSettingType, SETTING_NAME_GPU_DETAILS_WINDOW_POSITION, L"0,0" },
|
||||
{ ScalableIntegerPairSettingType, SETTING_NAME_GPU_DETAILS_WINDOW_SIZE, L"@96|850,490" },
|
||||
{ IntegerPairSettingType, SETTING_NAME_GPU_NODES_WINDOW_POSITION, L"0,0" },
|
||||
{ ScalableIntegerPairSettingType, SETTING_NAME_GPU_NODES_WINDOW_SIZE, L"@96|850,490" },
|
||||
{ IntegerPairSettingType, SETTING_NAME_NPU_NODES_WINDOW_POSITION, L"0,0" },
|
||||
@@ -1297,7 +1299,7 @@ LOGICAL DllMain(
|
||||
{ IntegerPairSettingType, SETTING_NAME_FW_TREE_LIST_SORT, L"12,2" },
|
||||
{ IntegerSettingType, SETTING_NAME_FW_IGNORE_PORTSCAN, L"0" },
|
||||
{ IntegerSettingType, SETTING_NAME_FW_IGNORE_LOOPBACK, L"1" },
|
||||
{ IntegerSettingType, SETTING_NAME_FW_IGNORE_ALLOW, L"0" },
|
||||
{ IntegerSettingType, SETTING_NAME_FW_IGNORE_ALLOW, L"1" },
|
||||
{ StringSettingType, SETTING_NAME_FW_SESSION_GUID, L"" },
|
||||
{ IntegerSettingType, SETTING_NAME_SHOWSYSINFOGRAPH, L"1" },
|
||||
{ StringSettingType, SETTING_NAME_WCT_TREE_LIST_COLUMNS, L"" },
|
||||
|
||||
@@ -216,7 +216,7 @@ INT_PTR CALLBACK EtpModuleServicesDlgProc(
|
||||
|
||||
// Position the control.
|
||||
GetWindowRect(GetDlgItem(hwndDlg, IDC_SERVICES_LAYOUT), &rect);
|
||||
MapWindowPoints(NULL, hwndDlg, (POINT *)&rect, 2);
|
||||
MapWindowRect(NULL, hwndDlg, &rect);
|
||||
MoveWindow(context->ServiceListHandle, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, FALSE);
|
||||
ShowWindow(context->ServiceListHandle, SW_SHOW);
|
||||
|
||||
|
||||
@@ -1976,12 +1976,12 @@ INT_PTR CALLBACK EtpObjHandlesPageDlgProc(
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ID_HANDLE_OBJECTPROPERTIES1:
|
||||
case PHAPP_ID_HANDLE_OBJECTPROPERTIES1:
|
||||
{
|
||||
PhShowHandleObjectProperties1(hwndDlg, &info);
|
||||
}
|
||||
break;
|
||||
case ID_HANDLE_OBJECTPROPERTIES2:
|
||||
case PHAPP_ID_HANDLE_OBJECTPROPERTIES2:
|
||||
{
|
||||
PhShowHandleObjectProperties2(hwndDlg, &info);
|
||||
}
|
||||
|
||||
@@ -318,6 +318,66 @@ CleanupExit:
|
||||
return status;
|
||||
}
|
||||
|
||||
NTSTATUS EtpQueryAdapterProperty(
|
||||
_In_ D3DKMT_HANDLE AdapterHandle,
|
||||
_In_ PPH_STRINGREF PropertyName,
|
||||
_Out_ D3DDDI_QUERYREGISTRY_INFO** PropertyInfo
|
||||
)
|
||||
{
|
||||
NTSTATUS status;
|
||||
ULONG queryBufferLength;
|
||||
D3DDDI_QUERYREGISTRY_INFO* queryBuffer;
|
||||
|
||||
queryBufferLength = FIELD_OFFSET(D3DDDI_QUERYREGISTRY_INFO, OutputString[MAX_PATH]);
|
||||
queryBuffer = PhAllocateZero(queryBufferLength);
|
||||
queryBuffer->QueryType = D3DDDI_QUERYREGISTRY_ADAPTERKEY;
|
||||
queryBuffer->QueryFlags.TranslatePath = 1;
|
||||
queryBuffer->ValueType = REG_MULTI_SZ;
|
||||
memcpy(queryBuffer->ValueName, PropertyName->Buffer, PropertyName->Length);
|
||||
|
||||
status = EtQueryAdapterInformation(
|
||||
AdapterHandle,
|
||||
KMTQAITYPE_QUERYREGISTRY,
|
||||
queryBuffer,
|
||||
queryBufferLength
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
goto CleanupExit;
|
||||
|
||||
if (queryBuffer->Status == D3DDDI_QUERYREGISTRY_STATUS_BUFFER_OVERFLOW)
|
||||
{
|
||||
queryBufferLength = queryBuffer->OutputValueSize;
|
||||
queryBuffer = PhReAllocate(queryBuffer, queryBufferLength);
|
||||
|
||||
status = EtQueryAdapterInformation(
|
||||
AdapterHandle,
|
||||
KMTQAITYPE_QUERYREGISTRY,
|
||||
queryBuffer,
|
||||
queryBufferLength
|
||||
);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
if (queryBuffer->Status != D3DDDI_QUERYREGISTRY_STATUS_SUCCESS)
|
||||
{
|
||||
status = STATUS_REGISTRY_IO_FAILED;
|
||||
goto CleanupExit;
|
||||
}
|
||||
|
||||
if (NT_SUCCESS(status))
|
||||
{
|
||||
*PropertyInfo = queryBuffer;
|
||||
return status;
|
||||
}
|
||||
|
||||
CleanupExit:
|
||||
PhFree(queryBuffer);
|
||||
return status;
|
||||
}
|
||||
|
||||
// HardwareDevices!GraphicsQueryAdapterAttributes
|
||||
NTSTATUS EtQueryAdapterAttributes(
|
||||
_In_ D3DKMT_HANDLE AdapterHandle,
|
||||
@@ -327,26 +387,39 @@ NTSTATUS EtQueryAdapterAttributes(
|
||||
static PH_STRINGREF dxCoreAttributes = PH_STRINGREF_INIT(L"DXCoreAttributes");
|
||||
static PH_STRINGREF dxAttributes = PH_STRINGREF_INIT(L"DXAttributes");
|
||||
NTSTATUS status;
|
||||
PPH_STRING adapterAttributes;
|
||||
D3DDDI_QUERYREGISTRY_INFO* adapterAttributes;
|
||||
PWSTR attributes;
|
||||
|
||||
Attributes->Flags = 0;
|
||||
|
||||
// DXCoreAdapter::QueryAndFillAdapterExtendedProperiesOnPlatform
|
||||
if (!NT_SUCCESS(status = EtpQueryAdapterPropertyString(AdapterHandle, &dxCoreAttributes, &adapterAttributes)))
|
||||
if (!NT_SUCCESS(status = EtpQueryAdapterPropertyString(AdapterHandle, &dxAttributes, &adapterAttributes)))
|
||||
return status;
|
||||
status = EtpQueryAdapterProperty(AdapterHandle, &dxCoreAttributes, &adapterAttributes);
|
||||
|
||||
for (PWCHAR attr = adapterAttributes->Buffer;;)
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
status = EtpQueryAdapterProperty(AdapterHandle, &dxAttributes, &adapterAttributes);
|
||||
|
||||
if (!NT_SUCCESS(status))
|
||||
return status;
|
||||
}
|
||||
|
||||
attributes = adapterAttributes->OutputString;
|
||||
|
||||
// DXCoreAdapter::QueryAndFillAdapterExtendedProperiesOnPlatform
|
||||
//if (!NT_SUCCESS(status = EtpQueryAdapterPropertyString(AdapterHandle, &dxCoreAttributes, &adapterAttributes)))
|
||||
// if (!NT_SUCCESS(status = EtpQueryAdapterPropertyString(AdapterHandle, &dxAttributes, &adapterAttributes)))
|
||||
// return status;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
PH_STRINGREF attribute;
|
||||
GUID guid;
|
||||
|
||||
PhInitializeStringRef(&attribute, attr);
|
||||
PhInitializeStringRefLongHint(&attribute, attributes);
|
||||
|
||||
if (!attribute.Length)
|
||||
break;
|
||||
|
||||
attr = PTR_ADD_OFFSET(attr, attribute.Length + sizeof(UNICODE_NULL));
|
||||
attributes = PTR_ADD_OFFSET(attributes, attribute.Length + sizeof(UNICODE_NULL));
|
||||
|
||||
if (!NT_SUCCESS(status = PhStringToGuid(&attribute, &guid)))
|
||||
break;
|
||||
@@ -412,7 +485,7 @@ NTSTATUS EtQueryAdapterAttributes(
|
||||
}
|
||||
}
|
||||
|
||||
PhDereferenceObject(adapterAttributes);
|
||||
PhFree(adapterAttributes);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -40,11 +40,9 @@ VOID NetworkDevicesInitialize(
|
||||
}
|
||||
|
||||
VOID NetworkDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
)
|
||||
{
|
||||
static ULONG runCount = 0; // MUST keep in sync with runCount in process provider
|
||||
|
||||
PhAcquireQueuedLockShared(&NetworkDevicesListLock);
|
||||
|
||||
for (ULONG i = 0; i < NetworkDevicesList->Count; i++)
|
||||
@@ -177,7 +175,7 @@ VOID NetworkDevicesUpdate(
|
||||
entry->HaveFirstSample = TRUE;
|
||||
}
|
||||
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
entry->CurrentNetworkSend = entry->NetworkSendDelta.Delta;
|
||||
entry->CurrentNetworkReceive = entry->NetworkReceiveDelta.Delta;
|
||||
@@ -190,8 +188,6 @@ VOID NetworkDevicesUpdate(
|
||||
}
|
||||
|
||||
PhReleaseQueuedLockShared(&NetworkDevicesListLock);
|
||||
|
||||
runCount++;
|
||||
}
|
||||
|
||||
VOID NetworkDeviceUpdateDeviceInfo(
|
||||
|
||||
@@ -66,7 +66,7 @@ typedef struct _DEVICE_PROPERTIES_CONTEXT
|
||||
HWND InterfacesListViewHandle;
|
||||
HICON DeviceIcon;
|
||||
PH_INTEGER_PAIR DeviceIconSize;
|
||||
|
||||
HIMAGELIST ListViewImageList;
|
||||
union
|
||||
{
|
||||
struct
|
||||
@@ -174,6 +174,36 @@ VOID DeviceInitializeGenealPageItems(
|
||||
DEVICE_ADD_PAGE_ITEM(DEVICE_PROPERTIES_INDEX_CLASS_PROPERTY_PAGE_PROVIDER, PhDevicePropertyClassPropPageProvider);
|
||||
}
|
||||
|
||||
VOID DeviceSetImageList(
|
||||
_In_ HWND WindowHandle,
|
||||
_In_ PDEVICE_PROPERTIES_CONTEXT Context
|
||||
)
|
||||
{
|
||||
LONG dpiValue;
|
||||
|
||||
dpiValue = PhGetWindowDpi(WindowHandle);
|
||||
|
||||
if (Context->ListViewImageList)
|
||||
{
|
||||
PhImageListSetIconSize(
|
||||
Context->ListViewImageList,
|
||||
2,
|
||||
PhGetDpi(20, dpiValue)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
Context->ListViewImageList = PhImageListCreate(
|
||||
2,
|
||||
PhGetDpi(20, dpiValue),
|
||||
ILC_MASK | ILC_COLOR32,
|
||||
1, 1
|
||||
);
|
||||
}
|
||||
|
||||
ListView_SetImageList(WindowHandle, Context->ListViewImageList, LVSIL_SMALL);
|
||||
}
|
||||
|
||||
VOID DeviceInitializeGeneralPage(
|
||||
_In_ HWND hwndDlg,
|
||||
_In_ PDEVICE_PROPERTIES_CONTEXT Context
|
||||
@@ -237,6 +267,7 @@ INT_PTR CALLBACK DevicePropGeneralDlgProc(
|
||||
PhAddListViewColumn(context->GeneralListViewHandle, 1, 1, 1, LVCFMT_LEFT, 300, L"Value");
|
||||
PhSetExtendedListView(context->GeneralListViewHandle);
|
||||
PhLoadListViewColumnsFromSetting(SETTING_NAME_DEVICE_GENERAL_COLUMNS, context->GeneralListViewHandle);
|
||||
DeviceSetImageList(context->GeneralListViewHandle, context);
|
||||
|
||||
DeviceInitializeGeneralPage(hwndDlg, context);
|
||||
|
||||
@@ -548,19 +579,6 @@ VOID DeviceInitializePropsPage(
|
||||
_In_ PDEVICE_PROPERTIES_CONTEXT Context
|
||||
)
|
||||
{
|
||||
static PH_INITONCE initOnce = PH_INITONCE_INIT;
|
||||
static HRESULT(WINAPI * DevGetObjectProperties_I)(
|
||||
_In_ DEV_OBJECT_TYPE ObjectType,
|
||||
_In_ PCWSTR pszObjectId,
|
||||
_In_ ULONG QueryFlags,
|
||||
_In_ ULONG cRequestedProperties,
|
||||
_In_reads_(cRequestedProperties) const DEVPROPCOMPKEY *pRequestedProperties,
|
||||
_Out_ PULONG pcPropertyCount,
|
||||
_Outptr_result_buffer_(*pcPropertyCount) const DEVPROPERTY **ppProperties) = NULL;
|
||||
static VOID(WINAPI * DevFreeObjectProperties_I)(
|
||||
_In_ ULONG cPropertyCount,
|
||||
_In_reads_(cPropertyCount) const DEVPROPERTY *pProperties) = NULL;
|
||||
|
||||
// Use DevGetObjectProperties to get all properties of the device. This enables us to display
|
||||
// information for items that we might not be aware of in our table. Device manager maintains a
|
||||
// similar table with all the DEVPROPKEYs that it knows about. It maintains a MUI resource
|
||||
@@ -569,23 +587,10 @@ VOID DeviceInitializePropsPage(
|
||||
const DEVPROPERTY* properties;
|
||||
ULONG propertyCount;
|
||||
|
||||
if (PhBeginInitOnce(&initOnce))
|
||||
{
|
||||
PVOID cfgmgr32;
|
||||
|
||||
if (cfgmgr32 = PhLoadLibrary(L"cfgmgr32.dll"))
|
||||
{
|
||||
DevGetObjectProperties_I = PhGetProcedureAddress(cfgmgr32, "DevGetObjectProperties", 0);
|
||||
DevFreeObjectProperties_I = PhGetProcedureAddress(cfgmgr32, "DevFreeObjectProperties", 0);
|
||||
}
|
||||
|
||||
PhEndInitOnce(&initOnce);
|
||||
}
|
||||
|
||||
ExtendedListView_SetRedraw(Context->PropsListViewHandle, FALSE);
|
||||
ListView_DeleteAllItems(Context->PropsListViewHandle);
|
||||
|
||||
if (SUCCEEDED(DevGetObjectProperties_I(
|
||||
if (SUCCEEDED(PhDevGetObjectProperties(
|
||||
DevObjectTypeDevice,
|
||||
PhGetString(Context->DeviceItem->InstanceId),
|
||||
DevQueryFlagAllProperties,
|
||||
@@ -612,9 +617,17 @@ VOID DeviceInitializePropsPage(
|
||||
}
|
||||
else
|
||||
{
|
||||
PH_FORMAT format[4];
|
||||
|
||||
// use the property key format ID as the column name
|
||||
nameString = PhFormatGuid((PGUID)&prop->CompKey.Key.fmtid);
|
||||
PhInitFormatSR(&format[0], nameString->sr);
|
||||
PhInitFormatS(&format[1], L" [");
|
||||
PhInitFormatU(&format[2], prop->CompKey.Key.pid);
|
||||
PhInitFormatC(&format[3], L']');
|
||||
PhMoveReference(&nameString, PhFormat(format, 4, 0));
|
||||
name = PhGetString(nameString);
|
||||
|
||||
valueString = DevicePropertyToString(prop);
|
||||
value = PhGetString(valueString);
|
||||
}
|
||||
@@ -626,7 +639,7 @@ VOID DeviceInitializePropsPage(
|
||||
PhClearReference(&valueString);
|
||||
}
|
||||
|
||||
DevFreeObjectProperties_I(propertyCount, properties);
|
||||
PhDevFreeObjectProperties(propertyCount, properties);
|
||||
}
|
||||
|
||||
ExtendedListView_SetRedraw(Context->PropsListViewHandle, TRUE);
|
||||
@@ -663,6 +676,7 @@ INT_PTR CALLBACK DevicePropPropertiesDlgProc(
|
||||
PhAddListViewColumn(context->PropsListViewHandle, 1, 1, 1, LVCFMT_LEFT, 300, L"Value");
|
||||
PhSetExtendedListView(context->PropsListViewHandle);
|
||||
PhLoadListViewColumnsFromSetting(SETTING_NAME_DEVICE_PROPERTIES_COLUMNS, context->PropsListViewHandle);
|
||||
DeviceSetImageList(context->PropsListViewHandle, context);
|
||||
|
||||
DeviceInitializePropsPage(hwndDlg, context);
|
||||
|
||||
@@ -836,6 +850,7 @@ INT_PTR CALLBACK DevicePropInterfacesDlgProc(
|
||||
PhAddListViewColumn(context->InterfacesListViewHandle, 1, 1, 1, LVCFMT_LEFT, 300, L"Value");
|
||||
PhSetExtendedListView(context->InterfacesListViewHandle);
|
||||
PhLoadListViewColumnsFromSetting(SETTING_NAME_DEVICE_INTERFACES_COLUMNS, context->InterfacesListViewHandle);
|
||||
DeviceSetImageList(context->InterfacesListViewHandle, context);
|
||||
|
||||
DeviceInitializeInterfacesPage(hwndDlg, context);
|
||||
|
||||
|
||||
@@ -28,6 +28,8 @@
|
||||
#define SETTING_NAME_SMART_COUNTERS_COLUMNS (PLUGIN_NAME L".SmartListColumns")
|
||||
#define SETTING_NAME_RAPL_LIST (PLUGIN_NAME L".RaplList")
|
||||
#define SETTING_NAME_GRAPHICS_LIST (PLUGIN_NAME L".GraphicsList")
|
||||
#define SETTING_NAME_GRAPHICS_DETAILS_WINDOW_POSITION (PLUGIN_NAME L".GraphicsDetailsWindowPosition")
|
||||
#define SETTING_NAME_GRAPHICS_DETAILS_WINDOW_SIZE (PLUGIN_NAME L".GraphicsDetailsWindowSize")
|
||||
#define SETTING_NAME_GRAPHICS_NODES_WINDOW_POSITION (PLUGIN_NAME L".GraphicsNodesWindowPosition")
|
||||
#define SETTING_NAME_GRAPHICS_NODES_WINDOW_SIZE (PLUGIN_NAME L".GraphicsNodesWindowSize")
|
||||
#define SETTING_NAME_GRAPHICS_UNIQUE_INDICES (PLUGIN_NAME L".GraphicsUniqueIndices")
|
||||
@@ -302,7 +304,7 @@ VOID NetworkDevicesInitialize(
|
||||
);
|
||||
|
||||
VOID NetworkDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
);
|
||||
|
||||
VOID NetworkDeviceUpdateDeviceInfo(
|
||||
@@ -600,7 +602,7 @@ typedef struct _DV_DISK_OPTIONS_CONTEXT
|
||||
|
||||
VOID DiskDevicesInitialize(VOID);
|
||||
VOID DiskDrivesLoadList(VOID);
|
||||
VOID DiskDevicesUpdate(VOID);
|
||||
VOID DiskDevicesUpdate(_In_ ULONG RunCount);
|
||||
|
||||
VOID DiskDeviceUpdateDeviceInfo(
|
||||
_In_opt_ HANDLE DeviceHandle,
|
||||
@@ -1202,7 +1204,7 @@ VOID RaplDevicesLoadList(
|
||||
);
|
||||
|
||||
VOID RaplDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
);
|
||||
|
||||
VOID InitializeRaplDeviceId(
|
||||
@@ -1397,7 +1399,7 @@ VOID GraphicsDevicesLoadList(
|
||||
);
|
||||
|
||||
VOID GraphicsDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
);
|
||||
|
||||
VOID InitializeGraphicsDeviceId(
|
||||
|
||||
@@ -1266,7 +1266,27 @@ const DEVICE_PROPERTY_TABLE_ENTRY DeviceItemPropertyTable[] =
|
||||
|
||||
{ PhDevicePropertyObjectType, L"Object type", FALSE, 80, 0 },
|
||||
|
||||
{ PhDevicePropertyPciDeviceType, L"PCI device type", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciCurrentSpeedAndMode, L"PCI current speed and mode", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciBaseClass, L"PCI base class", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciSubClass, L"PCI sub class", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciProgIf, L"PCI programming interface", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciCurrentPayloadSize, L"PCI current payload size", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciMaxPayloadSize, L"PCI max payload size", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciMaxReadRequestSize, L"PCI max read request size", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciCurrentLinkSpeed, L"PCI current link speed", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciCurrentLinkWidth, L"PCI current link width", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciMaxLinkSpeed, L"PCI max link speed", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciMaxLinkWidth, L"PCI max link width", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciExpressSpecVersion, L"PCI express spec version", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciInterruptSupport, L"PCI interrupt support", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciInterruptMessageMaximum, L"PCI interrupt message maximum", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciBarTypes, L"PCI BAR types", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciSriovSupport, L"PCI SR-IOV support", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciLabel_Id, L"PCI label ID", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciLabel_String, L"PCI label string", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciSerialNumber, L"PCI serial number", FALSE, 80, 0 },
|
||||
|
||||
{ PhDevicePropertyPciExpressCapabilityControl, L"PCI express capability control", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciNativeExpressControl, L"PCI native express control", FALSE, 80, 0 },
|
||||
{ PhDevicePropertyPciSystemMsiSupport, L"PCI system MSI support", FALSE, 80, 0 },
|
||||
|
||||
@@ -41,11 +41,9 @@ VOID DiskDevicesInitialize(
|
||||
}
|
||||
|
||||
VOID DiskDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
)
|
||||
{
|
||||
static ULONG runCount = 0; // MUST keep in sync with runCount in process provider
|
||||
|
||||
PhAcquireQueuedLockShared(&DiskDevicesListLock);
|
||||
|
||||
for (ULONG i = 0; i < DiskDevicesList->Count; i++)
|
||||
@@ -167,7 +165,7 @@ VOID DiskDevicesUpdate(
|
||||
entry->HaveFirstSample = TRUE;
|
||||
}
|
||||
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
PhAddItemCircularBuffer_ULONG64(&entry->ReadBuffer, entry->BytesReadDelta.Delta);
|
||||
PhAddItemCircularBuffer_ULONG64(&entry->WriteBuffer, entry->BytesWrittenDelta.Delta);
|
||||
@@ -177,8 +175,6 @@ VOID DiskDevicesUpdate(
|
||||
}
|
||||
|
||||
PhReleaseQueuedLockShared(&DiskDevicesListLock);
|
||||
|
||||
runCount++;
|
||||
}
|
||||
|
||||
VOID DiskDeviceUpdateDeviceInfo(
|
||||
|
||||
@@ -55,11 +55,9 @@ VOID GraphicsDeviceInitialize(
|
||||
}
|
||||
|
||||
VOID GraphicsDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
)
|
||||
{
|
||||
static ULONG runCount = 0; // MUST keep in sync with runCount in process provider
|
||||
|
||||
PhAcquireQueuedLockShared(&GraphicsDevicesListLock);
|
||||
|
||||
for (ULONG i = 0; i < GraphicsDevicesList->Count; i++)
|
||||
@@ -261,17 +259,17 @@ VOID GraphicsDevicesUpdate(
|
||||
if (usage > tempValue)
|
||||
tempValue = usage;
|
||||
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
PhAddItemCircularBuffer_FLOAT(&entry->GpuNodesHistory[node], (FLOAT)usage);
|
||||
PhAddItemCircularBuffer_FLOAT(&entry->GpuNodesHistory[node], usage);
|
||||
}
|
||||
}
|
||||
|
||||
entry->CurrentGpuUsage = (FLOAT)tempValue;
|
||||
entry->CurrentGpuUsage = tempValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
for (ULONG node = 0; node < entry->NumberOfNodes; node++)
|
||||
{
|
||||
@@ -288,7 +286,7 @@ VOID GraphicsDevicesUpdate(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
for (ULONG node = 0; node < entry->NumberOfNodes; node++)
|
||||
{
|
||||
@@ -306,7 +304,7 @@ VOID GraphicsDevicesUpdate(
|
||||
entry->DevicePresent = FALSE;
|
||||
}
|
||||
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
PhAddItemCircularBuffer_FLOAT(&entry->GpuUsageHistory, entry->CurrentGpuUsage);
|
||||
PhAddItemCircularBuffer_ULONG64(&entry->DedicatedHistory, entry->CurrentDedicatedUsage);
|
||||
@@ -321,8 +319,6 @@ VOID GraphicsDevicesUpdate(
|
||||
}
|
||||
|
||||
PhReleaseQueuedLockShared(&GraphicsDevicesListLock);
|
||||
|
||||
runCount++;
|
||||
}
|
||||
|
||||
VOID InitializeGraphicsDeviceId(
|
||||
|
||||
@@ -384,7 +384,10 @@ INT_PTR CALLBACK GraphicsDeviceDetailsDlgProc(
|
||||
PhInitializeLayoutManager(&context->LayoutManager, hwndDlg);
|
||||
PhAddLayoutItem(&context->LayoutManager, context->ListViewHandle, NULL, PH_ANCHOR_ALL);
|
||||
|
||||
PhCenterWindow(hwndDlg, GetParent(hwndDlg));
|
||||
if (PhGetIntegerPairSetting(SETTING_NAME_GRAPHICS_DETAILS_WINDOW_POSITION).X != 0)
|
||||
PhLoadWindowPlacementFromSetting(SETTING_NAME_GRAPHICS_DETAILS_WINDOW_POSITION, SETTING_NAME_GRAPHICS_DETAILS_WINDOW_SIZE, hwndDlg);
|
||||
else
|
||||
PhCenterWindow(hwndDlg, GetParent(hwndDlg));
|
||||
|
||||
PhInitializeWindowTheme(hwndDlg, !!PhGetIntegerSetting(L"EnableThemeSupport"));
|
||||
|
||||
@@ -402,6 +405,8 @@ INT_PTR CALLBACK GraphicsDeviceDetailsDlgProc(
|
||||
{
|
||||
PhUnregisterCallback(PhGetGeneralCallback(GeneralCallbackProcessProviderUpdatedEvent), &context->ProcessesUpdatedCallbackRegistration);
|
||||
|
||||
PhSaveWindowPlacementToSetting(SETTING_NAME_GRAPHICS_DETAILS_WINDOW_POSITION, SETTING_NAME_GRAPHICS_DETAILS_WINDOW_SIZE, hwndDlg);
|
||||
|
||||
PhDeleteLayoutManager(&context->LayoutManager);
|
||||
|
||||
PostQuitMessage(0);
|
||||
|
||||
@@ -128,14 +128,16 @@ VOID NTAPI MainWindowShowingCallback(
|
||||
}
|
||||
|
||||
VOID NTAPI ProcessesUpdatedCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
)
|
||||
{
|
||||
GraphicsDevicesUpdate();
|
||||
DiskDevicesUpdate();
|
||||
NetworkDevicesUpdate();
|
||||
RaplDevicesUpdate();
|
||||
ULONG runCount = PtrToUlong(Parameter);
|
||||
|
||||
GraphicsDevicesUpdate(runCount);
|
||||
DiskDevicesUpdate(runCount);
|
||||
NetworkDevicesUpdate(runCount);
|
||||
RaplDevicesUpdate(runCount);
|
||||
}
|
||||
|
||||
VOID NTAPI SystemInformationInitializingCallback(
|
||||
@@ -649,6 +651,8 @@ LOGICAL DllMain(
|
||||
{ StringSettingType, SETTING_NAME_SMART_COUNTERS_COLUMNS, L"" },
|
||||
{ StringSettingType, SETTING_NAME_RAPL_LIST, L"" },
|
||||
{ StringSettingType, SETTING_NAME_GRAPHICS_LIST, L"" },
|
||||
{ IntegerPairSettingType, SETTING_NAME_GRAPHICS_DETAILS_WINDOW_POSITION, L"0,0" },
|
||||
{ ScalableIntegerPairSettingType, SETTING_NAME_GRAPHICS_DETAILS_WINDOW_SIZE, L"@96|850,490" },
|
||||
{ IntegerPairSettingType, SETTING_NAME_GRAPHICS_NODES_WINDOW_POSITION, L"0,0" },
|
||||
{ ScalableIntegerPairSettingType, SETTING_NAME_GRAPHICS_NODES_WINDOW_SIZE, L"@96|850,490" },
|
||||
{ IntegerSettingType, SETTING_NAME_GRAPHICS_UNIQUE_INDICES, L"1" },
|
||||
|
||||
@@ -186,14 +186,13 @@ PPH_STRING NetworkAdapterQueryNameFromDeviceGuid(
|
||||
// Query adapter description using undocumented function. (dmex)
|
||||
static ULONG (WINAPI* NhGetInterfaceNameFromDeviceGuid_I)(
|
||||
_In_ PGUID DeviceGuid,
|
||||
_Out_writes_(InterfaceDescriptionLength) PWSTR InterfaceDescription,
|
||||
_Inout_ PSIZE_T InterfaceDescriptionLength,
|
||||
_Out_writes_(InterfaceDescriptionLength) PWCHAR InterfaceDescription,
|
||||
_Inout_ PULONG InterfaceDescriptionLength,
|
||||
_In_ BOOL Cache,
|
||||
_In_ BOOL Refresh
|
||||
) = NULL;
|
||||
GUID interfaceGuid = { 0 };
|
||||
WCHAR adapterAlias[NDIS_IF_MAX_STRING_SIZE + 1] = L"";
|
||||
SIZE_T adapterAliasLength = sizeof(adapterAlias);
|
||||
ULONG adapterAliasLength = sizeof(adapterAlias);
|
||||
|
||||
if (!NhGetInterfaceNameFromDeviceGuid_I)
|
||||
{
|
||||
|
||||
@@ -53,11 +53,9 @@ VOID RaplDeviceInitialize(
|
||||
}
|
||||
|
||||
VOID RaplDevicesUpdate(
|
||||
VOID
|
||||
_In_ ULONG RunCount
|
||||
)
|
||||
{
|
||||
static ULONG runCount = 0; // MUST keep in sync with runCount in process provider
|
||||
|
||||
PhAcquireQueuedLockShared(&RaplDevicesListLock);
|
||||
|
||||
for (ULONG i = 0; i < RaplDevicesList->Count; i++)
|
||||
@@ -198,7 +196,7 @@ VOID RaplDevicesUpdate(
|
||||
entry->DevicePresent = FALSE;
|
||||
}
|
||||
|
||||
if (runCount != 0)
|
||||
if (RunCount != 0)
|
||||
{
|
||||
PhAddItemCircularBuffer_FLOAT(&entry->PackageBuffer, entry->CurrentProcessorPower);
|
||||
PhAddItemCircularBuffer_FLOAT(&entry->CoreBuffer, entry->CurrentCorePower);
|
||||
@@ -210,8 +208,6 @@ VOID RaplDevicesUpdate(
|
||||
}
|
||||
|
||||
PhReleaseQueuedLockShared(&RaplDevicesListLock);
|
||||
|
||||
runCount++;
|
||||
}
|
||||
|
||||
VOID InitializeRaplDeviceId(
|
||||
|
||||
@@ -302,7 +302,7 @@ HWND PvpCreateControlButton(
|
||||
// Create the refresh button.
|
||||
GetClientRect(PropSheetWindow, &clientRect);
|
||||
GetWindowRect(GetDlgItem(PropSheetWindow, IDCANCEL), &rect);
|
||||
MapWindowPoints(NULL, PropSheetWindow, (POINT*)& rect, 2);
|
||||
MapWindowRect(NULL, PropSheetWindow, &rect);
|
||||
PropSheetContext->OptionsButtonWindowHandle = CreateWindowEx(
|
||||
WS_EX_NOPARENTNOTIFY,
|
||||
WC_BUTTON,
|
||||
|
||||
@@ -25,6 +25,7 @@ typedef struct _PV_PROPSHEETCONTEXT
|
||||
|
||||
WNDPROC OldOptionsButtonWndProc;
|
||||
HWND OptionsButtonWindowHandle;
|
||||
HWND OptionsSearchWindowHandle;
|
||||
PWSTR PositionSettingName;
|
||||
PWSTR SizeSettingName;
|
||||
} PV_PROPSHEETCONTEXT, *PPV_PROPSHEETCONTEXT;
|
||||
@@ -109,20 +110,33 @@ PvPropPageDlgProcHeader(
|
||||
)
|
||||
{
|
||||
LPPROPSHEETPAGE propSheetPage;
|
||||
PPV_PROPPAGECONTEXT propPageContext;
|
||||
|
||||
if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
// Save the context.
|
||||
PhSetWindowContext(hwndDlg, ULONG_MAX, (HANDLE)lParam);
|
||||
propSheetPage = (LPPROPSHEETPAGE)lParam;
|
||||
propPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
|
||||
PhSetWindowContext(hwndDlg, 0xfff, propSheetPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
propSheetPage = (LPPROPSHEETPAGE)PhGetWindowContext(hwndDlg, 0xfff);
|
||||
|
||||
if (!propSheetPage)
|
||||
return FALSE;
|
||||
|
||||
propPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
|
||||
if (uMsg == WM_NCDESTROY)
|
||||
{
|
||||
PhRemoveWindowContext(hwndDlg, 0xfff);
|
||||
}
|
||||
}
|
||||
|
||||
propSheetPage = PhGetWindowContext(hwndDlg, ULONG_MAX);
|
||||
|
||||
if (!propSheetPage)
|
||||
return FALSE;
|
||||
|
||||
*PropSheetPage = propSheetPage;
|
||||
*PropPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
*PropPageContext = propPageContext;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -36,11 +36,11 @@ BOOLEAN ProcessTreeFilterCallback(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!PhIsNullOrEmptyString(processNode->ProcessItem->FileNameWin32))
|
||||
{
|
||||
if (PhSearchControlMatch(SearchMatchHandle, &processNode->ProcessItem->FileNameWin32->sr))
|
||||
return TRUE;
|
||||
}
|
||||
//if (!PhIsNullOrEmptyString(processNode->ProcessItem->FileNameWin32))
|
||||
//{
|
||||
// if (PhSearchControlMatch(SearchMatchHandle, &processNode->ProcessItem->FileNameWin32->sr))
|
||||
// return TRUE;
|
||||
//}
|
||||
|
||||
if (!PhIsNullOrEmptyString(processNode->ProcessItem->FileName))
|
||||
{
|
||||
|
||||
@@ -225,7 +225,7 @@ BOOLEAN ToolbarAddGraph(
|
||||
PhAddItemSimpleHashtable(PhpToolbarGraphHashtable, Graph->GraphHandle, Graph);
|
||||
|
||||
if (!RebarBandExists(Graph->GraphId))
|
||||
RebarBandInsert(Graph->GraphId, Graph->GraphHandle, 145, RebarHeight); // height: 85
|
||||
RebarBandInsert(Graph->GraphId, Graph->GraphHandle, PhGetDpi(145, SystemInformer_GetWindowDpi()), RebarHeight); // height: 85
|
||||
|
||||
if (!IsWindowVisible(Graph->GraphHandle))
|
||||
ShowWindow(Graph->GraphHandle, SW_SHOW);
|
||||
|
||||
@@ -386,15 +386,12 @@ VOID NTAPI TabPageUpdatedCallback(
|
||||
}
|
||||
|
||||
VOID NTAPI LayoutPaddingCallback(
|
||||
_In_opt_ PVOID Parameter,
|
||||
_In_opt_ PVOID Context
|
||||
_In_ PVOID Parameter,
|
||||
_In_ PVOID Context
|
||||
)
|
||||
{
|
||||
PPH_LAYOUT_PADDING_DATA layoutPadding = Parameter;
|
||||
|
||||
if (!layoutPadding)
|
||||
return;
|
||||
|
||||
if (RebarHandle && ToolStatusConfig.ToolBarEnabled)
|
||||
{
|
||||
RECT rebarRect;
|
||||
|
||||
@@ -304,7 +304,7 @@ HWND PvpCreateOptionsButton(
|
||||
// Create the refresh button.
|
||||
GetClientRect(PropSheetWindow, &clientRect);
|
||||
GetWindowRect(GetDlgItem(PropSheetWindow, IDCANCEL), &rect);
|
||||
MapWindowPoints(NULL, PropSheetWindow, (POINT*)& rect, 2);
|
||||
MapWindowRect(NULL, PropSheetWindow, &rect);
|
||||
PropSheetContext->RefreshButtonWindowHandle = CreateWindowEx(
|
||||
WS_EX_NOPARENTNOTIFY,
|
||||
WC_BUTTON,
|
||||
|
||||
@@ -110,20 +110,33 @@ PvPropPageDlgProcHeader(
|
||||
)
|
||||
{
|
||||
LPPROPSHEETPAGE propSheetPage;
|
||||
PPV_PROPPAGECONTEXT propPageContext;
|
||||
|
||||
if (uMsg == WM_INITDIALOG)
|
||||
{
|
||||
// Save the context.
|
||||
PhSetWindowContext(hwndDlg, ULONG_MAX, (HANDLE)lParam);
|
||||
propSheetPage = (LPPROPSHEETPAGE)lParam;
|
||||
propPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
|
||||
PhSetWindowContext(hwndDlg, 0xfff, propSheetPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
propSheetPage = PhGetWindowContext(hwndDlg, 0xfff);
|
||||
|
||||
if (!propSheetPage)
|
||||
return FALSE;
|
||||
|
||||
propPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
|
||||
if (uMsg == WM_NCDESTROY)
|
||||
{
|
||||
PhRemoveWindowContext(hwndDlg, 0xfff);
|
||||
}
|
||||
}
|
||||
|
||||
propSheetPage = (LPPROPSHEETPAGE)PhGetWindowContext(hwndDlg, ULONG_MAX);
|
||||
|
||||
if (!propSheetPage)
|
||||
return FALSE;
|
||||
|
||||
*PropSheetPage = propSheetPage;
|
||||
*PropPageContext = (PPV_PROPPAGECONTEXT)propSheetPage->lParam;
|
||||
*PropPageContext = propPageContext;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <symprv.h>
|
||||
#include <mapldr.h>
|
||||
|
||||
#include <d3dkmthk.h>
|
||||
#include <shellapi.h>
|
||||
#include <propsys.h>
|
||||
#include <propvarutil.h>
|
||||
@@ -152,6 +153,15 @@ INT_PTR CALLBACK WepWindowPreviewDlgProc(
|
||||
|
||||
#define DEFINE_PAIR(Symbol) { TEXT(#Symbol), Symbol }
|
||||
|
||||
#define WS_EX_DRAGDETECT 0x00000002
|
||||
#define WS_EX_VISIBLEWHENOTGHOSTED 0x00000800
|
||||
#define WS_EX_FORCELEGACYRESIZENC 0x00800000
|
||||
#define WS_EX_UISTATEACTIVE 0x04000000
|
||||
#define WS_EX_REDIRECTED 0x20000000
|
||||
#define WS_EX_UISTATEACCELHIDDEN 0x40000000
|
||||
#define WS_EX_UISTATEFOCUSHIDDEN 0x80000000
|
||||
#define WS_EX_SETANSICREATOR 0x80000000
|
||||
|
||||
static STRING_INTEGER_PAIR WepStylePairs[] =
|
||||
{
|
||||
DEFINE_PAIR(WS_POPUP),
|
||||
@@ -177,6 +187,7 @@ static STRING_INTEGER_PAIR WepStylePairs[] =
|
||||
static STRING_INTEGER_PAIR WepExtendedStylePairs[] =
|
||||
{
|
||||
DEFINE_PAIR(WS_EX_DLGMODALFRAME), // 0x1
|
||||
DEFINE_PAIR(WS_EX_DRAGDETECT), // 0x2
|
||||
DEFINE_PAIR(WS_EX_NOPARENTNOTIFY), // 0x4
|
||||
DEFINE_PAIR(WS_EX_TOPMOST), // 0x8
|
||||
DEFINE_PAIR(WS_EX_ACCEPTFILES), // 0x10
|
||||
@@ -188,6 +199,7 @@ static STRING_INTEGER_PAIR WepExtendedStylePairs[] =
|
||||
DEFINE_PAIR(WS_EX_CLIENTEDGE), // 0x200
|
||||
DEFINE_PAIR(WS_EX_OVERLAPPEDWINDOW), // 0x300
|
||||
DEFINE_PAIR(WS_EX_CONTEXTHELP), // 0x400
|
||||
DEFINE_PAIR(WS_EX_VISIBLEWHENOTGHOSTED),// 0x800
|
||||
DEFINE_PAIR(WS_EX_RIGHT), // 0x1000
|
||||
DEFINE_PAIR(WS_EX_RTLREADING), // 0x2000
|
||||
DEFINE_PAIR(WS_EX_LEFTSCROLLBAR), // 0x4000
|
||||
@@ -198,8 +210,13 @@ static STRING_INTEGER_PAIR WepExtendedStylePairs[] =
|
||||
DEFINE_PAIR(WS_EX_NOINHERITLAYOUT), // 0x100000
|
||||
DEFINE_PAIR(WS_EX_NOREDIRECTIONBITMAP), // 0x200000
|
||||
DEFINE_PAIR(WS_EX_LAYOUTRTL), // 0x400000
|
||||
DEFINE_PAIR(WS_EX_FORCELEGACYRESIZENC), // 0x800000
|
||||
DEFINE_PAIR(WS_EX_COMPOSITED), // 0x2000000
|
||||
DEFINE_PAIR(WS_EX_UISTATEACTIVE), // 0x4000000
|
||||
DEFINE_PAIR(WS_EX_NOACTIVATE), // 0x8000000
|
||||
DEFINE_PAIR(WS_EX_REDIRECTED), // 0x20000000
|
||||
DEFINE_PAIR(WS_EX_UISTATEACCELHIDDEN), // 0x40000000
|
||||
DEFINE_PAIR(WS_EX_UISTATEFOCUSHIDDEN), // 0x80000000
|
||||
};
|
||||
|
||||
static STRING_INTEGER_PAIR WepClassStylePairs[] =
|
||||
@@ -260,29 +277,43 @@ BOOLEAN WeShowWindowProperties(
|
||||
)
|
||||
{
|
||||
PWINDOW_PROPERTIES_CONTEXT context;
|
||||
ULONG threadId;
|
||||
ULONG processId;
|
||||
NTSTATUS status;
|
||||
CLIENT_ID clientId;
|
||||
|
||||
if (!WeWindowItemType)
|
||||
{
|
||||
WeWindowItemType = PhCreateObjectType(L"WindowItemType", 0, WeWindowItemDeleteProcedure);
|
||||
}
|
||||
|
||||
if (!IsWindow(WindowHandle))
|
||||
{
|
||||
PhShowStatus(ParentWindowHandle, L"Unable to display window properties.", STATUS_GRAPHICS_PRESENT_INVALID_WINDOW, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
processId = 0;
|
||||
threadId = GetWindowThreadProcessId(WindowHandle, &processId);
|
||||
status = PhGetWindowClientId(WindowHandle, &clientId);
|
||||
|
||||
if (ClientId->UniqueProcess != UlongToHandle(processId))
|
||||
if (!NT_SUCCESS(status))
|
||||
{
|
||||
PhShowStatus(ParentWindowHandle, L"Unable to display window properties.", status, 0);
|
||||
return FALSE;
|
||||
if (ClientId->UniqueThread != UlongToHandle(threadId))
|
||||
}
|
||||
|
||||
if (
|
||||
ClientId->UniqueThread != clientId.UniqueThread ||
|
||||
ClientId->UniqueProcess != clientId.UniqueProcess
|
||||
)
|
||||
{
|
||||
PhShowStatus(ParentWindowHandle, L"Unable to display window properties.", STATUS_GRAPHICS_PRESENT_INVALID_WINDOW, 0);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
context = PhCreateObjectZero(sizeof(WINDOW_PROPERTIES_CONTEXT), WeWindowItemType);
|
||||
context->WindowHandle = WindowHandle;
|
||||
context->ParentWindowHandle = ParentWindowHandle;
|
||||
context->MessageOnlyWindow = MessageOnlyWindow;
|
||||
context->ClientId.UniqueProcess = UlongToHandle(processId);
|
||||
context->ClientId.UniqueThread = UlongToHandle(threadId);
|
||||
context->ClientId.UniqueProcess = clientId.UniqueProcess;
|
||||
context->ClientId.UniqueThread = clientId.UniqueThread;
|
||||
|
||||
PhInitializeInitOnce(&context->SymbolProviderInitOnce);
|
||||
InitializeListHead(&context->ResolveListHead);
|
||||
@@ -385,7 +416,7 @@ NTSTATUS WepResolveSymbolFunction(
|
||||
PostMessage(context->NotifyWindow, WEM_RESOLVE_DONE, 0, (LPARAM)context);
|
||||
|
||||
PhDereferenceObject(context->Context);
|
||||
|
||||
PhFree(context);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -992,7 +1023,7 @@ VOID WepRefreshWindowStyles(
|
||||
|
||||
for (i = 0; i < RTL_NUMBER_OF(WepExtendedStylePairs); i++)
|
||||
{
|
||||
if (FlagOn(windowInfo.dwExStyle, WepExtendedStylePairs[i].Integer))
|
||||
if (FlagOn(windowInfo.dwExStyle, WepExtendedStylePairs[i].Integer) == WepExtendedStylePairs[i].Integer)
|
||||
{
|
||||
PhAppendStringBuilder2(&styleExStringBuilder, WepExtendedStylePairs[i].String);
|
||||
PhAppendStringBuilder2(&styleExStringBuilder, L", ");
|
||||
@@ -1615,6 +1646,11 @@ INT_PTR CALLBACK WepWindowGeneralDlgProc(
|
||||
WepWindowRefreshGeneralPage(hwndDlg, context);
|
||||
}
|
||||
break;
|
||||
case WM_SIZE:
|
||||
{
|
||||
ExtendedListView_SetColumnWidth(context->ListViewHandle, 1, ELVSCW_AUTOSIZE_REMAININGSPACE);
|
||||
}
|
||||
break;
|
||||
case WM_CTLCOLORBTN:
|
||||
case WM_CTLCOLORDLG:
|
||||
case WM_CTLCOLORSTATIC:
|
||||
|
||||
@@ -231,12 +231,12 @@ PWE_WINDOW_NODE WeAddWindowNode(
|
||||
}
|
||||
else
|
||||
{
|
||||
ULONG processId = 0;
|
||||
CLIENT_ID clientId;
|
||||
PPH_PROCESS_ITEM processItem;
|
||||
|
||||
GetWindowThreadProcessId(WindowHandle, &processId);
|
||||
PhGetWindowClientId(WindowHandle, &clientId);
|
||||
|
||||
if (processId && (processItem = PhReferenceProcessItem(UlongToHandle(processId))))
|
||||
if (clientId.UniqueProcess && (processItem = PhReferenceProcessItem(clientId.UniqueProcess)))
|
||||
{
|
||||
windowNode->ProcessItem = processItem;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user