Index: shlwapi/path.c =================================================================== --- shlwapi/path.c (revision 47213) +++ shlwapi/path.c (working copy) @@ -2532,9 +2532,9 @@ * FALSE If lpszPath or lpszExtension are invalid, lpszPath has an * extension already, or the new path length is too big. * - * FIXME - * What version of shlwapi.dll adds "exe" if lpszExtension is NULL? Win2k - * does not do this, so the behaviour was removed. + * NOTE + * PathAddExtension on WinXP SP3 and WinMe add ".exe" to lpszPath + * if lpszExtension == NULL. Win2k is old. */ BOOL WINAPI PathAddExtensionA(LPSTR lpszPath, LPCSTR lpszExtension) { @@ -2542,9 +2542,12 @@ TRACE("(%s,%s)\n", debugstr_a(lpszPath), debugstr_a(lpszExtension)); - if (!lpszPath || !lpszExtension || *(PathFindExtensionA(lpszPath))) + if (!lpszPath || *(PathFindExtensionA(lpszPath))) return FALSE; + if (!lpszExtension) + lpszExtension = ".exe"; + dwLen = strlen(lpszPath); if (dwLen + strlen(lpszExtension) >= MAX_PATH) @@ -2565,9 +2568,12 @@ TRACE("(%s,%s)\n", debugstr_w(lpszPath), debugstr_w(lpszExtension)); - if (!lpszPath || !lpszExtension || *(PathFindExtensionW(lpszPath))) + if (!lpszPath || *(PathFindExtensionW(lpszPath))) return FALSE; + if (!lpszExtension) + lpszExtension = L".exe"; + dwLen = strlenW(lpszPath); if (dwLen + strlenW(lpszExtension) >= MAX_PATH)