diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index fa1adab35f..7c75ca803b 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -2185,6 +2185,7 @@ static BOOL HACKISH_PathResolve( USHORT i; LPWSTR fname = NULL; WCHAR szPath[MAX_PATH]; + DWORD LastError; /* First, search for a valid existing path */ @@ -2214,6 +2215,8 @@ static BOOL HACKISH_PathResolve( if (!Success) { ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); + LastError = GetLastError(); + ERR("The error code for SearchPathW() is: %lu\n", LastError); } else { @@ -2225,6 +2228,8 @@ static BOOL HACKISH_PathResolve( if (!Success) { ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); + LastError = GetLastError(); + ERR("The error code for SearchPathW() is: %lu\n", LastError); /* We failed, try with PathFindOnPath, as explained by MSDN */ // Success = PathFindOnPathW(pszPath, dirs); @@ -2233,17 +2238,23 @@ static BOOL HACKISH_PathResolve( if (!Success) { ERR("PathFindOnPathW(pszPath = '%S') failed\n", pszPath); + LastError = GetLastError(); + ERR("The error code for PathFindOnPathW() is: %lu\n", LastError); /* 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); + LastError = GetLastError(); + ERR("The error code for GetFullPathNameW() is: %lu\n", LastError); return FALSE; } Success = PathFileExistsW(szPath); if (!Success) ERR("PathFileExistsW(szPath = '%S') failed\n", szPath); + LastError = GetLastError(); + ERR("The error code for PathFileExistsW() is: %lu\n", LastError); /******************************************************/ /* Question: Why this line is needed only for files?? */