diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index fa1adab35f..f6196e7a39 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -2214,6 +2214,9 @@ static BOOL HACKISH_PathResolve( if (!Success) { ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); + + /* Print the error code */ + ERR("The error code for SearchPathW() is: %d\n", GetLastError()); } else { @@ -2226,6 +2229,9 @@ static BOOL HACKISH_PathResolve( { ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); + /* Print the error code */ + ERR("The error code for SearchPathW() is: %d\n", GetLastError()); + /* We failed, try with PathFindOnPath, as explained by MSDN */ // Success = PathFindOnPathW(pszPath, dirs); StringCchCopyW(szPath, _countof(szPath), pszPath); @@ -2234,17 +2240,28 @@ static BOOL HACKISH_PathResolve( { ERR("PathFindOnPathW(pszPath = '%S') failed\n", pszPath); + /* Print the error code */ + ERR("The error code for PathFindOnPathW() is: %d\n", GetLastError()); + /* We failed again, fall back to building a possible non-existing path */ if (!GetFullPathNameW(pszPath, _countof(szPath), szPath, &fname)) { ERR("GetFullPathNameW(pszPath = '%S') failed\n", pszPath); + + /* Print the error code */ + ERR("The error code for GetFullPathNameW() is: %d\n", GetLastError()); return FALSE; } Success = PathFileExistsW(szPath); if (!Success) + { ERR("PathFileExistsW(szPath = '%S') failed\n", szPath); + /* Print the error code */ + ERR("The error code for PathFileExistsW() is: %d\n", GetLastError()); + } + /******************************************************/ /* Question: Why this line is needed only for files?? */ if (fname && (_wcsicmp(pszPath, fname) == 0))