|
3 | 3 | * plugins
|
4 | 4 | *
|
5 | 5 | * Copyright (C) 2010-2011 wj32
|
6 |
| - * Copyright (C) 2017-2018 dmex |
| 6 | + * Copyright (C) 2017-2021 dmex |
7 | 7 | *
|
8 | 8 | * This file is part of Process Hacker.
|
9 | 9 | *
|
@@ -553,12 +553,12 @@ VOID InitializePluginsTree(
|
553 | 553 | _Inout_ PPH_PLUGMAN_CONTEXT Context
|
554 | 554 | )
|
555 | 555 | {
|
556 |
| - Context->NodeList = PhCreateList(100); |
| 556 | + Context->NodeList = PhCreateList(20); |
557 | 557 | Context->NodeHashtable = PhCreateHashtable(
|
558 | 558 | sizeof(PPH_PLUGIN_TREE_ROOT_NODE),
|
559 | 559 | PluginsNodeHashtableEqualFunction,
|
560 | 560 | PluginsNodeHashtableHashFunction,
|
561 |
| - 100 |
| 561 | + 20 |
562 | 562 | );
|
563 | 563 |
|
564 | 564 | Context->NormalFontHandle = PhCreateCommonFont(-10, FW_NORMAL, NULL);
|
@@ -625,24 +625,21 @@ PWSTR PhpGetPluginBaseName(
|
625 | 625 | }
|
626 | 626 | }
|
627 | 627 |
|
628 |
| -VOID PhpEnumerateLoadedPlugins( |
629 |
| - _In_ PPH_PLUGMAN_CONTEXT Context |
| 628 | +BOOLEAN NTAPI PhpEnumeratePluginCallback( |
| 629 | + _In_ PPH_PLUGIN Information, |
| 630 | + _In_opt_ PVOID Context |
630 | 631 | )
|
631 | 632 | {
|
632 |
| - PPH_AVL_LINKS links; |
633 |
| - |
634 |
| - for (links = PhMinimumElementAvlTree(&PhPluginsByName); links; links = PhSuccessorElementAvlTree(links)) |
635 |
| - { |
636 |
| - PPH_PLUGIN plugin = CONTAINING_RECORD(links, PH_PLUGIN, Links); |
637 |
| - PH_STRINGREF pluginBaseName; |
| 633 | + PH_STRINGREF pluginBaseName; |
638 | 634 |
|
639 |
| - PhInitializeStringRefLongHint(&pluginBaseName, PhpGetPluginBaseName(plugin)); |
| 635 | + PhInitializeStringRefLongHint(&pluginBaseName, PhpGetPluginBaseName(Information)); |
640 | 636 |
|
641 |
| - if (PhIsPluginDisabled(&pluginBaseName)) |
642 |
| - continue; |
643 |
| - |
644 |
| - AddPluginsNode(Context, plugin); |
| 637 | + if (!PhIsPluginDisabled(&pluginBaseName)) |
| 638 | + { |
| 639 | + AddPluginsNode(Context, Information); |
645 | 640 | }
|
| 641 | + |
| 642 | + return TRUE; |
646 | 643 | }
|
647 | 644 |
|
648 | 645 | INT_PTR CALLBACK PhPluginsDlgProc(
|
@@ -681,7 +678,7 @@ INT_PTR CALLBACK PhPluginsDlgProc(
|
681 | 678 | PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDC_INSTRUCTION), NULL, PH_ANCHOR_BOTTOM | PH_ANCHOR_LEFT);
|
682 | 679 | PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDC_DISABLED), NULL, PH_ANCHOR_BOTTOM | PH_ANCHOR_RIGHT);
|
683 | 680 |
|
684 |
| - PhpEnumerateLoadedPlugins(context); |
| 681 | + PhEnumeratePlugins(PhpEnumeratePluginCallback, context); |
685 | 682 | TreeNew_AutoSizeColumn(context->TreeNewHandle, PH_PLUGIN_TREE_COLUMN_ITEM_NAME, TN_AUTOSIZE_REMAINING_SPACE);
|
686 | 683 | PhSetWindowText(GetDlgItem(hwndDlg, IDC_DISABLED), PhaFormatString(L"Disabled Plugins (%lu)", PhpDisabledPluginsCount())->Buffer);
|
687 | 684 |
|
@@ -713,7 +710,7 @@ INT_PTR CALLBACK PhPluginsDlgProc(
|
713 | 710 | );
|
714 | 711 |
|
715 | 712 | ClearPluginsTree(context);
|
716 |
| - PhpEnumerateLoadedPlugins(context); |
| 713 | + PhEnumeratePlugins(PhpEnumeratePluginCallback, context); |
717 | 714 | TreeNew_AutoSizeColumn(context->TreeNewHandle, PH_PLUGIN_TREE_COLUMN_ITEM_NAME, TN_AUTOSIZE_REMAINING_SPACE);
|
718 | 715 | PhSetWindowText(GetDlgItem(hwndDlg, IDC_DISABLED), PhaFormatString(L"Disabled Plugins (%lu)", PhpDisabledPluginsCount())->Buffer);
|
719 | 716 | }
|
|
0 commit comments