Author: akhaldi
Date: Thu Nov 6 18:33:33 2014
New Revision: 65294
URL:
http://svn.reactos.org/svn/reactos?rev=65294&view=rev
Log:
[SHELL32]
* Another partial sync of clipboard.c with Wine 1.7.27.
* Move RenderPREFEREDDROPEFFECT to CIDLDataObj.cpp where it belongs.
CORE-8540
Modified:
branches/shell-experiments/dll/win32/shell32/CIDLDataObj.cpp
branches/shell-experiments/dll/win32/shell32/wine/clipboard.c
branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h
Modified: branches/shell-experiments/dll/win32/shell32/CIDLDataObj.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/CIDLDataObj.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/CIDLDataObj.cpp [iso-8859-1] Thu Nov 6
18:33:33 2014
@@ -225,6 +225,21 @@
return S_OK;
}
+static HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
+{
+ DWORD * pdwFlag;
+ HGLOBAL hGlobal;
+
+ TRACE("(0x%08x)\n", dwFlags);
+
+ hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
+ if(!hGlobal) return hGlobal;
+ pdwFlag = (DWORD*)GlobalLock(hGlobal);
+ *pdwFlag = dwFlags;
+ GlobalUnlock(hGlobal);
+ return hGlobal;
+}
+
/**************************************************************************
* IDataObject_fnGetData
*/
Modified: branches/shell-experiments/dll/win32/shell32/wine/clipboard.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/clipboard.c [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/wine/clipboard.c [iso-8859-1] Thu Nov 6
18:33:33 2014
@@ -54,56 +54,91 @@
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
UINT i;
- int size = 0;
+#ifdef __REACTOS__
+ int size = 0;
+#else
+ int rootlen = 0,size = 0;
+ WCHAR wszRootPath[MAX_PATH];
+#endif
WCHAR wszFileName[MAX_PATH];
- HGLOBAL hGlobal = NULL;
+ HGLOBAL hGlobal = NULL;
DROPFILES *pDropFiles;
int offset;
- LPITEMIDLIST *pidls;
-
- TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
-
- pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
- if (!pidls)
- goto cleanup;
+#ifdef __REACTOS__
+ LPITEMIDLIST *pidls;
+#endif
+
+ TRACE("(%p,%p,%u)\n", pidlRoot, apidl, cidl);
+
+#ifdef __REACTOS__
+ pidls = (LPITEMIDLIST *)HeapAlloc(GetProcessHeap(), 0, cidl * sizeof(*pidls));
+ if (!pidls)
+ goto cleanup;
+#endif
/* get the size needed */
size = sizeof(DROPFILES);
+#ifndef __REACTOS__
+ SHGetPathFromIDListW(pidlRoot, wszRootPath);
+ PathAddBackslashW(wszRootPath);
+ rootlen = strlenW(wszRootPath);
+#endif
+
for (i=0; i<cidl;i++)
{
- pidls[i] = ILCombine(pidlRoot, apidl[i]);
- SHGetPathFromIDListW(pidls[i], wszFileName);
- size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
+#ifdef __REACTOS__
+ pidls[i] = ILCombine(pidlRoot, apidl[i]);
+ SHGetPathFromIDListW(pidls[i], wszFileName);
+ size += (wcslen(wszFileName) + 1) * sizeof(WCHAR);
+#else
+ _ILSimpleGetTextW(apidl[i], wszFileName, MAX_PATH);
+ size += (rootlen + strlenW(wszFileName) + 1) * sizeof(WCHAR);
+#endif
}
size += sizeof(WCHAR);
/* Fill the structure */
hGlobal = GlobalAlloc(GHND|GMEM_SHARE, size);
- if(!hGlobal)
- goto cleanup;
-
- pDropFiles = (DROPFILES *)GlobalLock(hGlobal);
+#ifdef __REACTOS__
+ if(!hGlobal) goto cleanup;
+#else
+ if(!hGlobal) return hGlobal;
+#endif
+
+ pDropFiles = GlobalLock(hGlobal);
offset = (sizeof(DROPFILES) + sizeof(WCHAR) - 1) / sizeof(WCHAR);
pDropFiles->pFiles = offset * sizeof(WCHAR);
pDropFiles->fWide = TRUE;
+#ifndef __REACTOS__
+ strcpyW(wszFileName, wszRootPath);
+#endif
+
for (i=0; i<cidl;i++)
{
- SHGetPathFromIDListW(pidls[i], wszFileName);
- wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
- offset += wcslen(wszFileName) + 1;
- ILFree(pidls[i]);
+#ifdef __REACTOS__
+ SHGetPathFromIDListW(pidls[i], wszFileName);
+ wcscpy(((WCHAR*)pDropFiles)+offset, wszFileName);
+ offset += wcslen(wszFileName) + 1;
+ ILFree(pidls[i]);
+#else
+ _ILSimpleGetTextW(apidl[i], wszFileName + rootlen, MAX_PATH - rootlen);
+ strcpyW(((WCHAR*)pDropFiles)+offset, wszFileName);
+ offset += strlenW(wszFileName) + 1;
+#endif
}
((WCHAR*)pDropFiles)[offset] = 0;
GlobalUnlock(hGlobal);
+#ifdef __REACTOS__
cleanup:
if(pidls)
HeapFree(GetProcessHeap(), 0, pidls);
+#endif
return hGlobal;
}
@@ -150,24 +185,6 @@
return hGlobal;
}
-HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
-{
- FIXME("\n");
- return 0;
-}
-
-HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
-{
- FIXME("\n");
- return 0;
-}
-
-HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
-{
- FIXME("\n");
- return 0;
-}
-
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl)
{
int size = 0;
@@ -231,18 +248,3 @@
return hGlobal;
}
-
-HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags)
-{
- DWORD * pdwFlag;
- HGLOBAL hGlobal;
-
- TRACE("(0x%08x)\n", dwFlags);
-
- hGlobal = GlobalAlloc(GHND|GMEM_SHARE, sizeof(DWORD));
- if(!hGlobal) return hGlobal;
- pdwFlag = (DWORD*)GlobalLock(hGlobal);
- *pdwFlag = dwFlags;
- GlobalUnlock(hGlobal);
- return hGlobal;
-}
Modified: branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/shell32/wine/shell32_main.h [iso-8859-1] Thu Nov
6 18:33:33 2014
@@ -98,12 +98,8 @@
HGLOBAL RenderHDROP(LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderSHELLIDLIST (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
-HGLOBAL RenderSHELLIDLISTOFFSET (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT
cidl);
-HGLOBAL RenderFILECONTENTS (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
-HGLOBAL RenderFILEDESCRIPTOR (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEA (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
HGLOBAL RenderFILENAMEW (LPITEMIDLIST pidlRoot, LPITEMIDLIST * apidl, UINT cidl);
-HGLOBAL RenderPREFEREDDROPEFFECT (DWORD dwFlags);
/* Change Notification */
void InitChangeNotifications(void);