https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d02cb099c8f568497e075…
commit d02cb099c8f568497e075eda094a334bf1c3a532
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Sat Jul 22 05:24:25 2023 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Jul 22 13:24:25 2023 +0300
[SHELL32] Fix condition check for GetDisplayNameOf() return value (#5444)
This fixes 'Attempt to free an invalid HEAP address' error. CORE-18841
Confirmed by running new tests written by Mark Jansen, showing that
previous behavior was wrong. While here, also fix a typographical error.
---
dll/win32/shell32/droptargets/CFSDropTarget.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
index 19438fa51dd..7dff8fb3885 100644
--- a/dll/win32/shell32/droptargets/CFSDropTarget.cpp
+++ b/dll/win32/shell32/droptargets/CFSDropTarget.cpp
@@ -74,7 +74,7 @@ HRESULT CFSDropTarget::_CopyItems(IShellFolder * pSFFrom, UINT cidl,
STRRET strretFrom;
hr = pSFFrom->GetDisplayNameOf(NULL, SHGDN_FORPARSING, &strretFrom);
- if (FAILED_UNEXPECTEDLY(hr))
+ if (hr != S_OK)
return hr;
pszSrcList = BuildPathsList(strretFrom.pOleStr, cidl, apidl);