Skip to content

Commit e51e5de

Browse files
[EXPLORER] Remove redundant bIsSystemShell assignments (reactos#7542)
Addendum to commit df197bc (PR reactos#7502) CORE-19887
1 parent 76014b9 commit e51e5de

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

base/shell/explorer/explorer.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,9 @@ IsExplorerSystemShell()
9999
LPWSTR szExplorer = PathFindFileNameW(szPath);
100100

101101
HKEY hKeyWinlogon;
102-
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
103-
0, KEY_READ, &hKeyWinlogon) != ERROR_SUCCESS)
104-
{
105-
// No registry access.
106-
bIsSystemShell = TRUE;
107-
}
108-
else
102+
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
103+
L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
104+
0, KEY_READ, &hKeyWinlogon) == ERROR_SUCCESS)
109105
{
110106
LSTATUS Status;
111107
DWORD dwType;
@@ -116,9 +112,7 @@ IsExplorerSystemShell()
116112
Status = RegQueryValueExW(hKeyWinlogon, L"Shell", 0, &dwType, (LPBYTE)szShell, &cbShell);
117113
if (Status == ERROR_SUCCESS)
118114
{
119-
if ((dwType == REG_SZ || dwType == REG_EXPAND_SZ) && StrStrI(szShell, szExplorer))
120-
bIsSystemShell = TRUE;
121-
else
115+
if ((dwType != REG_SZ && dwType != REG_EXPAND_SZ) || !StrStrIW(szShell, szExplorer))
122116
bIsSystemShell = FALSE;
123117
}
124118

0 commit comments

Comments
 (0)