From: Colin Finck Date: Wed, 16 Mar 2011 16:57:58 +0000 (+0000) Subject: Merge 51053, 51069 X-Git-Tag: ReactOS-0.3.13 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=03dc76ef238f30cadb202c1bc0e3e7119dbc1e77 Merge 51053, 51069 svn path=/branches/ros-branch-0_3_13/; revision=51070 --- diff --git a/reactos/dll/win32/shell32/clipboard.c b/reactos/dll/win32/shell32/clipboard.c index 1bdae631878..24fd0d0f514 100644 --- a/reactos/dll/win32/shell32/clipboard.c +++ b/reactos/dll/win32/shell32/clipboard.c @@ -47,52 +47,56 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl) { UINT i; - int rootlen = 0,size = 0; - WCHAR wszRootPath[MAX_PATH]; + int size = 0; WCHAR wszFileName[MAX_PATH]; - HGLOBAL hGlobal; + HGLOBAL hGlobal = NULL; DROPFILES *pDropFiles; int offset; + LPITEMIDLIST *pidls; TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl); + pidls = HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls)); + if (!pidls) + goto cleanup; + /* get the size needed */ size = sizeof(DROPFILES); - SHGetPathFromIDListW(pidlRoot, wszRootPath); - PathAddBackslashW(wszRootPath); - rootlen = wcslen(wszRootPath); - for (i=0; ipFiles = offset * sizeof(WCHAR); pDropFiles->fWide = TRUE; - wcscpy(wszFileName, wszRootPath); - for (i=0; i