diff --git a/reactos/dll/win32/shell32/clipboard.c b/reactos/dll/win32/shell32/clipboard.c index 1bdae631878..0c989c6ddd5 100644 --- a/reactos/dll/win32/shell32/clipboard.c +++ b/reactos/dll/win32/shell32/clipboard.c @@ -47,26 +47,26 @@ 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; DROPFILES *pDropFiles; int offset; + LPITEMIDLIST *pidls; TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl); + pidls = HeapAlloc(GetProcessHeap(), 0, cidl * sizeof *pidls); + if (!pidls) return NULL; + /* 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