New SHGetSimpleIDListFromPath32AW.

Unicode-safe: PathFindFilename32AW.
This commit is contained in:
Juergen Schmied 1998-10-28 09:38:49 +00:00 committed by Alexandre Julliard
parent bce6d3e728
commit 309dbe10ef
5 changed files with 63 additions and 35 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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]
*

View File

@ -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
*/

View File

@ -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