https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8ec358012399211af607c…
commit 8ec358012399211af607c71f15f914da005601fa
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Mon Jun 28 02:02:17 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Jun 28 02:19:30 2021 +0200
[SHELL32] Add the handy WHICH_DEFAULT value to the list of flags in shlwapi_undoc.h.
- Add as well the undocumented 0x40 dwFlags value from
shlwapi!PathFileExistsDefExtW()
to the list.
- Fix a bug (also present in Win2k3) in PathResolveW() where, specifying
the PRF_DONTFINDLNK flag, would also erroneously exclude checking for
the .cmd extension as well (which was obviously NOT the original
intention, from the name of the flag and the documentation as well:
https://docs.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_co…
).
Addendum to 3a822e4f.
---
dll/win32/shell32/wine/shellpath.c | 7 ++-----
sdk/include/reactos/shlwapi_undoc.h | 15 +++++++++------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c
index e4234efffcd..b0978280008 100644
--- a/dll/win32/shell32/wine/shellpath.c
+++ b/dll/win32/shell32/wine/shellpath.c
@@ -635,14 +635,11 @@ BOOL WINAPI PathResolveA(LPSTR path, LPCSTR *dirs, DWORD flags)
return FALSE;
}
-#define WHICH_DONTFINDLNK (WHICH_PIF | WHICH_COM | WHICH_EXE | WHICH_BAT)
-#define WHICH_DEFAULT (WHICH_DONTFINDLNK | WHICH_LNK | WHICH_CMD)
-
BOOL WINAPI PathResolveW(LPWSTR path, LPCWSTR *dirs, DWORD flags)
{
- DWORD dwWhich;
+ DWORD dwWhich = ((flags & PRF_DONTFINDLNK) ? (WHICH_DEFAULT & ~WHICH_LNK) :
WHICH_DEFAULT);
+
TRACE("PathResolveW(%s,%p,0x%08x)\n", debugstr_w(path), dirs, flags);
- dwWhich = ((flags & PRF_DONTFINDLNK) ? WHICH_DONTFINDLNK : WHICH_DEFAULT);
if (flags & PRF_VERIFYEXISTS)
SetLastError(ERROR_FILE_NOT_FOUND);
diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h
index ed54a70c686..b94577f8638 100644
--- a/sdk/include/reactos/shlwapi_undoc.h
+++ b/sdk/include/reactos/shlwapi_undoc.h
@@ -151,12 +151,15 @@ ShellMessageBoxWrapW(
...);
/* dwWhich flags for PathFileExistsDefExtW and PathFindOnPathExW */
-#define WHICH_PIF (1 << 0)
-#define WHICH_COM (1 << 1)
-#define WHICH_EXE (1 << 2)
-#define WHICH_BAT (1 << 3)
-#define WHICH_LNK (1 << 4)
-#define WHICH_CMD (1 << 5)
+#define WHICH_PIF (1 << 0)
+#define WHICH_COM (1 << 1)
+#define WHICH_EXE (1 << 2)
+#define WHICH_BAT (1 << 3)
+#define WHICH_LNK (1 << 4)
+#define WHICH_CMD (1 << 5)
+#define WHICH_OPTIONAL (1 << 6)
+
+#define WHICH_DEFAULT (WHICH_PIF | WHICH_COM | WHICH_EXE | WHICH_BAT | WHICH_LNK |
WHICH_CMD)
BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich);
BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich);