mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[SHELL32]
Fix missing "Open" menu entry on right click for All Users desktop shortcuts. Patch by Thomas Faber <thfabba at gmx dot de> See issue #5998 for more details. svn path=/trunk/; revision=51053
This commit is contained in:
parent
f565766808
commit
92d94fdb7c
1 changed files with 12 additions and 12 deletions
|
@ -47,26 +47,26 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||||
{
|
{
|
||||||
UINT i;
|
UINT i;
|
||||||
int rootlen = 0,size = 0;
|
int size = 0;
|
||||||
WCHAR wszRootPath[MAX_PATH];
|
|
||||||
WCHAR wszFileName[MAX_PATH];
|
WCHAR wszFileName[MAX_PATH];
|
||||||
HGLOBAL hGlobal;
|
HGLOBAL hGlobal;
|
||||||
DROPFILES *pDropFiles;
|
DROPFILES *pDropFiles;
|
||||||
int offset;
|
int offset;
|
||||||
|
LPITEMIDLIST *pidls;
|
||||||
|
|
||||||
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
|
||||||
|
|
||||||
|
pidls = HeapAlloc(GetProcessHeap(), 0, cidl * sizeof *pidls);
|
||||||
|
if (!pidls) return NULL;
|
||||||
|
|
||||||
/* get the size needed */
|
/* get the size needed */
|
||||||
size = sizeof(DROPFILES);
|
size = sizeof(DROPFILES);
|
||||||
|
|
||||||
SHGetPathFromIDListW(pidlRoot, wszRootPath);
|
|
||||||
PathAddBackslashW(wszRootPath);
|
|
||||||
rootlen = wcslen(wszRootPath);
|
|
||||||
|
|
||||||
for (i=0; i<cidl;i++)
|
for (i=0; i<cidl;i++)
|
||||||
{
|
{
|
||||||
_ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
|
pidls[i] = ILCombine(pidlRoot, apidl[i]);
|
||||||
size += (rootlen + wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||||
|
size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
size += sizeof(WCHAR);
|
size += sizeof(WCHAR);
|
||||||
|
@ -80,19 +80,19 @@ HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
|
||||||
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
pDropFiles->pFiles = offset * sizeof(WCHAR);
|
||||||
pDropFiles->fWide = TRUE;
|
pDropFiles->fWide = TRUE;
|
||||||
|
|
||||||
wcscpy(wszFileName, wszRootPath);
|
|
||||||
|
|
||||||
for (i=0; i<cidl;i++)
|
for (i=0; i<cidl;i++)
|
||||||
{
|
{
|
||||||
|
SHGetPathFromIDListW(pidls[i], wszFileName);
|
||||||
_ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
|
|
||||||
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
|
||||||
offset += wcslen(wszFileName) + 1;
|
offset += wcslen(wszFileName) + 1;
|
||||||
|
ILFree(pidls[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
((WCHAR*)pDropFiles)[offset] = 0;
|
((WCHAR*)pDropFiles)[offset] = 0;
|
||||||
GlobalUnlock(hGlobal);
|
GlobalUnlock(hGlobal);
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, pidls);
|
||||||
|
|
||||||
return hGlobal;
|
return hGlobal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue