[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_core-pathresolve
  ).

Addendum to 3a822e4f.
This commit is contained in:
Hermès Bélusca-Maïto 2021-06-28 02:02:17 +02:00
parent 3249a00364
commit 8ec3580123
2 changed files with 11 additions and 11 deletions

View file

@ -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);

View file

@ -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);