https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d1bb5332135c19216678…
commit 1d1bb5332135c192166783735cd35447ae699f0d
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Sun Aug 16 11:16:44 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Sun Aug 16 11:16:44 2020 +0900
[SHELL32] Fix regression #2703 CORE-17041 (trial) (#3046)
CORE-17041
---
dll/win32/shell32/folders/CDrivesFolder.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp
b/dll/win32/shell32/folders/CDrivesFolder.cpp
index d7246a459bb..a2f90d35f57 100644
--- a/dll/win32/shell32/folders/CDrivesFolder.cpp
+++ b/dll/win32/shell32/folders/CDrivesFolder.cpp
@@ -582,7 +582,7 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC
pbc, LPOLEST
HRESULT hr = E_INVALIDARG;
LPCWSTR szNext = NULL;
LPITEMIDLIST pidlTemp = NULL;
- WCHAR volumePathName[MAX_PATH];
+ INT nDriveNumber;
TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n", this,
hwndOwner, pbc, lpszDisplayName, debugstr_w (lpszDisplayName),
@@ -596,12 +596,12 @@ HRESULT WINAPI CDrivesFolder::ParseDisplayName(HWND hwndOwner, LPBC
pbc, LPOLEST
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':')
return m_regFolder->ParseDisplayName(hwndOwner, pbc, lpszDisplayName,
pchEaten, ppidl, pdwAttributes);
- if (PathGetDriveNumberW(lpszDisplayName) < 0)
+ nDriveNumber = PathGetDriveNumberW(lpszDisplayName);
+ if (nDriveNumber < 0)
return E_INVALIDARG;
/* check if this drive actually exists */
- if (!GetVolumePathNameW(lpszDisplayName, volumePathName, _countof(volumePathName))
||
- GetDriveTypeW(volumePathName) < DRIVE_REMOVABLE)
+ if ((::GetLogicalDrives() & (1 << nDriveNumber)) == 0)
{
return HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE);
}