diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 6ec496f6510..a3f95744afb 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -1259,7 +1259,7 @@ BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath) DWORD dwAttributes; STRRET strret; - TRACE_(shell)("(pidl=%p,%p)\n", pidl, debugstr_w(pszPath)); + TRACE_(shell)("(pidl=%p,%p)\n", pidl, pszPath); pdump(pidl); if (!pidl) diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index c0d7f876fe1..7780adc92c0 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -701,6 +701,7 @@ static BOOL UNIXFS_path_to_pidl(UnixFolder *pUnixFolder, const WCHAR *path, LPIT if (!pNextPathElement) { SHFree(*ppidl); + *ppidl = NULL; return FALSE; } pidl = ILGetNext(pidl); @@ -1753,7 +1754,7 @@ static HRESULT WINAPI UnixFolder_ISFHelper_AddFolder(ISFHelper* iface, HWND hwnd ILFree(pidlRelative); SHChangeNotify(SHCNE_MKDIR, SHCNF_IDLIST, pidlAbsolute, NULL); ILFree(pidlAbsolute); - } + } else return E_FAIL; return S_OK; } } diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 14739d6d880..f5b1e88c127 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -597,6 +597,11 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, filetype[filetypelen] = '\0'; TRACE("File type: %s\n", debugstr_w(filetype)); } + else + { + *filetype = '\0'; + filetypelen = 0; + } } if (*filetype) diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 7d45ef39664..384d9148885 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -43,23 +43,24 @@ static const WCHAR notafile[]= { 'C',':','\\','n','o','n','e','x','i','s','t','e * SHSimpleIDListFromPathA does not work on NT4. But if we call both we * get what we want on all platforms. */ -static LPITEMIDLIST (WINAPI *pSHSimpleIDListFromPathA)(LPCSTR)=NULL; +static LPITEMIDLIST (WINAPI *pSHSimpleIDListFromPathAW)(LPCVOID); static LPITEMIDLIST path_to_pidl(const char* path) { LPITEMIDLIST pidl; - if (!pSHSimpleIDListFromPathA) + if (!pSHSimpleIDListFromPathAW) { HMODULE hdll=LoadLibraryA("shell32.dll"); - pSHSimpleIDListFromPathA=(void*)GetProcAddress(hdll, (char*)162); - if (!pSHSimpleIDListFromPathA) - trace("SHSimpleIDListFromPathA not found in shell32.dll\n"); + pSHSimpleIDListFromPathAW=(void*)GetProcAddress(hdll, (char*)162); + if (!pSHSimpleIDListFromPathAW) + trace("SHSimpleIDListFromPathAW not found in shell32.dll\n"); } pidl=NULL; - if (pSHSimpleIDListFromPathA) - pidl=pSHSimpleIDListFromPathA(path); + /* pSHSimpleIDListFromPathAW maps to A on non NT platforms */ + if (pSHSimpleIDListFromPathAW && (GetVersion() & 0x80000000)) + pidl=pSHSimpleIDListFromPathAW(path); if (!pidl) { diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 93c7fe8a135..bf9abf9caef 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -506,9 +506,12 @@ int WINAPI PathGetDriveNumberW(LPCWSTR lpszPath) { TRACE ("(%s)\n",debugstr_w(lpszPath)); - if (lpszPath && lpszPath[1] == ':' && - tolowerW(*lpszPath) >= 'a' && tolowerW(*lpszPath) <= 'z') - return tolowerW(*lpszPath) - 'a'; + if (lpszPath) + { + WCHAR tl = tolowerW(lpszPath[0]); + if (tl >= 'a' && tl <= 'z' && lpszPath[1] == ':') + return tl - 'a'; + } return -1; }