Commit 6f3d5805 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

StrRetToStrN[A|W|AW] new independent unicode/ascii/export functions.

parent a34aef10
...@@ -101,7 +101,7 @@ init Shell32LibMain ...@@ -101,7 +101,7 @@ init Shell32LibMain
93 stub Win32CreateDirectory 93 stub Win32CreateDirectory
94 stub Win32RemoveDirectory 94 stub Win32RemoveDirectory
95 stdcall SHLogILFromFSIL (ptr) SHLogILFromFSIL 95 stdcall SHLogILFromFSIL (ptr) SHLogILFromFSIL
96 stdcall StrRetToStrN (long long long long) StrRetToStrN 96 stdcall StrRetToStrN (long long long long) StrRetToStrNAW
97 stdcall SHWaitForFileToOpen (long long long) SHWaitForFileToOpen 97 stdcall SHWaitForFileToOpen (long long long) SHWaitForFileToOpen
98 stdcall SHGetRealIDL (long long long) SHGetRealIDL 98 stdcall SHGetRealIDL (long long long) SHGetRealIDL
99 stdcall SetAppStartingCursor (long long) SetAppStartingCursor 99 stdcall SetAppStartingCursor (long long) SetAppStartingCursor
......
...@@ -909,30 +909,57 @@ HRESULT WINAPI IsUserAdmin(void) ...@@ -909,30 +909,57 @@ HRESULT WINAPI IsUserAdmin(void)
* NOTES * NOTES
* the pidl is for STRRET OFFSET * the pidl is for STRRET OFFSET
*/ */
HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl) HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{ TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl); {
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
switch (src->uType) switch (src->uType)
{ case STRRET_WSTR: {
case STRRET_WSTR:
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL); WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
SHFree(src->u.pOleStr); SHFree(src->u.pOleStr);
break; break;
case STRRET_CSTRA: case STRRET_CSTRA:
if (VERSION_OsIsUnicode())
lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
else
lstrcpynA((LPSTR)dest, src->u.cStr, len); lstrcpynA((LPSTR)dest, src->u.cStr, len);
break; break;
case STRRET_OFFSETA: case STRRET_OFFSETA:
if (pidl)
{ if(VERSION_OsIsUnicode())
lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
else
lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len); lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
break; break;
default:
FIXME("unknown type!\n");
if (len)
{
*(LPSTR)dest = '\0';
}
return(FALSE);
}
return S_OK;
}
HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
switch (src->uType)
{
case STRRET_WSTR:
lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
SHFree(src->u.pOleStr);
break;
case STRRET_CSTRA:
lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
break;
case STRRET_OFFSETA:
if (pidl)
{
lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
} }
break;
default: default:
FIXME("unknown type!\n"); FIXME("unknown type!\n");
...@@ -941,7 +968,13 @@ HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST ...@@ -941,7 +968,13 @@ HRESULT WINAPI StrRetToStrN (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST
} }
return(FALSE); return(FALSE);
} }
return(TRUE); return S_OK;
}
HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
{
if(VERSION_OsIsUnicode())
return StrRetToStrNW (dest, len, src, pidl);
return StrRetToStrNA (dest, len, src, pidl);
} }
/************************************************************************* /*************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment