mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:52:54 +00:00
[SHLWAPI] Sync with Wine Staging 2.9. CORE-13362
98d0fa9 shlwapi: Use isalnumW() instead of isalnum() for WCHARs. dfb846c shlwapi: Fixed error handling in StrRetToBufW. svn path=/trunk/; revision=74847
This commit is contained in:
parent
e80a0f88e0
commit
4a2db60d45
3 changed files with 50 additions and 39 deletions
|
@ -1500,47 +1500,58 @@ HRESULT WINAPI StrRetToBufA (LPSTRRET src, const ITEMIDLIST *pidl, LPSTR dest, U
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
|
HRESULT WINAPI StrRetToBufW (LPSTRRET src, const ITEMIDLIST *pidl, LPWSTR dest, UINT len)
|
||||||
{
|
{
|
||||||
TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl);
|
TRACE("dest=%p len=0x%x strret=%p pidl=%p\n", dest, len, src, pidl);
|
||||||
|
|
||||||
if (!src)
|
if (!dest || !len)
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
if (!src)
|
||||||
|
{
|
||||||
|
WARN("Invalid lpStrRet would crash under Win32!\n");
|
||||||
|
if (dest)
|
||||||
|
*dest = '\0';
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
*dest = '\0';
|
||||||
|
|
||||||
|
switch (src->uType) {
|
||||||
|
case STRRET_WSTR: {
|
||||||
|
size_t dst_len;
|
||||||
|
if (!src->u.pOleStr)
|
||||||
|
return E_FAIL;
|
||||||
|
dst_len = strlenW(src->u.pOleStr);
|
||||||
|
memcpy(dest, src->u.pOleStr, min(dst_len, len-1) * sizeof(WCHAR));
|
||||||
|
dest[min(dst_len, len-1)] = 0;
|
||||||
|
CoTaskMemFree(src->u.pOleStr);
|
||||||
|
if (len <= dst_len)
|
||||||
|
{
|
||||||
|
dest[0] = 0;
|
||||||
|
return E_NOT_SUFFICIENT_BUFFER;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case STRRET_CSTR:
|
||||||
|
if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ))
|
||||||
|
dest[len-1] = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case STRRET_OFFSET:
|
||||||
|
if (pidl)
|
||||||
{
|
{
|
||||||
WARN("Invalid lpStrRet would crash under Win32!\n");
|
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1,
|
||||||
if (dest)
|
dest, len ))
|
||||||
*dest = '\0';
|
dest[len-1] = 0;
|
||||||
return E_FAIL;
|
}
|
||||||
}
|
break;
|
||||||
|
|
||||||
if (!dest || !len)
|
default:
|
||||||
return E_FAIL;
|
FIXME("unknown type!\n");
|
||||||
|
return E_NOTIMPL;
|
||||||
|
}
|
||||||
|
|
||||||
*dest = '\0';
|
return S_OK;
|
||||||
|
|
||||||
switch (src->uType)
|
|
||||||
{
|
|
||||||
case STRRET_WSTR:
|
|
||||||
lstrcpynW(dest, src->u.pOleStr, len);
|
|
||||||
CoTaskMemFree(src->u.pOleStr);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case STRRET_CSTR:
|
|
||||||
if (!MultiByteToWideChar( CP_ACP, 0, src->u.cStr, -1, dest, len ))
|
|
||||||
dest[len-1] = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case STRRET_OFFSET:
|
|
||||||
if (pidl)
|
|
||||||
{
|
|
||||||
if (!MultiByteToWideChar( CP_ACP, 0, ((LPCSTR)&pidl->mkid)+src->u.uOffset, -1,
|
|
||||||
dest, len ))
|
|
||||||
dest[len-1] = 0;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
FIXME("unknown type!\n");
|
|
||||||
return E_NOTIMPL;
|
|
||||||
}
|
|
||||||
return S_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -794,7 +794,7 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative,
|
||||||
process_case = 1;
|
process_case = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isalnum(*mrelative) && (*(mrelative + 1) == ':')) {
|
if (isalnumW(*mrelative) && (*(mrelative + 1) == ':')) {
|
||||||
/* case that becomes "file:///" */
|
/* case that becomes "file:///" */
|
||||||
strcpyW(preliminary, myfilestr);
|
strcpyW(preliminary, myfilestr);
|
||||||
process_case = 1;
|
process_case = 1;
|
||||||
|
|
|
@ -174,7 +174,7 @@ reactos/dll/win32/shdoclc # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/shdocvw # Synced to WineStaging-2.2
|
reactos/dll/win32/shdocvw # Synced to WineStaging-2.2
|
||||||
reactos/dll/win32/shell32 # Forked at Wine-20071011
|
reactos/dll/win32/shell32 # Forked at Wine-20071011
|
||||||
reactos/dll/win32/shfolder # Synced to WineStaging-1.9.11
|
reactos/dll/win32/shfolder # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/shlwapi # Synced to WineStaging-2.2
|
reactos/dll/win32/shlwapi # Synced to WineStaging-2.9
|
||||||
reactos/dll/win32/slbcsp # Synced to WineStaging-1.9.11
|
reactos/dll/win32/slbcsp # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/snmpapi # Synced to WineStaging-1.9.11
|
reactos/dll/win32/snmpapi # Synced to WineStaging-1.9.11
|
||||||
reactos/dll/win32/softpub # Synced to WineStaging-1.9.11
|
reactos/dll/win32/softpub # Synced to WineStaging-1.9.11
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue