Author: dquintana
Date: Thu Mar 13 16:21:56 2014
New Revision: 62492
URL:
http://svn.reactos.org/svn/reactos?rev=62492&view=rev
Log:
[RSHELL]
* Fix some null dereferences.
* Fix positioning of submenus of an horizontal menu toolbar.
[BROWSEUI]
* Fix some null dereferences.
CORE-7586
Modified:
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/dll/win32/browseui/addressband.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Thu Mar 13
16:21:56 2014
@@ -345,8 +345,6 @@
y = rcWorkArea.bottom - cy;
}
-
-
this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW);
m_ShowFlags = dwFlags;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Thu Mar 13
16:21:56 2014
@@ -492,8 +492,14 @@
ClientToScreen(m_hwnd, &c);
ClientToScreen(m_hwnd, &d);
- POINTL pt = { b.x - 3, a.y - 3 };
+ POINTL pt = { a.x, b.y };
RECTL rcl = { c.x, c.y, d.x, d.y };
+
+ if(m_toolbarFlags & SMINIT_VERTICAL)
+ {
+ pt.x = b.x - 3;
+ pt.y = a.y - 3;
+ }
#if USE_SYSTEM_MENUSITE
hr = CoCreateInstance(CLSID_MenuBandSite,
@@ -830,13 +836,16 @@
}
HRESULT CMenuStaticToolbar::GetMenu(
- HMENU *phmenu,
- HWND *phwnd,
- DWORD *pdwFlags)
-{
- *phmenu = m_hmenu;
- *phwnd = NULL;
- *pdwFlags = m_dwMenuFlags;
+ _Out_opt_ HMENU *phmenu,
+ _Out_opt_ HWND *phwnd,
+ _Out_opt_ DWORD *pdwFlags)
+{
+ if (phmenu)
+ *phmenu = m_hmenu;
+ if (phwnd)
+ *phwnd = NULL;
+ if (pdwFlags)
+ *pdwFlags = m_dwMenuFlags;
return S_OK;
}
@@ -977,7 +986,9 @@
CMenuSFToolbar::CMenuSFToolbar(CMenuBand * menuBand) :
CMenuToolbarBase(menuBand, TRUE),
- m_shellFolder(NULL)
+ m_shellFolder(NULL),
+ m_idList(NULL),
+ m_hKey(NULL)
{
}
@@ -1049,7 +1060,7 @@
HRESULT CMenuSFToolbar::SetShellFolder(IShellFolder *psf, LPCITEMIDLIST pidlFolder, HKEY
hKey, DWORD dwFlags)
{
m_shellFolder = psf;
- m_idList = pidlFolder;
+ m_idList = ILClone(pidlFolder);
m_hKey = hKey;
m_dwMenuFlags = dwFlags;
return S_OK;
Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] Thu Mar 13
16:21:56 2014
@@ -311,10 +311,14 @@
CComPtr<IWinEventHandler> winEventHandler;
HRESULT hResult;
- hResult = fAddressEditBox->QueryInterface(IID_IWinEventHandler,
reinterpret_cast<void **>(&winEventHandler));
- if (FAILED(hResult))
- return hResult;
- return winEventHandler->IsWindowOwner(hWnd);
+ if (fAddressEditBox)
+ {
+ hResult = fAddressEditBox->QueryInterface(IID_IWinEventHandler,
reinterpret_cast<void **>(&winEventHandler));
+ if (FAILED(hResult))
+ return hResult;
+ return winEventHandler->IsWindowOwner(hWnd);
+ }
+ return S_FALSE;
}
HRESULT STDMETHODCALLTYPE CAddressBand::FileSysChange(long param8, long paramC)