Skip to content

Commit c40d92d

Browse files
committed
Improve process environment enumeration
1 parent f7e3457 commit c40d92d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

ProcessHacker/prpgenv.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Process properties: Environment page
44
*
55
* Copyright (C) 2009-2016 wj32
6-
* Copyright (C) 2018-2020 dmex
6+
* Copyright (C) 2018-2021 dmex
77
*
88
* This file is part of Process Hacker.
99
*
@@ -176,7 +176,6 @@ VOID PhpSetEnvironmentListStatusMessage(
176176
}
177177

178178
VOID PhpRefreshEnvironmentList(
179-
_In_ HWND hwndDlg,
180179
_Inout_ PPH_ENVIRONMENT_CONTEXT Context,
181180
_In_ PPH_PROCESS_ITEM ProcessItem
182181
)
@@ -617,7 +616,7 @@ VOID PhpShowEnvironmentNodeContextMenu(
617616
&refresh
618617
) == IDOK && refresh)
619618
{
620-
PhpRefreshEnvironmentList(Context->WindowHandle, Context, Context->ProcessItem);
619+
PhpRefreshEnvironmentList(Context, Context->ProcessItem);
621620
}
622621
}
623622
break;
@@ -656,7 +655,7 @@ VOID PhpShowEnvironmentNodeContextMenu(
656655
);
657656
NtClose(processHandle);
658657

659-
PhpRefreshEnvironmentList(Context->WindowHandle, Context, Context->ProcessItem);
658+
PhpRefreshEnvironmentList(Context, Context->ProcessItem);
660659

661660
if (status == STATUS_TIMEOUT)
662661
{
@@ -1361,7 +1360,7 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
13611360
TreeNew_SetEmptyText(context->TreeNewHandle, &context->StatusMessage->sr, 0);
13621361
PhLoadSettingsEnvironmentList(context);
13631362

1364-
PhpRefreshEnvironmentList(hwndDlg, context, processItem);
1363+
PhpRefreshEnvironmentList(context, processItem);
13651364

13661365
PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
13671366
}
@@ -1496,7 +1495,7 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
14961495

14971496
if (PhpShowEditEnvDialog(hwndDlg, processItem, L"", NULL, &refresh) == IDOK && refresh)
14981497
{
1499-
PhpRefreshEnvironmentList(hwndDlg, context, processItem);
1498+
PhpRefreshEnvironmentList(context, processItem);
15001499
}
15011500
}
15021501
else
@@ -1512,7 +1511,7 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
15121511
break;
15131512
case IDC_REFRESH:
15141513
{
1515-
PhpRefreshEnvironmentList(hwndDlg, context, processItem);
1514+
PhpRefreshEnvironmentList(context, processItem);
15161515
}
15171516
break;
15181517
case WM_PH_SET_LIST_VIEW_SETTINGS: // HACK
@@ -1531,7 +1530,7 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
15311530
&refresh
15321531
) == IDOK && refresh)
15331532
{
1534-
PhpRefreshEnvironmentList(hwndDlg, context, context->ProcessItem);
1533+
PhpRefreshEnvironmentList(context, context->ProcessItem);
15351534
}
15361535
}
15371536
break;
@@ -1545,7 +1544,7 @@ INT_PTR CALLBACK PhpProcessEnvironmentDlgProc(
15451544
switch (header->code)
15461545
{
15471546
case PSN_QUERYINITIALFOCUS:
1548-
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LPARAM)GetDlgItem(hwndDlg, IDC_REFRESH));
1547+
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, (LPARAM)context->TreeNewHandle);
15491548
return TRUE;
15501549
}
15511550
}

0 commit comments

Comments
 (0)