Author: gadamopoulos Date: Thu Sep 22 16:22:44 2016 New Revision: 72771 URL: http://svn.reactos.org/svn/reactos?rev=72771&view=rev Log: [SHELL32] - Handle failure in SHELL32_CompareDetails.
Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp Modified: trunk/reactos/dll/win32/shell32/shlfolder.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shlfolder.cpp?rev=72771&r1=72770&r2=72771&view=diff ============================================================================== --- trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] (original) +++ trunk/reactos/dll/win32/shell32/shlfolder.cpp [iso-8859-1] Thu Sep 22 16:22:44 2016 @@ -439,11 +439,24 @@ { SHELLDETAILS sd; WCHAR wszItem1[MAX_PATH], wszItem2[MAX_PATH]; - - isf->GetDetailsOf(pidl1, lParam, &sd); - StrRetToBufW(&sd.str, pidl1, wszItem1, MAX_PATH); - isf->GetDetailsOf(pidl2, lParam, &sd); - StrRetToBufW(&sd.str, pidl2, wszItem2, MAX_PATH); + HRESULT hres; + + hres = isf->GetDetailsOf(pidl1, lParam, &sd); + if (FAILED(hres)) + return MAKE_COMPARE_HRESULT(1); + + hres = StrRetToBufW(&sd.str, pidl1, wszItem1, MAX_PATH); + if (FAILED(hres)) + return MAKE_COMPARE_HRESULT(1); + + hres = isf->GetDetailsOf(pidl2, lParam, &sd); + if (FAILED(hres)) + return MAKE_COMPARE_HRESULT(1); + + hres = StrRetToBufW(&sd.str, pidl2, wszItem2, MAX_PATH); + if (FAILED(hres)) + return MAKE_COMPARE_HRESULT(1); + int ret = wcsicmp(wszItem1, wszItem2); return MAKE_COMPARE_HRESULT(ret);