https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d967b5aa251545644b80c…
commit d967b5aa251545644b80c68cbe3cef7ab8e3078b
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Dec 29 15:48:42 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Dec 29 16:14:26 2019 +0100
[BROWSEUI] Remove useless RegenerateUserEnvironment() call.
[SHELL32] Call RegenerateUserEnvironment() in WM_SETTINGCHANGE handler **ONLY** when
lParam points to the L"Environment" string.
CORE-15147
---
dll/win32/browseui/shellbrowser.cpp | 3 ---
dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp | 8 ++++++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp
index 04d9b583c3d..f1e93e0f2ff 100644
--- a/dll/win32/browseui/shellbrowser.cpp
+++ b/dll/win32/browseui/shellbrowser.cpp
@@ -3558,9 +3558,6 @@ LRESULT CShellBrowser::RelayMsgToShellView(UINT uMsg, WPARAM wParam,
LPARAM lPar
LRESULT CShellBrowser::OnSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
{
- LPVOID lpEnvironment;
- RegenerateUserEnvironment(&lpEnvironment, TRUE);
-
SHPropagateMessage(m_hWnd, uMsg, wParam, lParam, TRUE);
return 0;
}
diff --git a/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
b/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
index 934f53d17b9..610022a4b7b 100644
--- a/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
+++ b/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp
@@ -390,8 +390,12 @@ LRESULT CDesktopBrowser::OnSize(UINT uMsg, WPARAM wParam, LPARAM
lParam, BOOL &b
LRESULT CDesktopBrowser::OnSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
{
- LPVOID lpEnvironment;
- RegenerateUserEnvironment(&lpEnvironment, TRUE);
+ if (uMsg == WM_SETTINGCHANGE /* == WM_WININICHANGE */ &&
+ lstrcmpiW((LPCWSTR)lParam, L"Environment") == 0)
+ {
+ LPVOID lpEnvironment;
+ RegenerateUserEnvironment(&lpEnvironment, TRUE);
+ }
if (m_hWndShellView)
{