diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index a08e18faa35..676528ab0e7 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -335,6 +335,32 @@ LPITEMIDLIST WINAPI ILCreateFromPath(LPVOID path) } return pidlnew; } +/************************************************************************* + * SHSimpleIDListFromPath [SHELL32.162] + * + */ +LPITEMIDLIST WINAPI SHSimpleIDListFromPath32AW (LPVOID lpszPath) +{ LPCSTR lpszElement; + char lpszTemp[MAX_PATH]; + + if (!lpszPath) + return 0; + + if ( VERSION_OsIsUnicode()) + { TRACE(pidl,"(path=L%s)\n",debugstr_w((LPWSTR)lpszPath)); + WideCharToLocal32(lpszTemp, lpszPath, MAX_PATH); + } + else + { TRACE(pidl,"(path=%s)\n",(LPSTR)lpszPath); + strcpy(lpszTemp, lpszPath); + } + + lpszElement = PathFindFilename32A(lpszTemp); + if( GetFileAttributes32A(lpszTemp) & FILE_ATTRIBUTE_DIRECTORY ) + { return _ILCreateFolder(lpszElement); + } + return _ILCreateValue(lpszElement); +} /************************************************************************** * internal functions diff --git a/dlls/shell32/shellole.c b/dlls/shell32/shellole.c index 113322b3b5a..1e916c67b7f 100644 --- a/dlls/shell32/shellole.c +++ b/dlls/shell32/shellole.c @@ -36,7 +36,7 @@ static GetClassPtr SH_find_moduleproc(LPSTR dllname,HMODULE32 *xhmod,LPSTR name) if (xhmod) { *xhmod = 0; } - if (!strcasecmp(PathFindFilename(dllname),"shell32.dll")) + if (!strcasecmp(PathFindFilename32A(dllname),"shell32.dll")) { return (GetClassPtr)SHELL32_DllGetClassObject; } diff --git a/dlls/shell32/shellord.c b/dlls/shell32/shellord.c index ffdb74dd02b..2955a7b418f 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -218,28 +218,36 @@ LPSTR WINAPI PathRemoveBlanks(LPSTR str) * NOTES * basename(char *fn); */ -LPVOID WINAPI PathFindFilename(LPVOID fn) -{ LPSTR aslash,aptr; - LPWSTR wslash,wptr; - - if(VERSION_OsIsUnicode()) - { wslash = wptr = (LPWSTR) fn; - TRACE(shell,"L%s\n",debugstr_w(wslash)); - while (wptr[0]) - { if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\') - wslash = wptr+1; - wptr++; - } - return (LPVOID) wslash; - } - aslash = aptr = (LPSTR) fn; +LPCSTR WINAPI PathFindFilename32A(LPCSTR aptr) +{ LPCSTR aslash; + aslash = aptr; + TRACE(shell,"%s\n",aslash); while (aptr[0]) { if (((aptr[0]=='\\') || (aptr[0]==':')) && aptr[1] && aptr[1]!='\\') aslash = aptr+1; - aptr++; + aptr++; } - return (LPVOID) aslash; + return aslash; + +} +LPCWSTR WINAPI PathFindFilename32W(LPCWSTR wptr) +{ LPCWSTR wslash; + wslash = wptr; + + TRACE(shell,"L%s\n",debugstr_w(wslash)); + while (wptr[0]) + { if (((wptr[0]=='\\') || (wptr[0]==':')) && wptr[1] && wptr[1]!='\\') + wslash = wptr+1; + wptr++; + } + return wslash; +} +LPCVOID WINAPI PathFindFilename32AW(LPCVOID fn) +{ + if(VERSION_OsIsUnicode()) + return PathFindFilename32W(fn); + return PathFindFilename32A(fn); } /************************************************************************* @@ -740,7 +748,6 @@ LPCVOID WINAPI PathGetExtension32AW(LPCVOID path,DWORD y,DWORD z) { if (VERSION_OsIsUnicode()) return PathGetExtension32W(path,y,z); return PathGetExtension32A(path,y,z); - } /************************************************************************* @@ -1040,15 +1047,6 @@ HRESULT WINAPI SHRunControlPanel (DWORD x, DWORD z) { FIXME(shell,"0x%08lx 0x%08lx stub\n",x,z); return 0; } -/************************************************************************* - * SHSimpleIDListFromPath [SHELL32.162] - * - */ -LPITEMIDLIST WINAPI SHSimpleIDListFromPath (LPCSTR lpszPath) -{ - FIXME(shell,"(%s): stub\n",lpszPath); - return 0; -} /************************************************************************* * ShellExecuteEx [SHELL32.291] * diff --git a/include/shell.h b/include/shell.h index 31b199e0641..64c9dbc0c82 100644 --- a/include/shell.h +++ b/include/shell.h @@ -273,8 +273,12 @@ LPCWSTR WINAPI PathGetExtension32W(LPCWSTR path, DWORD y, DWORD x); #define PathGetExtension WINELIB_NAME_AW(PathGetExtension) LPCVOID WINAPI PathGetExtension32AW(LPCVOID path, DWORD y, DWORD x); +LPCSTR WINAPI PathFindFilename32A(LPCSTR path); +LPCWSTR WINAPI PathFindFilename32W(LPCWSTR path); +#define PathFindFilename WINELIB_NAME_AW(PathFindFilename) +LPCVOID WINAPI PathFindFilename32AW(LPCVOID path); + LPSTR WINAPI PathRemoveBlanks(LPSTR str); -LPVOID WINAPI PathFindFilename(LPVOID fn); /**************************************************************************** * other functions */ diff --git a/relay32/shell32.spec b/relay32/shell32.spec index 255c22ab758..5baea871075 100644 --- a/relay32/shell32.spec +++ b/relay32/shell32.spec @@ -34,15 +34,15 @@ init Shell32LibMain 26 stub ILLoadFromStream@8 27 stub ILSaveToStream@8 28 stub SHILCreateFromPath@12 - 29 stdcall PathIsRoot(str) PathIsRoot32AW + 29 stdcall PathIsRoot(ptr) PathIsRoot32AW 30 stdcall PathBuildRoot(ptr long) PathBuildRoot - 31 stdcall PathFindExtension(str) PathFindExtension32AW - 32 stdcall PathAddBackslash(str) PathAddBackslash32AW + 31 stdcall PathFindExtension(ptr) PathFindExtension32AW + 32 stdcall PathAddBackslash(ptr) PathAddBackslash32AW 33 stdcall PathRemoveBlanks(str) PathRemoveBlanks - 34 stdcall PathFindFilename(str) PathFindFilename + 34 stdcall PathFindFilename(ptr) PathFindFilename32AW 35 stdcall PathRemoveFileSpec(str) PathRemoveFileSpec 36 stdcall PathAppend(str str) PathAppend - 37 stdcall PathCombine(ptr str str) PathCombine32AW + 37 stdcall PathCombine(ptr ptr ptr) PathCombine32AW 38 stub PathStripPath 39 stdcall PathIsUNC(str) PathIsUNC 40 stub PathIsRelative @@ -167,7 +167,7 @@ init Shell32LibMain 159 stub PathIsDirectory 160 stub SHNetConnectionDialog 161 stdcall SHRunControlPanel (long long) SHRunControlPanel - 162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPath + 162 stdcall SHSimpleIDListFromPath (ptr) SHSimpleIDListFromPath32AW 163 stub StrToOleStr 164 stub Win32DeleteFile 165 stdcall SHCreateDirectory(long long) SHCreateDirectory