[SHELL32] Print out the error code (#973)

When SearchPathW, GetFullPathNameW and PathFileExistsW fail, output the error code.
This commit is contained in:
Bișoc George 2018-11-16 23:09:15 +01:00 committed by Hermès BÉLUSCA - MAÏTO
parent 3d48aa2992
commit c00bafaad9

View file

@ -2213,7 +2213,7 @@ static BOOL HACKISH_PathResolve(
_countof(szPath), szPath, NULL) != 0); _countof(szPath), szPath, NULL) != 0);
if (!Success) if (!Success)
{ {
ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); ERR("SearchPathW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError());
} }
else else
{ {
@ -2224,7 +2224,7 @@ static BOOL HACKISH_PathResolve(
if (!Success) if (!Success)
{ {
ERR("SearchPathW(pszPath = '%S') failed\n", pszPath); ERR("SearchPathW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError());
/* We failed, try with PathFindOnPath, as explained by MSDN */ /* We failed, try with PathFindOnPath, as explained by MSDN */
// Success = PathFindOnPathW(pszPath, dirs); // Success = PathFindOnPathW(pszPath, dirs);
@ -2237,13 +2237,13 @@ static BOOL HACKISH_PathResolve(
/* We failed again, fall back to building a possible non-existing path */ /* We failed again, fall back to building a possible non-existing path */
if (!GetFullPathNameW(pszPath, _countof(szPath), szPath, &fname)) if (!GetFullPathNameW(pszPath, _countof(szPath), szPath, &fname))
{ {
ERR("GetFullPathNameW(pszPath = '%S') failed\n", pszPath); ERR("GetFullPathNameW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError());
return FALSE; return FALSE;
} }
Success = PathFileExistsW(szPath); Success = PathFileExistsW(szPath);
if (!Success) if (!Success)
ERR("PathFileExistsW(szPath = '%S') failed\n", szPath); ERR("PathFileExistsW(szPath = '%S') failed. Error code: %lu\n", szPath, GetLastError());
/******************************************************/ /******************************************************/
/* Question: Why this line is needed only for files?? */ /* Question: Why this line is needed only for files?? */