https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5734570a1514a0068950d…
commit 5734570a1514a0068950d1fef98b844e0d034c0b
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Fri Nov 29 15:14:18 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Fri Nov 29 15:14:18 2019 +0900
[BOOT][SHELL32][INCLUDE] Support 'SuperHidden' files (#2102)
PR #2101 shows desktop.ini files on Desktop. I want to hide them.
- Add "ShowSuperHidden" setting to Explorer.
- Add SHCONTF_INCLUDESUPERHIDDEN flag.
- Support SHCONTF_INCLUDESUPERHIDDEN in Explorer.
CORE-10045
---
boot/bootdata/hivedef.inf | 1 +
dll/win32/shell32/CDefView.cpp | 39 ++++++++++++++++++---------------
dll/win32/shell32/folders/CFSFolder.cpp | 10 +++++++--
sdk/include/psdk/shobjidl.idl | 7 +++++-
4 files changed, 36 insertions(+), 21 deletions(-)
diff --git a/boot/bootdata/hivedef.inf b/boot/bootdata/hivedef.inf
index 8346f145159..49c7b8bd11e 100644
--- a/boot/bootdata/hivedef.inf
+++ b/boot/bootdata/hivedef.inf
@@ -1892,6 +1892,7 @@
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ListviewShad
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","HideFileExt",0x00010003,0x00000000
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","StartMenuLogoff",0x00010003,0x00000001
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","Hidden",0x00010003,1
+HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced","ShowSuperHidden",0x00010003,0
; ComDlg32
HKCU,"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32",,0x00000012
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 9dc6bc98110..608ada85bf4 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -908,29 +908,32 @@ HRESULT CDefView::FillList()
DWORD dwFetched;
HRESULT hRes;
HDPA hdpa;
- HKEY hKey;
DWORD dFlags = SHCONTF_NONFOLDERS | SHCONTF_FOLDERS;
+ DWORD dwValue, cbValue;
TRACE("%p\n", this);
/* determine if there is a setting to show all the hidden files/folders */
- if (RegOpenKeyExW(HKEY_CURRENT_USER,
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", 0,
KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
- {
- DWORD dataLength, flagVal;
-
- dataLength = sizeof(flagVal);
- if (RegQueryValueExW(hKey, L"Hidden", NULL, NULL, (LPBYTE)&flagVal,
&dataLength) == ERROR_SUCCESS)
- {
- /* if the value is 1, then show all hidden files/folders */
- if (flagVal == 1)
- {
- dFlags |= SHCONTF_INCLUDEHIDDEN;
- m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
- }
- }
-
- /* close the key */
- RegCloseKey(hKey);
+ dwValue = 1;
+ cbValue = sizeof(dwValue);
+ SHGetValueW(HKEY_CURRENT_USER,
+
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ L"Hidden", NULL, &dwValue, &cbValue);
+ if (dwValue == 1)
+ {
+ dFlags |= SHCONTF_INCLUDEHIDDEN;
+ m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
+ }
+
+ dwValue = 0;
+ cbValue = sizeof(dwValue);
+ SHGetValueW(HKEY_CURRENT_USER,
+
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
+ L"ShowSuperHidden", NULL, &dwValue, &cbValue);
+ if (dwValue)
+ {
+ dFlags |= SHCONTF_INCLUDESUPERHIDDEN;
+ m_ListView.SendMessageW(LVM_SETCALLBACKMASK, LVIS_CUT, 0);
}
/* get the itemlist from the shfolder */
diff --git a/dll/win32/shell32/folders/CFSFolder.cpp
b/dll/win32/shell32/folders/CFSFolder.cpp
index 493eeeafa49..d0aee2faccf 100644
--- a/dll/win32/shell32/folders/CFSFolder.cpp
+++ b/dll/win32/shell32/folders/CFSFolder.cpp
@@ -391,10 +391,16 @@ HRESULT WINAPI CFileSysEnum::Initialize(LPWSTR lpszPath, DWORD
dwFlags)
{
BOOL findFinished = FALSE;
+#define HIDDEN FILE_ATTRIBUTE_HIDDEN
+#define SUPER_HIDDEN (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM)
+
do
{
- if ( !(stffile.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
- || (dwFlags & SHCONTF_INCLUDEHIDDEN) )
+ if ((stffile.dwFileAttributes & HIDDEN) == 0 ||
+ ((dwFlags & SHCONTF_INCLUDEHIDDEN) &&
+ (stffile.dwFileAttributes & SUPER_HIDDEN) == HIDDEN) ||
+ ((dwFlags & SHCONTF_INCLUDESUPERHIDDEN) &&
+ (stffile.dwFileAttributes & SUPER_HIDDEN) == SUPER_HIDDEN))
{
LPITEMIDLIST pidl = NULL;
diff --git a/sdk/include/psdk/shobjidl.idl b/sdk/include/psdk/shobjidl.idl
index 1fa2e3940b5..a94f1a9f4c6 100644
--- a/sdk/include/psdk/shobjidl.idl
+++ b/sdk/include/psdk/shobjidl.idl
@@ -176,7 +176,12 @@ interface IShellFolder : IUnknown
SHCONTF_INIT_ON_FIRST_NEXT = 256,
SHCONTF_NETPRINTERSRCH = 512,
SHCONTF_SHAREABLE = 1024,
- SHCONTF_STORAGE = 2048
+ SHCONTF_STORAGE = 2048,
+ SHCONTF_NAVIGATION_ENUM = 0x01000,
+ SHCONTF_FASTITEMS = 0x02000,
+ SHCONTF_FLATLIST = 0x04000,
+ SHCONTF_ENABLE_ASYNC = 0x08000,
+ SHCONTF_INCLUDESUPERHIDDEN = 0x10000
};
typedef DWORD SHCONTF;