Author: akhaldi
Date: Sun Jan 29 21:49:41 2017
New Revision: 73629
URL:
http://svn.reactos.org/svn/reactos?rev=73629&view=rev
Log:
[0.4.4] Revert some shell32 work (revisions 73436, 73591 and 73599) on Giannis request to
avoid any potential last minute regressions. CORE-12700
Modified:
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefView.cpp
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefaultContextMenu.cpp
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/iconcache.cpp
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/shell32.cpp
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/wine/shellord.c
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefView.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Sun Jan
29 21:49:41 2017
@@ -96,7 +96,6 @@
LONG m_iDragOverItem; /* Dragged over item's index,
iff m_pCurDropTarget != NULL */
UINT m_cScrollDelay; /* Send a WM_*SCROLL msg every
250 ms during drag-scroll */
POINT m_ptLastMousePos; /* Mouse position at last
DragOver call */
- POINT m_ptFirstMousePos; /* Mouse position when the drag
operation started */
//
CComPtr<IContextMenu> m_pCM;
@@ -1757,8 +1756,6 @@
DWORD dwEffect2;
m_pSourceDataObject = pda;
- m_ptFirstMousePos = ((LPNMLISTVIEW)lParam)->ptAction;
- ClientToScreen(&m_ptFirstMousePos);
DoDragDrop(pda, this, dwEffect, &dwEffect2);
@@ -2905,6 +2902,7 @@
{
/* Get a hold on the data object for later calls to DragEnter on the sub-folders */
m_pCurDataObject = pDataObject;
+ pDataObject->AddRef();
return drag_notify_subitem(grfKeyState, pt, pdwEffect);
}
@@ -2938,22 +2936,11 @@
if ((m_iDragOverItem == -1) &&
(*pdwEffect & DROPEFFECT_MOVE) &&
- /*(GetKeyState(VK_LBUTTON) != 0) &&*/
+ (GetKeyState(VK_LBUTTON) != 0) &&
(m_pSourceDataObject.p) &&
(SHIsSameObject(pDataObject, m_pSourceDataObject)))
{
- /* Reposition the items */
- int lvIndex = -1;
- while ((lvIndex = m_ListView.GetNextItem(lvIndex, LVNI_SELECTED)) > -1)
- {
- POINT ptItem;
- if (m_ListView.GetItemPosition(lvIndex, &ptItem))
- {
- ptItem.x += pt.x - m_ptFirstMousePos.x;
- ptItem.y += pt.y - m_ptFirstMousePos.y;
- m_ListView.SetItemPosition(lvIndex, &ptItem);
- }
- }
+ ERR("Should implement moving items here!\n");
if (m_pCurDropTarget)
{
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefaultContextMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
---
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/CDefaultContextMenu.cpp [iso-8859-1]
Sun Jan 29 21:49:41 2017
@@ -76,8 +76,6 @@
PStaticShellEntry m_pStaticEntries; /* first static shell extension entry */
UINT m_iIdSCMFirst; /* first static used id */
UINT m_iIdSCMLast; /* last static used id */
- UINT m_iIdCBFirst; /* first callback used id */
- UINT m_iIdCBLast; /* last callback used id */
HRESULT _DoCallback(UINT uMsg, WPARAM wParam, LPVOID lParam);
void AddStaticEntry(const HKEY hkeyClass, const WCHAR *szVerb);
@@ -86,7 +84,8 @@
HRESULT LoadDynamicContextMenuHandler(HKEY hKey, const CLSID *pclsid);
BOOL EnumerateDynamicContextHandlerForKey(HKEY hRootKey);
UINT InsertMenuItemsOfDynamicContextMenuExtension(HMENU hMenu, UINT IndexMenu,
UINT idCmdFirst, UINT idCmdLast);
- UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu, UINT iIdCmdFirst,
UINT iIdCmdLast);
+ UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT IndexMenu);
+ UINT BuildShellItemContextMenu(HMENU hMenu, UINT iIdCmdFirst, UINT iIdCmdLast,
UINT uFlags);
HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink);
HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi);
HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi);
@@ -147,9 +146,7 @@
m_iIdSHELast(0),
m_pStaticEntries(NULL),
m_iIdSCMFirst(0),
- m_iIdSCMLast(0),
- m_iIdCBFirst(0),
- m_iIdCBLast(0)
+ m_iIdSCMLast(0)
{
}
@@ -473,6 +470,8 @@
}
PDynamicShellEntry pEntry = m_pDynamicEntries;
+ idCmdFirst = 0x5000;
+ idCmdLast = 0x6000;
m_iIdSHEFirst = idCmdFirst;
do
{
@@ -483,13 +482,6 @@
pEntry->NumIds = LOWORD(hr);
IndexMenu += pEntry->NumIds;
idCmdFirst += pEntry->NumIds + 0x10;
-
- if(idCmdFirst >= idCmdLast)
- {
- /* There is no more room for items */
- idCmdFirst = idCmdLast;
- break;
- }
}
TRACE("pEntry %p hr %x contextmenu %p cmdfirst %x num ids %x\n",
pEntry, hr, pEntry->pCM, pEntry->iIdCmdFirst, pEntry->NumIds);
pEntry = pEntry->pNext;
@@ -503,9 +495,7 @@
UINT
CDefaultContextMenu::AddStaticContextMenusToMenu(
HMENU hMenu,
- UINT IndexMenu,
- UINT iIdCmdFirst,
- UINT iIdCmdLast)
+ UINT IndexMenu)
{
MENUITEMINFOW mii;
UINT idResource;
@@ -515,7 +505,7 @@
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_TYPE | MIIM_STATE | MIIM_DATA;
mii.fType = MFT_STRING;
- mii.wID = iIdCmdFirst;
+ mii.wID = 0x4000;
mii.dwTypeData = NULL;
m_iIdSCMFirst = mii.wID;
@@ -600,9 +590,6 @@
mii.wID++;
pEntry = pEntry->pNext;
-
- if (mii.wID >= iIdCmdLast)
- break;
}
m_iIdSCMLast = mii.wID - 1;
@@ -658,11 +645,6 @@
UINT uFlags)
{
HRESULT hr;
- UINT idCmdNext = idCmdFirst;
-
- /* Add a tiny hack to make all the shell happy until we understand how we should
handle 0 ids */
- if (!idCmdNext)
- idCmdNext = 1;
TRACE("BuildShellItemContextMenu entered\n");
@@ -674,40 +656,35 @@
}
/* Add static context menu handlers */
- IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu, idCmdNext, idCmdLast);
- if (m_iIdSCMLast && m_iIdSCMFirst != m_iIdSCMLast)
- idCmdNext = m_iIdSCMLast + 1;
+ IndexMenu = AddStaticContextMenusToMenu(hMenu, IndexMenu);
/* Add dynamic context menu handlers */
BOOL bAddSep = FALSE;
- IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu, idCmdNext,
idCmdLast);
- if (m_iIdSHELast && m_iIdSHELast != m_iIdSHEFirst)
- idCmdNext = m_iIdSHELast + 1;
+ IndexMenu = InsertMenuItemsOfDynamicContextMenuExtension(hMenu, IndexMenu,
idCmdFirst, idCmdLast);
+ TRACE("IndexMenu %d\n", IndexMenu);
/* Now let the callback add its own items */
- QCMINFO qcminfo = {hMenu, IndexMenu, idCmdNext, idCmdLast, NULL};
- if (SUCCEEDED(_DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo)))
- {
- m_iIdCBFirst = idCmdNext;
- m_iIdCBLast = qcminfo.idCmdFirst;
- idCmdNext = m_iIdCBLast + 1;
- }
-
- /* The rest of the items will be added in the end of the menu */
+ QCMINFO qcminfo;
+ qcminfo.hmenu = hMenu;
+ qcminfo.indexMenu = IndexMenu;
+ qcminfo.idCmdFirst = idCmdFirst;
+ qcminfo.idCmdLast = idCmdLast;
+ qcminfo.pIdMap = NULL;
+ _DoCallback(DFM_MERGECONTEXTMENU, uFlags, &qcminfo);
IndexMenu = GetMenuItemCount(hMenu);
if (uFlags & CMF_VERBSONLY)
- return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
+ return S_OK;
/* If this is a background context menu we are done */
if (!m_cidl)
- return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
+ return S_OK;
/* Get the attributes of the items */
SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE |
SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg);
if (FAILED_UNEXPECTEDLY(hr))
- return MAKE_HRESULT(SEVERITY_SUCCESS, 0, idCmdNext - idCmdFirst);
+ return S_OK;
/* Add the standard menu entries based on the attributes of the items */
BOOL bClipboardData = (HasClipboardData() && (rfg & SFGAO_FILESYSTEM));
@@ -1229,6 +1206,9 @@
Result = DoCreateNewFolder(&LocalInvokeInfo);
break;
default:
+
+ _DoCallback(DFM_INVOKECOMMAND, LOWORD(LocalInvokeInfo.lpVerb), NULL);
+
Result = E_UNEXPECTED;
break;
}
@@ -1236,27 +1216,21 @@
/* Check for ID's we didn't find a handler for */
if (Result == E_UNEXPECTED)
{
- if (m_pDynamicEntries)
+ if (m_iIdSHEFirst && m_iIdSHELast)
{
if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSHEFirst &&
LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSHELast)
Result = DoDynamicShellExtensions(&LocalInvokeInfo);
}
- if (m_pStaticEntries)
+ if (m_iIdSCMFirst && m_iIdSCMLast)
{
if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdSCMFirst &&
LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdSCMLast)
Result = DoStaticShellExtensions(&LocalInvokeInfo);
}
-
- if (m_iIdCBFirst != m_iIdCBLast)
- {
- if (LOWORD(LocalInvokeInfo.lpVerb) >= m_iIdCBFirst &&
LOWORD(LocalInvokeInfo.lpVerb) <= m_iIdCBLast)
- Result = _DoCallback(DFM_INVOKECOMMAND, LOWORD(LocalInvokeInfo.lpVerb),
NULL);
- }
}
if (Result == E_UNEXPECTED)
- ERR("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb));
+ FIXME("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb));
return Result;
}
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
---
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1]
(original)
+++
branches/ros-branch-0_4_4/reactos/dll/win32/shell32/folders/CDrivesFolder.cpp [iso-8859-1]
Sun Jan 29 21:49:41 2017
@@ -76,23 +76,23 @@
if (!(dwFlags & FILE_READ_ONLY_VOLUME) && GetDriveTypeA(szDrive)
!= DRIVE_REMOTE)
{
_InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE, 0,
MFT_SEPARATOR, NULL, 0);
- _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE,
pqcminfo->idCmdFirst++, MFT_STRING, MAKEINTRESOURCEW(IDS_FORMATDRIVE), MFS_ENABLED);
+ _InsertMenuItemW(pqcminfo->hmenu, pqcminfo->indexMenu++, TRUE,
0x7ABC, MFT_STRING, MAKEINTRESOURCEW(IDS_FORMATDRIVE), MFS_ENABLED);
}
}
}
else if (uMsg == DFM_INVOKECOMMAND)
{
- if (wParam == DFM_CMD_PROPERTIES)
+ if(wParam == 0x7ABC)
+ {
+ SHFormatDrive(hwnd, szDrive[0] - 'A', SHFMT_ID_DEFAULT, 0);
+ }
+ else if (wParam == DFM_CMD_PROPERTIES)
{
WCHAR wszBuf[4];
wcscpy(wszBuf, L"A:\\");
wszBuf[0] = (WCHAR)szDrive[0];
if (!SH_ShowDriveProperties(wszBuf, pidlFolder, apidl))
hr = E_FAIL;
- }
- else
- {
- SHFormatDrive(hwnd, szDrive[0] - 'A', SHFMT_ID_DEFAULT, 0);
}
}
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/iconcache.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_4/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_4/reactos/dll/win32/shell32/iconcache.cpp [iso-8859-1] Sun Jan
29 21:49:41 2017
@@ -453,9 +453,6 @@
sice.dwSourceIndex = dwSourceIndex;
sice.dwFlags = dwFlags;
- if (!sic_hdpa)
- SIC_Initialize();
-
EnterCriticalSection(&SHELL32_SicCS);
if (NULL != DPA_GetPtr (sic_hdpa, 0))
@@ -690,9 +687,6 @@
RegCloseKey(hKeyShellIcons);
}
- if (!sic_hdpa)
- SIC_Initialize();
-
return SIC_LoadIcon(iconPath, iconIdx, 0);
}
@@ -704,17 +698,13 @@
*
*/
BOOL WINAPI Shell_GetImageLists(HIMAGELIST * lpBigList, HIMAGELIST * lpSmallList)
-{
- TRACE("(%p,%p)\n",lpBigList,lpSmallList);
-
- if (!sic_hdpa)
- SIC_Initialize();
-
+{ TRACE("(%p,%p)\n",lpBigList,lpSmallList);
if (lpBigList)
- *lpBigList = ShellBigIconList;
-
+ { *lpBigList = ShellBigIconList;
+ }
if (lpSmallList)
- *lpSmallList = ShellSmallIconList;
+ { *lpSmallList = ShellSmallIconList;
+ }
return TRUE;
}
@@ -744,9 +734,6 @@
int iShortcutDefaultIndex = INVALID_INDEX;
TRACE("sf=%p pidl=%p %s\n", sh, pidl,
bBigIcon?"Big":"Small");
-
- if (!sic_hdpa)
- SIC_Initialize();
if (SUCCEEDED (sh->GetUIObjectOf(0, 1, &pidl, IID_NULL_PPV_ARG(IExtractIconW,
&ei))))
{
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/shell32.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_4/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_4/reactos/dll/win32/shell32/shell32.cpp [iso-8859-1] Sun Jan
29 21:49:41 2017
@@ -347,6 +347,7 @@
InitCommonControlsEx(&InitCtrls);
/* Bad idea, initialization in DllMain! */
+ SIC_Initialize();
InitChangeNotifications();
}
else if (dwReason == DLL_PROCESS_DETACH)
Modified: branches/ros-branch-0_4_4/reactos/dll/win32/shell32/wine/shellord.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_4/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_4/reactos/dll/win32/shell32/wine/shellord.c [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_4/reactos/dll/win32/shell32/wine/shellord.c [iso-8859-1] Sun
Jan 29 21:49:41 2017
@@ -1292,8 +1292,8 @@
*
*/
BOOL WINAPI FileIconInit(BOOL bFullInit)
-{
- return SIC_Initialize();
+{ FIXME("(%s)\n", bFullInit ? "true" : "false");
+ return FALSE;
}
/*************************************************************************