58 _In_opt_ PVOID Parameter1,
59 _In_opt_ PVOID Parameter2,
60 _In_opt_ PVOID Context
64 _In_ HWND ParentWindowHandle,
65 _In_ HWND TreeNewHandle,
72 Context->EnableStateHighlighting =
TRUE;
82 Context->ParentWindowHandle = ParentWindowHandle;
83 Context->TreeNewHandle = TreeNewHandle;
125 if (Context->BoldFont)
126 DeleteObject(Context->BoldFont);
130 for (i = 0; i < Context->NodeList->Count; i++)
176 settings =
PhCmSaveSettingsEx(Context->TreeNewHandle, &Context->Cm, 0, &sortSettings);
195 if (Context->EnableStateHighlighting && RunId != 1)
200 &Context->NodeStateList,
236 Context->NodeHashtable,
254 if (Context->EnableStateHighlighting)
258 &ModuleNode->ShState,
259 &Context->NodeStateList,
262 Context->TreeNewHandle
297 if ((index = PhFindItemList(Context->NodeList, ModuleNode)) != -1)
313 ModuleNode->ValidMask = 0;
325 #define SORT_FUNCTION(Column) PhpModuleTreeNewCompare##Column
327 #define BEGIN_SORT_FUNCTION(Column) static int __cdecl PhpModuleTreeNewCompare##Column( \
328 _In_ void *_context, \
329 _In_ const void *_elem1, \
330 _In_ const void *_elem2 \
333 PPH_MODULE_NODE node1 = *(PPH_MODULE_NODE *)_elem1; \
334 PPH_MODULE_NODE node2 = *(PPH_MODULE_NODE *)_elem2; \
335 PPH_MODULE_ITEM moduleItem1 = node1->ModuleItem; \
336 PPH_MODULE_ITEM moduleItem2 = node2->ModuleItem; \
339 #define END_SORT_FUNCTION \
340 if (sortResult == 0) \
341 sortResult = uintptrcmp((ULONG_PTR)moduleItem1->BaseAddress, (ULONG_PTR)moduleItem2->BaseAddress); \
343 return PhModifySort(sortResult, ((PPH_MODULE_LIST_CONTEXT)_context)->TreeNewSortOrder); \
361 if (moduleItem1->IsFirst)
365 else if (moduleItem2->IsFirst)
384 sortResult =
uintptrcmp((ULONG_PTR)moduleItem1->BaseAddress, (ULONG_PTR)moduleItem2->BaseAddress);
390 sortResult =
uintcmp(moduleItem1->Size, moduleItem2->Size);
420 sortResult =
uintcmp(moduleItem1->Type, moduleItem2->Type);
426 sortResult =
uintcmp(moduleItem1->LoadCount, moduleItem2->LoadCount);
432 sortResult =
intcmp(moduleItem1->VerifyResult, moduleItem2->VerifyResult);
439 moduleItem1->VerifySignerName,
440 moduleItem2->VerifySignerName,
449 moduleItem1->ImageDllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE,
450 moduleItem2->ImageDllCharacteristics & IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE
457 sortResult =
uintcmp(moduleItem1->ImageTimeDateStamp, moduleItem2->ImageTimeDateStamp);
464 moduleItem1->ImageDllCharacteristics & IMAGE_DLLCHARACTERISTICS_GUARD_CF,
465 moduleItem2->ImageDllCharacteristics & IMAGE_DLLCHARACTERISTICS_GUARD_CF
472 sortResult =
uint64cmp(moduleItem1->LoadTime.QuadPart, moduleItem2->LoadTime.QuadPart);
478 sortResult =
uintcmp(moduleItem1->LoadReason, moduleItem2->LoadReason);
485 _In_opt_ PVOID Parameter1,
486 _In_opt_ PVOID Parameter2,
487 _In_opt_ PVOID Context
504 if (!getChildren->
Node)
506 static PVOID sortFunctions[] =
525 int (__cdecl *sortFunction)(
void *,
const void *,
const void *);
577 switch (getCellText->
Id)
606 switch (moduleItem->
Type)
612 typeString = L
"Mapped File";
615 typeString = L
"Mapped Image";
618 typeString = L
"WOW64 DLL";
621 typeString = L
"Kernel Module";
624 typeString = L
"Unknown";
679 SYSTEMTIME systemTime;
707 SYSTEMTIME systemTime;
709 if (moduleItem->
LoadTime.QuadPart != 0)
729 case LoadReasonStaticDependency:
730 string = L
"Static Dependency";
732 case LoadReasonStaticForwarderDependency:
733 string = L
"Static Forwarder Dependency";
735 case LoadReasonDynamicForwarderDependency:
736 string = L
"Dynamic Forwarder Dependency";
738 case LoadReasonDelayloadDependency:
739 string = L
"Delay Load Dependency";
741 case LoadReasonDynamicLoad:
744 case LoadReasonAsImageLoad:
745 string = L
"As Image";
747 case LoadReasonAsDataLoad:
813 if (getCellTooltip->
Column->
Id != 0)
834 getCellTooltip->
Font = NULL;
857 if (GetKeyState(VK_CONTROL) < 0)
861 if (GetKeyState(VK_CONTROL) < 0)
865 if (GetKeyState(VK_CONTROL) < 0)
872 if (GetKeyState(VK_CONTROL) >= 0)
910 PULONG code = Parameter2;
912 if (PtrToUlong(Parameter1) == VK_RETURN)
914 *code = DLGC_WANTMESSAGE;
931 for (i = 0; i < Context->NodeList->Count; i++)
948 _Out_ PULONG NumberOfModules
956 for (i = 0; i < Context->NodeList->Count; i++)
967 *NumberOfModules = list->
Count;