ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
October 2014
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
730 discussions
Start a n
N
ew thread
[jgardou] 64862: [WIN32K] - Avoid use after free in debug configuration CORE-8661 #resolve
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Oct 21 10:45:49 2014 New Revision: 64862 URL:
http://svn.reactos.org/svn/reactos?rev=64862&view=rev
Log: [WIN32K] - Avoid use after free in debug configuration CORE-8661 #resolve Modified: trunk/reactos/win32ss/user/ntuser/object.c Modified: trunk/reactos/win32ss/user/ntuser/object.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/object…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/object.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/object.c [iso-8859-1] Tue Oct 21 10:45:49 2014 @@ -710,14 +710,15 @@ return; } +#if DBG + oldppi->DbgHandleCount[type]--; + ppi->DbgHandleCount[type]++; +#endif + oldppi->UserHandleCount--; IntDereferenceProcessInfo(oldppi); ppi->UserHandleCount++; IntReferenceProcessInfo(ppi); -#if DBG - oldppi->DbgHandleCount[type]--; - ppi->DbgHandleCount[type]++; -#endif } BOOLEAN
10 years, 2 months
1
0
0
0
[jgardou] 64861: [CMAKE] - link keyboard layout modules to gcc_ssp if the stack protector is enabled.
by jgardou@svn.reactos.org
Author: jgardou Date: Tue Oct 21 10:45:36 2014 New Revision: 64861 URL:
http://svn.reactos.org/svn/reactos?rev=64861&view=rev
Log: [CMAKE] - link keyboard layout modules to gcc_ssp if the stack protector is enabled. Modified: trunk/reactos/dll/keyboard/CMakeLists.txt Modified: trunk/reactos/dll/keyboard/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/keyboard/CMakeLists.tx…
============================================================================== --- trunk/reactos/dll/keyboard/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/dll/keyboard/CMakeLists.txt [iso-8859-1] Tue Oct 21 10:45:36 2014 @@ -102,6 +102,10 @@ add_target_link_flags(${_keyboard_layout} "-Wl,-T,${CMAKE_SOURCE_DIR}/kbdlayout.lds") endif() + if (STACK_PROTECTOR) + target_link_libraries(${_keyboard_layout} gcc_ssp) + endif() + if(RUNTIME_CHECKS) target_link_libraries(${_keyboard_layout} runtmchk) endif()
10 years, 2 months
1
0
0
0
[jimtabor] 64860: [User32] - Remove code that breaks wine release 1.7.29 user32 input tests. Code was there since r2505. - So due to this commit, over compensating hacks can break.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Oct 21 03:13:21 2014 New Revision: 64860 URL:
http://svn.reactos.org/svn/reactos?rev=64860&view=rev
Log: [User32] - Remove code that breaks wine release 1.7.29 user32 input tests. Code was there since r2505. - So due to this commit, over compensating hacks can break. Modified: trunk/reactos/win32ss/user/user32/windows/defwnd.c Modified: trunk/reactos/win32ss/user/user32/windows/defwnd.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
============================================================================== --- trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/user32/windows/defwnd.c [iso-8859-1] Tue Oct 21 03:13:21 2014 @@ -622,10 +622,7 @@ case WM_RBUTTONUP: { POINT Pt; - if (hWnd == GetCapture()) - { - ReleaseCapture(); - } + Pt.x = GET_X_LPARAM(lParam); Pt.y = GET_Y_LPARAM(lParam); ClientToScreen(hWnd, &Pt);
10 years, 2 months
1
0
0
0
[jimtabor] 64859: [Win32k] - rpdeskParent can be NULL and should not be depended on! Fixes CORE-8665.
by jimtabor@svn.reactos.org
Author: jimtabor Date: Tue Oct 21 03:02:07 2014 New Revision: 64859 URL:
http://svn.reactos.org/svn/reactos?rev=64859&view=rev
Log: [Win32k] - rpdeskParent can be NULL and should not be depended on! Fixes CORE-8665. Modified: trunk/reactos/win32ss/user/ntuser/callproc.c Modified: trunk/reactos/win32ss/user/ntuser/callproc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/callpr…
============================================================================== --- trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/user/ntuser/callproc.c [iso-8859-1] Tue Oct 21 03:02:07 2014 @@ -7,6 +7,7 @@ */ #include <win32k.h> +DBG_DEFAULT_CHANNEL(UserClass); /* CALLPROC ******************************************************************/ @@ -110,6 +111,7 @@ { PCLS pCls; PWND pWnd; + PDESKTOP pDesk; PCALLPROCDATA CallProc = NULL; PTHREADINFO pti; @@ -131,7 +133,14 @@ // No luck, create a new one for the requested proc. if (!CallProc) { - CallProc = CreateCallProc( pCls->rpdeskParent, + if (!pCls->rpdeskParent) + { + TRACE("Null DESKTOP Atom %d\n",pCls->atomClassName); + pDesk = pti->rpdesk; + } + else + pDesk = pCls->rpdeskParent; + CallProc = CreateCallProc( pDesk, (WNDPROC)ProcIn, !!(Flags & UserGetCPDA2U), pti->ppi);
10 years, 2 months
1
0
0
0
[dquintana] 64858: [BROWSEUI] * SHOnCWMCommandLine: Fix IETHREADPARAM leak. [SHELL32] * Fix HMENU leak of the popup used in the view mode button of the toolbar. [RSHELL] * Undo a previous change to...
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Oct 20 21:35:22 2014 New Revision: 64858 URL:
http://svn.reactos.org/svn/reactos?rev=64858&view=rev
Log: [BROWSEUI] * SHOnCWMCommandLine: Fix IETHREADPARAM leak. [SHELL32] * Fix HMENU leak of the popup used in the view mode button of the toolbar. [RSHELL] * Undo a previous change to help debug the leaks. * Remove child submenus when closing a menu band. * Add some extra verification for debugging purposes. [BROWSEUI] [RSHELL] [SHELL32] * Move ReleaseCComPtrExpectZero to the shared header. Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuBand.h branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CStartMenu.cpp branches/shell-experiments/dll/win32/browseui/desktopipc.cpp branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp branches/shell-experiments/dll/win32/shell32/shlview.cpp branches/shell-experiments/include/reactos/undocshell.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -56,7 +56,9 @@ m_popupBar(NULL), m_popupItem(-1), m_Show(FALSE), - m_shellBottom(FALSE) + m_shellBottom(FALSE), + m_trackedPopup(NULL), + m_trackedHwnd(NULL) { m_focusManager = CMenuFocusManager::AcquireManager(); } @@ -418,6 +420,16 @@ HRESULT STDMETHODCALLTYPE CMenuBand::CloseDW(DWORD dwReserved) { + if (m_subMenuChild) + { + m_subMenuChild->OnSelect(MPOS_CANCELLEVEL); + } + + if (m_subMenuChild) + { + DbgPrint("Child object should have removed itself.\n"); + } + ShowDW(FALSE); if (m_staticToolbar != NULL) @@ -594,7 +606,10 @@ HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient) { - m_subMenuChild = NULL; + if (m_subMenuChild) + { + ReleaseCComPtrExpectZero(m_subMenuChild); + } if (!punkClient) { @@ -738,9 +753,15 @@ UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN; HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow; + m_trackedPopup = popup; + m_trackedHwnd = hwnd; + m_focusManager->PushTrackedPopup(popup); ::TrackPopupMenuEx(popup, flags, x, y, hwnd, ¶ms); m_focusManager->PopTrackedPopup(popup); + + m_trackedPopup = NULL; + m_trackedHwnd = NULL; _DisableMouseTrack(FALSE); @@ -950,11 +971,19 @@ HRESULT CMenuBand::_CancelCurrentPopup() { - if (!m_subMenuChild) - return S_FALSE; - - HRESULT hr = m_subMenuChild->OnSelect(MPOS_CANCELLEVEL); - return hr; + if (m_subMenuChild) + { + HRESULT hr = m_subMenuChild->OnSelect(MPOS_CANCELLEVEL); + return hr; + } + + if (m_trackedPopup) + { + ::SendMessage(m_trackedHwnd, WM_CANCELMODE, 0, 0); + return S_OK; + } + + return S_FALSE; } HRESULT CMenuBand::_OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude, BOOL keyInitiated) @@ -1044,6 +1073,11 @@ return S_OK; } +HRESULT CMenuBand::_HasSubMenu() +{ + return m_popupBar ? S_OK : S_FALSE; +} + HRESULT STDMETHODCALLTYPE CMenuBand::InvalidateItem(LPSMDATA psmd, DWORD dwFlags) { UNIMPLEMENTED; Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -68,6 +68,9 @@ BOOL m_Show; BOOL m_shellBottom; + HMENU m_trackedPopup; + HWND m_trackedHwnd; + public: CMenuBand(); virtual ~CMenuBand(); @@ -194,6 +197,7 @@ HRESULT _KillPopupTimers(); HRESULT _MenuBarMouseDown(HWND hwnd, INT item); HRESULT _MenuBarMouseUp(HWND hwnd, INT item); + HRESULT _HasSubMenu(); BOOL UseBigIcons() { 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] Mon Oct 20 21:35:22 2014 @@ -171,7 +171,17 @@ CComPtr<IDeskBarClient> pDeskBandClient; HRESULT hr; - m_Client.Release(); + if (m_Client) + { + hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &pDeskBandClient)); + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + + pDeskBandClient->SetDeskBarSite(NULL); + + pDeskBandClient = NULL; + m_Client = NULL; + } if (punkClient == NULL) return S_OK; @@ -222,9 +232,19 @@ if (m_Shown) _CloseBar(); + m_SubMenuParent = NULL; + m_Site = pUnkSite; - IUnknown_QueryService(m_Site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup, &m_SubMenuParent)); + if (m_Site) + { + IUnknown_QueryService(m_Site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup, &m_SubMenuParent)); + } + else + { + DestroyWindow(); + SetClient(NULL); + } return S_OK; } Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -151,7 +151,14 @@ int csidl = 0; IShellMenu *pShellMenu; +#if USE_SYSTEM_MENUBAND + hr = CoCreateInstance(CLSID_MenuBand, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IShellMenu, &pShellMenu)); +#else hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu)); +#endif if (FAILED_UNEXPECTEDLY(hr)) return hr; @@ -394,15 +401,36 @@ LPITEMIDLIST pidlPrograms; CComPtr<IShellFolder> psfPrograms; +#if USE_SYSTEM_MENUBAND + hr = CoCreateInstance(CLSID_MenuBand, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IShellMenu, &pShellMenu)); +#else hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - +#endif + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + +#if USE_SYSTEM_MENUSITE + hr = CoCreateInstance(CLSID_MenuBandSite, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IBandSite, &pBandSite)); +#else hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite)); - if (FAILED_UNEXPECTEDLY(hr)) - return hr; - +#endif + if (FAILED_UNEXPECTEDLY(hr)) + return hr; + +#if USE_SYSTEM_MENUDESKBAR + hr = CoCreateInstance(CLSID_MenuDeskBar, + NULL, + CLSCTX_INPROC_SERVER, + IID_PPV_ARG(IDeskBar, &pDeskBar)); +#else hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar)); +#endif if (FAILED_UNEXPECTEDLY(hr)) return hr; Modified: branches/shell-experiments/dll/win32/browseui/desktopipc.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/desktopipc.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/desktopipc.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -345,22 +345,6 @@ return params; } - -/************************************************************************* -* SHOnCWMCommandLine [BROWSEUI.127] -*/ -extern "C" BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo) -{ - DbgPrint("SHOnCWMCommandLine\n"); - - PIE_THREAD_PARAM_BLOCK params = ParseSharedPacket(hSharedInfo); - - if (params) - return SHOpenFolderWindow(params); - - return FALSE; -} - /************************************************************************* * SHCreateIETHREADPARAM [BROWSEUI.123] */ @@ -442,6 +426,23 @@ } /************************************************************************* +* SHOnCWMCommandLine [BROWSEUI.127] +*/ +extern "C" BOOL WINAPI SHOnCWMCommandLine(HANDLE hSharedInfo) +{ + DbgPrint("SHOnCWMCommandLine\n"); + + PIE_THREAD_PARAM_BLOCK params = ParseSharedPacket(hSharedInfo); + + if (params) + return SHOpenFolderWindow(params); + + SHDestroyIETHREADPARAM(params); + + return FALSE; +} + +/************************************************************************* * SHOpenFolderWindow [BROWSEUI.102] * see SHOpenNewFrame below for remarks */ Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -992,27 +992,6 @@ return hResult; } return S_OK; -} - -template<class T> -void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE) -{ - if (cptr.p != NULL) - { - int nrc = cptr->Release(); - if (nrc > 0) - { - DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc); - if (forceRelease) - { - while (nrc > 0) - { - nrc = cptr->Release(); - } - } - } - cptr.Detach(); - } } HRESULT STDMETHODCALLTYPE CInternetToolbar::CloseDW(DWORD dwReserved) Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -2563,6 +2563,9 @@ return S_OK; } + if (!fCurrentShellView) + return S_FALSE; + return fCurrentShellView->TranslateAcceleratorW(pmsg); } @@ -3068,27 +3071,6 @@ { OnCreate(reinterpret_cast<LPCREATESTRUCT> (lParam)); return 0; -} - -template<class T> -void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE) -{ - if (cptr.p != NULL) - { - int nrc = cptr->Release(); - if (nrc > 0) - { - DbgPrint("WARNING: Unexpected RefCount > 0!\n"); - if (forceRelease) - { - while (nrc > 0) - { - nrc = cptr->Release(); - } - } - } - cptr.Detach(); - } } LRESULT CShellBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled) Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -341,36 +341,37 @@ typedef void (CALLBACK *PFNSHGETSETTINGSPROC)(LPSHELLFLAGSTATE lpsfs, DWORD dwMask); -CDefView::CDefView() -{ - m_hWndList = NULL; - m_hWndParent = NULL; - m_FolderSettings.fFlags = 0; - m_FolderSettings.ViewMode = 0; - m_hMenu = NULL; - m_menusLoaded = FALSE; - m_uState = 0; - m_cidl = 0; - m_apidl = NULL; - m_sortInfo.bIsAscending = FALSE; - m_sortInfo.nHeaderID = 0; - m_sortInfo.nLastHeaderID = 0; - m_hNotify = 0; - m_hAccel = NULL; - m_dwAspects = 0; - m_dwAdvf = 0; - m_iDragOverItem = 0; - m_cScrollDelay = 0; - m_ptLastMousePos.x = 0; - m_ptLastMousePos.y = 0; - m_isEditing = FALSE; - ZeroMemory(&m_Category, sizeof(m_Category)); - m_hView = NULL; +CDefView::CDefView() : + m_hWndList(NULL), + m_hWndParent(NULL), + m_hMenu(NULL), + m_menusLoaded(FALSE), + m_uState(0), + m_cidl(0), + m_apidl(NULL), + m_hNotify(0), + m_hAccel(NULL), + m_dwAspects(0), + m_dwAdvf(0), + m_iDragOverItem(0), + m_cScrollDelay(0), + m_isEditing(FALSE), + m_hView(NULL) +{ + m_FolderSettings = { 0 }; + m_sortInfo = { 0 }; + m_ptLastMousePos = { 0 }; + m_Category = { 0 }; } CDefView::~CDefView() { TRACE(" destroying IShellView(%p)\n", this); + + if (m_hWnd) + { + DestroyViewWindow(); + } SHFree(m_apidl); } @@ -2122,12 +2123,35 @@ /*Make absolutely sure all our UI is cleaned up.*/ UIActivate(SVUIA_DEACTIVATE); + if (m_hAccel) + { + // "Accelerator tables loaded from resources are freed automatically when the application terminates." -- MSDN + m_hAccel = NULL; + } + + if (m_hView) + { + DestroyMenu(m_hView); + m_hView = NULL; + } + if (m_hMenu) { DestroyMenu(m_hMenu); - } - - DestroyWindow(); + m_hView = NULL; + } + + if (m_hWndList) + { + ::DestroyWindow(m_hWndList); + m_hWndList = NULL; + } + + if (m_hWnd) + { + DestroyWindow(); + } + m_pShellBrowser.Release(); m_pCommDlgBrowser.Release(); Modified: branches/shell-experiments/include/reactos/undocshell.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
============================================================================== --- branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] (original) +++ branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] Mon Oct 20 21:35:22 2014 @@ -691,6 +691,27 @@ } }; +template<class T> +void ReleaseCComPtrExpectZero(CComPtr<T>& cptr, BOOL forceRelease = FALSE) +{ + if (cptr.p != NULL) + { + int nrc = cptr->Release(); + if (nrc > 0) + { + DbgPrint("WARNING: Unexpected RefCount > 0 (%d)!\n", nrc); + if (forceRelease) + { + while (nrc > 0) + { + nrc = cptr->Release(); + } + } + } + cptr.Detach(); + } +} + template<class T, class R> HRESULT inline ShellObjectCreator(REFIID riid, R ** ppv) {
10 years, 2 months
1
0
0
0
[dquintana] 64857: [EXPLORER-NEW] * Initialize struct contents to zero. CID 1102492 [BROWSEUI] * Fix build.
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Oct 20 21:23:32 2014 New Revision: 64857 URL:
http://svn.reactos.org/svn/reactos?rev=64857&view=rev
Log: [EXPLORER-NEW] * Initialize struct contents to zero. CID 1102492 [BROWSEUI] * Fix build. Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.c branches/shell-experiments/include/reactos/undocshell.h Modified: branches/shell-experiments/base/shell/explorer-new/trayntfy.c URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
============================================================================== --- branches/shell-experiments/base/shell/explorer-new/trayntfy.c [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/explorer-new/trayntfy.c [iso-8859-1] Mon Oct 20 21:23:32 2014 @@ -117,7 +117,7 @@ SysPagerWnd_UpdateButton(IN OUT PSYS_PAGER_WND_DATA This, IN CONST NOTIFYICONDATA *iconData) { - TBBUTTONINFO tbbi; + TBBUTTONINFO tbbi = {0}; PNOTIFY_ITEM notifyItem; PPNOTIFY_ITEM NotifyPointer; Modified: branches/shell-experiments/include/reactos/undocshell.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
============================================================================== --- branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] (original) +++ branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] Mon Oct 20 21:23:32 2014 @@ -735,11 +735,11 @@ return S_OK; } -template<class T, class T1, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv) +template<class T> +HRESULT inline ShellObjectCreatorInit(REFIID riid, void ** ppv) { CComPtr<T> obj; - CComPtr<R> result; + CComPtr<IUnknown> result; HRESULT hResult; if (ppv == NULL) @@ -752,7 +752,7 @@ if (FAILED(hResult)) return hResult; - hResult = obj->Initialize(initArg1); + hResult = obj->Initialize(); if (FAILED(hResult)) return hResult; @@ -761,8 +761,8 @@ return S_OK; } -template<class T, class T1, class T2, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv) +template<class T, class T1, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv) { CComPtr<T> obj; CComPtr<R> result; @@ -778,7 +778,7 @@ if (FAILED(hResult)) return hResult; - hResult = obj->Initialize(initArg1, initArg2); + hResult = obj->Initialize(initArg1); if (FAILED(hResult)) return hResult; @@ -787,8 +787,8 @@ return S_OK; } -template<class T, class T1, class T2, class T3, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv) +template<class T, class T1, class T2, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv) { CComPtr<T> obj; CComPtr<R> result; @@ -804,7 +804,7 @@ if (FAILED(hResult)) return hResult; - hResult = obj->Initialize(initArg1, initArg2, initArg3); + hResult = obj->Initialize(initArg1, initArg2); if (FAILED(hResult)) return hResult; @@ -813,8 +813,8 @@ return S_OK; } -template<class T, class T1, class T2, class T3, class T4, class R> -HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv) +template<class T, class T1, class T2, class T3, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv) { CComPtr<T> obj; CComPtr<R> result; @@ -830,6 +830,32 @@ if (FAILED(hResult)) return hResult; + hResult = obj->Initialize(initArg1, initArg2, initArg3); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + +template<class T, class T1, class T2, class T3, class T4, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4); if (FAILED(hResult)) return hResult;
10 years, 2 months
1
0
0
0
[spetreolle] 64856: [UNIATA] Update to 0.45b1. CORE-8280 #resolve
by spetreolle@svn.reactos.org
Author: spetreolle Date: Mon Oct 20 21:21:43 2014 New Revision: 64856 URL:
http://svn.reactos.org/svn/reactos?rev=64856&view=rev
Log: [UNIATA] Update to 0.45b1. CORE-8280 #resolve Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h Modified: trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_dma.cpp [iso-8859-1] Mon Oct 20 21:21:43 2014 @@ -587,10 +587,8 @@ case ATA_PROMISE_ID: if(ChipType == PRNEW) { ULONG Channel = deviceExtension->Channel + lChannel; + if(chan->ChannelCtrlFlags & CTRFLAGS_LBA48) { - AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, - AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) | - (Channel ? 0x08 : 0x02)); AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), ((Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? 0x05000000 : 0x06000000) | (Srb->DataTransferLength >> 1) ); @@ -659,10 +657,12 @@ case ATA_PROMISE_ID: if(ChipType == PRNEW) { ULONG Channel = deviceExtension->Channel + lChannel; +/* + AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) & + ~(Channel ? 0x08 : 0x02)); +*/ if(chan->ChannelCtrlFlags & CTRFLAGS_LBA48) { - AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, - AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) & - ~(Channel ? 0x08 : 0x02)); AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),(Channel ? 0x24 : 0x20), 0 ); @@ -1555,10 +1555,13 @@ return; break; } - case ATA_PROMISE_ID: + case ATA_PROMISE_ID: { /***********/ /* Promise */ /***********/ + + UCHAR sel66 = Channel ? 0x08: 0x02; + if(ChipType < PRTX) { if (isAtapi) { udmamode = @@ -1566,12 +1569,29 @@ } } for(i=udmamode; i>=0; i--) { + + if(ChipType == PRNEW) { + if(i>2) { + AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) | + sel66); + } else { + AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) & + ~sel66); + } + } + if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_UDMA0 + i)) { promise_timing(deviceExtension, dev, (UCHAR)(ATA_UDMA + i)); // ??? return; } } - + if(ChipType == PRNEW) { + AtapiWritePortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11, + AtapiReadPortEx1(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x11) & + ~sel66); + } for(i=wdmamode; i>=0; i--) { if(AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_WDMA0 + i)) { promise_timing(deviceExtension, dev, (UCHAR)(ATA_WDMA0+i)); @@ -1587,7 +1607,7 @@ AtaSetTransferMode(deviceExtension, DeviceNumber, lChannel, LunExt, ATA_PIO0 + apiomode); promise_timing(deviceExtension, dev, ATA_PIO0 + apiomode); return; - break; + break; } case ATA_ATI_ID: KdPrint2((PRINT_PREFIX "ATI\n")); Modified: trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] Mon Oct 20 21:21:43 2014 @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45b" -#define UNIATA_VER_DOT 0.45.2.0 +#define UNIATA_VER_STR "45b1" +#define UNIATA_VER_DOT 0.45.2.1 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 #define UNIATA_VER_SUB_MJ 2 -#define UNIATA_VER_SUB_MN 0 -#define UNIATA_VER_DOT_COMMA 0,45,2,0 -#define UNIATA_VER_DOT_STR "0.45.2.0" +#define UNIATA_VER_SUB_MN 1 +#define UNIATA_VER_DOT_COMMA 0,45,2,1 +#define UNIATA_VER_DOT_STR "0.45.2.1" #define UNIATA_VER_YEAR 2014 #define UNIATA_VER_YEAR_STR "2014"
10 years, 2 months
1
0
0
0
[spetreolle] 64855: [UNIATA] Update to 0.45b. CORE-8280
by spetreolle@svn.reactos.org
Author: spetreolle Date: Mon Oct 20 21:20:35 2014 New Revision: 64855 URL:
http://svn.reactos.org/svn/reactos?rev=64855&view=rev
Log: [UNIATA] Update to 0.45b. CORE-8280 Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Mon Oct 20 21:20:35 2014 @@ -1692,7 +1692,7 @@ deviceExtension->FullIdentifyData.NVCache_Version )); - KdPrint2((PRINT_PREFIX "R-rate %#x\n", + KdPrint2((PRINT_PREFIX "R-rate %d\n", deviceExtension->FullIdentifyData.NominalMediaRotationRate )); @@ -5071,9 +5071,9 @@ if(AtaReq->retry < MAX_RETRIES) { //fallback_pio: if(!(deviceExtension->HwFlags & UNIATA_AHCI)) { - AtaReq->Flags &= ~REQ_FLAG_DMA_OPERATION; + //AtaReq->Flags &= ~REQ_FLAG_DMA_OPERATION; + // Downrate will happen in AtapiDmaReinit(), try UDMA-2 for HDD only AtaReq->Flags |= REQ_FLAG_FORCE_DOWNRATE; -// LunExt->DeviceFlags |= DFLAGS_FORCE_DOWNRATE; } AtaReq->ReqState = REQ_STATE_QUEUED; goto reenqueue_req; @@ -5093,6 +5093,7 @@ ((error >> 4) == SCSI_SENSE_HARDWARE_ERROR)) { if(AtaReq->retry < MAX_RETRIES) { //fallback_pio: + // Downrate will happen in AtapiDmaReinit(), use PIO immediately for ATAPI AtaReq->Flags &= ~REQ_FLAG_DMA_OPERATION; AtaReq->Flags |= REQ_FLAG_FORCE_DOWNRATE; // LunExt->DeviceFlags |= DFLAGS_FORCE_DOWNRATE; @@ -5449,6 +5450,7 @@ chan->ChannelCtrlFlags &= ~CTRFLAGS_DMA_OPERATION; goto CompleteRequest; } +continue_read_drq: // Ensure that this is a read command. if (srb->SrbFlags & SRB_FLAGS_DATA_IN) { @@ -5489,7 +5491,6 @@ } } } - } else { KdPrint2((PRINT_PREFIX "IdeIntr: Read %#x Dwords\n", wordCount/2)); @@ -5580,6 +5581,12 @@ status = SRB_STATUS_SUCCESS; goto CompleteRequest; + } + } else { + if(!atapiDev && !DataOverrun && (srb->SrbFlags & SRB_FLAGS_DATA_IN) && + (statusByte == (IDE_STATUS_IDLE | IDE_STATUS_DRQ))) { + KdPrint2((PRINT_PREFIX " HDD read data ready \n")); + goto continue_read_drq; } } } @@ -6689,6 +6696,7 @@ // Adjust buffer address and words left count. AtaReq->WordsLeft -= wordCount; AtaReq->DataBuffer += wordCount; + AtaReq->WordsTransfered += wordCount; // Wait for interrupt. return SRB_STATUS_PENDING; Modified: trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/id_sata.cpp [iso-8859-1] Mon Oct 20 21:20:35 2014 @@ -968,6 +968,12 @@ KdPrint2((PRINT_PREFIX "\n")); /* get the number of HW channels */ + + /* CAP.NOP sometimes indicate the index of the last enabled + * port, at other times, that of the last possible port, so + * determining the maximum port number requires looking at + * both CAP.NOP and PI. + */ PI = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_PI); deviceExtension->AHCI_PI = PI; KdPrint2((PRINT_PREFIX " AHCI PI %#x\n", PI)); Modified: trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
============================================================================== --- trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] (original) +++ trunk/reactos/drivers/storage/ide/uniata/uniata_ver.h [iso-8859-1] Mon Oct 20 21:20:35 2014 @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "45a8" -#define UNIATA_VER_DOT 0.45.1.8 +#define UNIATA_VER_STR "45b" +#define UNIATA_VER_DOT 0.45.2.0 #define UNIATA_VER_MJ 0 #define UNIATA_VER_MN 45 -#define UNIATA_VER_SUB_MJ 1 -#define UNIATA_VER_SUB_MN 8 -#define UNIATA_VER_DOT_COMMA 0,45,1,8 -#define UNIATA_VER_DOT_STR "0.45.1.8" +#define UNIATA_VER_SUB_MJ 2 +#define UNIATA_VER_SUB_MN 0 +#define UNIATA_VER_DOT_COMMA 0,45,2,0 +#define UNIATA_VER_DOT_STR "0.45.2.0" #define UNIATA_VER_YEAR 2014 #define UNIATA_VER_YEAR_STR "2014"
10 years, 2 months
1
0
0
0
[dquintana] 64854: [RSHELL] [SHELL32] [BROWSEUI] * Move undocshell.h to a shared location, and move some shared utility functions into it. * Replace all the COM object constructor functions with ge...
by dquintana@svn.reactos.org
Author: dquintana Date: Mon Oct 20 21:09:55 2014 New Revision: 64854 URL:
http://svn.reactos.org/svn/reactos?rev=64854&view=rev
Log: [RSHELL] [SHELL32] [BROWSEUI] * Move undocshell.h to a shared location, and move some shared utility functions into it. * Replace all the COM object constructor functions with generic equivalents. * Fixes a big bunch of "problems" found by Coverity Scan, but I don't have the list of CID at the moment. Added: branches/shell-experiments/include/reactos/undocshell.h - copied, changed from r64853, branches/shell-experiments/dll/win32/shell32/undocshell.h Removed: branches/shell-experiments/dll/win32/shell32/undocshell.h Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp branches/shell-experiments/base/shell/rshell/CMenuSite.cpp branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp branches/shell-experiments/base/shell/rshell/precomp.h branches/shell-experiments/dll/win32/browseui/addressband.cpp branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp branches/shell-experiments/dll/win32/browseui/bandproxy.cpp branches/shell-experiments/dll/win32/browseui/basebar.cpp branches/shell-experiments/dll/win32/browseui/basebarsite.cpp branches/shell-experiments/dll/win32/browseui/brandband.cpp branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp branches/shell-experiments/dll/win32/browseui/precomp.h branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp branches/shell-experiments/dll/win32/browseui/toolsband.cpp branches/shell-experiments/dll/win32/browseui/travellog.cpp branches/shell-experiments/dll/win32/shell32/dataobject.cpp branches/shell-experiments/dll/win32/shell32/enumidlist.cpp branches/shell-experiments/dll/win32/shell32/extracticon.cpp branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp branches/shell-experiments/dll/win32/shell32/folders/fs.cpp branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp branches/shell-experiments/dll/win32/shell32/folders/printers.cpp branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp branches/shell-experiments/dll/win32/shell32/precomp.h branches/shell-experiments/dll/win32/shell32/shellole.cpp branches/shell-experiments/dll/win32/shell32/shlview.cpp Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -35,27 +35,7 @@ extern "C" HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv) { - HRESULT hr; -#if USE_SYSTEM_MENUBAND - hr = CoCreateInstance(CLSID_MenuBand, - NULL, - CLSCTX_INPROC_SERVER, - riid, ppv); -#else - *ppv = NULL; - - CMenuBand * site = new CComObject<CMenuBand>(); - - if (!site) - return E_OUTOFMEMORY; - - hr = site->QueryInterface(riid, ppv); - - if (FAILED_UNEXPECTEDLY(hr)) - delete site; -#endif - - return hr; + return ShellObjectCreator<CMenuBand>(riid, ppv); } CMenuBand::CMenuBand() : 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] Mon Oct 20 21:09:55 2014 @@ -30,27 +30,7 @@ extern "C" HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv) { - HRESULT hr; -#if USE_SYSTEM_MENUDESKBAR - hr = CoCreateInstance(CLSID_MenuDeskBar, - NULL, - CLSCTX_INPROC_SERVER, - riid, ppv); -#else - *ppv = NULL; - - CMenuDeskBar * deskbar = new CComObject<CMenuDeskBar>(); - - if (!deskbar) - return E_OUTOFMEMORY; - - hr = deskbar->QueryInterface(riid, ppv); - - if (FAILED_UNEXPECTEDLY(hr)) - delete deskbar; - -#endif - return hr; + return ShellObjectCreator<CMenuDeskBar>(riid, ppv); } CMenuDeskBar::CMenuDeskBar() : Modified: branches/shell-experiments/base/shell/rshell/CMenuSite.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -28,27 +28,7 @@ extern "C" HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv) { - HRESULT hr; -#if USE_SYSTEM_MENUSITE - hr = CoCreateInstance(CLSID_MenuBandSite, - NULL, - CLSCTX_INPROC_SERVER, - riid, ppv); -#else - *ppv = NULL; - - CMenuSite * site = new CComObject<CMenuSite>(); - - if (!site) - return E_OUTOFMEMORY; - - hr = site->QueryInterface(riid, ppv); - - if (FAILED_UNEXPECTEDLY(hr)) - delete site; -#endif - - return hr; + return ShellObjectCreator<CMenuSite>(riid, ppv); } CMenuSite::CMenuSite() : Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -356,20 +356,7 @@ extern "C" HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv) { - *ppv = NULL; - - CMergedFolder * fld = new CComObject<CMergedFolder>(); - - if (!fld) - return E_OUTOFMEMORY; - - HRESULT hr; - - hr = fld->QueryInterface(riid, ppv); - if (FAILED_UNEXPECTEDLY(hr)) - delete fld; - - return hr; + return ShellObjectCreator<CMergedFolder>(riid, ppv); } CMergedFolder::CMergedFolder() : Modified: branches/shell-experiments/base/shell/rshell/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
============================================================================== --- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -53,6 +53,8 @@ #include <atlbase.h> #include <atlcom.h> +#include <undocshell.h> + #include <wine/debug.h> #if _MSC_VER @@ -73,115 +75,3 @@ extern "C" HRESULT WINAPI CMenuBand_Wrapper(IShellMenu * sm, REFIID riid, LPVOID *ppv); extern "C" HRESULT WINAPI CMergedFolder_Constructor(REFIID riid, LPVOID *ppv); extern "C" HRESULT WINAPI CStartMenuSite_Wrapper(ITrayPriv * trayPriv, REFIID riid, LPVOID *ppv); - -static __inline ULONG -Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) -{ - char szMsg[512]; - char *szMsgStart; - const char *fname; - va_list vl; - ULONG uRet; - - fname = strrchr(filename, '\\'); - if (fname == NULL) - { - fname = strrchr(filename, '/'); - } - - if (fname == NULL) - fname = filename; - else - fname++; - - szMsgStart = szMsg + sprintf(szMsg, "[%10lu] %s:%d: ", GetTickCount(), fname, line); - - va_start(vl, lpFormat); - uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl); - va_end(vl); - - OutputDebugStringA(szMsg); - - return uRet; -} - -#define DbgPrint(fmt, ...) \ - Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__) - -#if 1 -#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE)) -#else -#define FAILED_UNEXPECTEDLY(hr) FAILED(hr) -#endif - - -template <class Base> -class CComDebugObject : public Base -{ -public: - CComDebugObject(void * = NULL) - { - _pAtlModule->Lock(); - } - - virtual ~CComDebugObject() - { - this->FinalRelease(); - _pAtlModule->Unlock(); - } - - STDMETHOD_(ULONG, AddRef)() - { - int rc = this->InternalAddRef(); - DbgPrint("RefCount is now %d(++)!\n", rc); - return rc; - } - - STDMETHOD_(ULONG, Release)() - { - ULONG newRefCount; - - newRefCount = this->InternalRelease(); - DbgPrint("RefCount is now %d(--)!\n", newRefCount); - if (newRefCount == 0) - delete this; - return newRefCount; - } - - STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject) - { - return this->_InternalQueryInterface(iid, ppvObject); - } - - static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp) - { - CComDebugObject<Base> *newInstance; - HRESULT hResult; - - ATLASSERT(pp != NULL); - if (pp == NULL) - return E_POINTER; - - hResult = E_OUTOFMEMORY; - newInstance = NULL; - ATLTRY(newInstance = new CComDebugObject<Base>()) - if (newInstance != NULL) - { - newInstance->SetVoid(NULL); - newInstance->InternalFinalConstructAddRef(); - hResult = newInstance->_AtlInitialConstruct(); - if (SUCCEEDED(hResult)) - hResult = newInstance->FinalConstruct(); - if (SUCCEEDED(hResult)) - hResult = newInstance->_AtlFinalConstruct(); - newInstance->InternalFinalConstructRelease(); - if (hResult != S_OK) - { - delete newInstance; - newInstance = NULL; - } - } - *pp = newInstance; - return hResult; - } -}; 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] Mon Oct 20 21:09:55 2014 @@ -668,20 +668,5 @@ HRESULT CreateAddressBand(REFIID riid, void **ppv) { - CAddressBand *theMenuBar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theMenuBar = new CComObject<CAddressBand>); - if (theMenuBar == NULL) - return E_OUTOFMEMORY; - hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theMenuBar; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CAddressBand>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -283,20 +283,5 @@ HRESULT CreateAddressEditBox(REFIID riid, void **ppv) { - CComObject<CAddressEditBox> *theMenuBar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theMenuBar = new CComObject<CAddressEditBox>); - if (theMenuBar == NULL) - return E_OUTOFMEMORY; - hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theMenuBar; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CAddressEditBox>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/bandproxy.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/bandproxy.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -133,20 +133,5 @@ HRESULT CreateBandProxy(REFIID riid, void **ppv) { - CComObject<CBandProxy> *theBandProxy; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theBandProxy = new CComObject<CBandProxy>); - if (theBandProxy == NULL) - return E_OUTOFMEMORY; - hResult = theBandProxy->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theBandProxy; - return hResult; - } - return S_OK; + return ShellObjectCreator<CBandProxy>(riid, ppv); } Modified: branches/shell-experiments/dll/win32/browseui/basebar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/basebar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/basebar.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -514,20 +514,5 @@ HRESULT CreateBaseBar(REFIID riid, void **ppv) { - CComObject<CBaseBar> *theBaseBar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theBaseBar = new CComObject<CBaseBar>); - if (theBaseBar == NULL) - return E_OUTOFMEMORY; - hResult = theBaseBar->QueryInterface (riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theBaseBar; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CBaseBar>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/basebarsite.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/basebarsite.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/basebarsite.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -477,20 +477,5 @@ HRESULT CreateBaseBarSite(REFIID riid, void **ppv) { - CComObject<CBaseBarSite> *theBaseBarSite; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theBaseBarSite = new CComObject<CBaseBarSite>); - if (theBaseBarSite == NULL) - return E_OUTOFMEMORY; - hResult = theBaseBarSite->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theBaseBarSite; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CBaseBarSite>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/brandband.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/brandband.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -470,20 +470,5 @@ HRESULT CreateBrandBand(REFIID riid, void **ppv) { - CComObject<CBrandBand> *theMenuBar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theMenuBar = new CComObject<CBrandBand>); - if (theMenuBar == NULL) - return E_OUTOFMEMORY; - hResult = theMenuBar->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theMenuBar; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CBrandBand>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -437,7 +437,11 @@ CComPtr<IShellFolder> psfCommonFavorites; CComPtr<IAugmentedShellFolder> pasf; - *ppsfFavorites = NULL; + if (ppsfFavorites) + *ppsfFavorites = NULL; + + if (ppidl) + *ppidl = NULL; hr = SHGetSpecialFolderLocation(NULL, CSIDL_FAVORITES, &pidlUserFavorites); if (FAILED(hr)) @@ -498,6 +502,8 @@ hr = pasf->QueryInterface(IID_PPV_ARG(IShellFolder, ppsfFavorites)); pasf.Release(); + + // TODO: obtain the folder's PIDL ILFree(pidlCommonFavorites); ILFree(pidlUserFavorites); @@ -578,7 +584,8 @@ return hResult; hResult = newMenu->SetShellFolder(favoritesFolder, favoritesPIDL, orderRegKey, SMSET_BOTTOM | SMINIT_CACHED | SMINV_ID); - ILFree(favoritesPIDL); + if (favoritesPIDL) + ILFree(favoritesPIDL); if (SUCCEEDED(hResult)) fFavoritesMenu.Attach(newMenu.Detach()); } @@ -1989,20 +1996,5 @@ HRESULT CreateInternetToolbar(REFIID riid, void **ppv) { - CInternetToolbar *theToolbar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theToolbar = new CComObject<CInternetToolbar>); - if (theToolbar == NULL) - return E_OUTOFMEMORY; - hResult = theToolbar->QueryInterface (riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theToolbar; - return hResult; - } - return S_OK; -} + return ShellObjectCreator<CInternetToolbar>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/browseui/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/precomp.h [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -23,6 +23,7 @@ #include <exdispid.h> #include <shlwapi.h> #include <shlwapi_undoc.h> +#include <undocshell.h> #include <wine/debug.h> #include "resource.h" @@ -40,161 +41,6 @@ #include "regtreeoptions.h" #include <stdio.h> -static __inline ULONG -Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) -{ - char szMsg[512]; - char *szMsgStart; - const char *fname; - va_list vl; - ULONG uRet; - - fname = strrchr(filename, '\\'); - if (fname == NULL) - { - fname = strrchr(filename, '/'); - if (fname != NULL) - fname++; - } - else - fname++; - - if (fname == NULL) - fname = filename; - - szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line); - - va_start(vl, lpFormat); - uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl); - va_end(vl); - - OutputDebugStringA(szMsg); - - return uRet; -} - -#define DbgPrint(fmt, ...) \ - Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__) - -static void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel) -{ - WCHAR label[128]; - - padding[padlevel] = '.'; - padding[padlevel + 1] = '.'; - padding[padlevel + 2] = 0; - - int count = GetMenuItemCount(hmenu); - for (int i = 0; i < count; i++) - { - MENUITEMINFOW mii = { 0 }; - - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID; - mii.dwTypeData = label; - mii.cch = _countof(label); - - GetMenuItemInfo(hmenu, i, TRUE, &mii); - - if (mii.fType & MFT_BITMAP) - DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); - else if (mii.fType & MFT_SEPARATOR) - DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID); - else - DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); - - if (mii.hSubMenu) - DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2); - - } - - padding[padlevel] = 0; -} - -static __inline void DbgDumpMenu(HMENU hmenu) -{ - char padding[128]; - DbgDumpMenuInternal(hmenu, padding, 0); -} - -#if 1 -#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE)) -#else -#define FAILED_UNEXPECTEDLY(hr) FAILED(hr) -#endif - - -template <class Base> -class CComDebugObject : public Base -{ -public: - CComDebugObject(void * = NULL) - { - _pAtlModule->Lock(); - } - - virtual ~CComDebugObject() - { - this->FinalRelease(); - _pAtlModule->Unlock(); - } - - STDMETHOD_(ULONG, AddRef)() - { - int rc = this->InternalAddRef(); - DbgPrint("RefCount is now %d(++)!\n", rc); - return rc; - } - - STDMETHOD_(ULONG, Release)() - { - ULONG newRefCount; - - newRefCount = this->InternalRelease(); - DbgPrint("RefCount is now %d(--)!\n", newRefCount); - if (newRefCount == 0) - delete this; - return newRefCount; - } - - STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject) - { - return this->_InternalQueryInterface(iid, ppvObject); - } - - static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp) - { - CComDebugObject<Base> *newInstance; - HRESULT hResult; - - ATLASSERT(pp != NULL); - if (pp == NULL) - return E_POINTER; - - hResult = E_OUTOFMEMORY; - newInstance = NULL; - ATLTRY(newInstance = new CComDebugObject<Base>()) - if (newInstance != NULL) - { - newInstance->SetVoid(NULL); - newInstance->InternalFinalConstructAddRef(); - hResult = newInstance->_AtlInitialConstruct(); - if (SUCCEEDED(hResult)) - hResult = newInstance->FinalConstruct(); - if (SUCCEEDED(hResult)) - hResult = newInstance->_AtlFinalConstruct(); - newInstance->InternalFinalConstructRelease(); - if (hResult != S_OK) - { - delete newInstance; - newInstance = NULL; - } - } - *pp = newInstance; - return hResult; - } -}; - WINE_DEFAULT_DEBUG_CHANNEL(browseui); #endif /* _BROWSEUI_PCH_ */ Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -3431,15 +3431,11 @@ DispatchMessage(&Msg); } } - - //TerminateProcess(GetCurrentProcess(), hResult); int nrc = theCabinet->Release(); if (nrc > 0) { - DbgPrint("WARNING: There are %d references to the CShellBrowser active or leaked, process will never terminate. Terminating forcefully.\n", nrc); - - //TerminateProcess(GetCurrentProcess(), 1); + DbgPrint("WARNING: There are %d references to the CShellBrowser active or leaked.\n", nrc); } theCabinet.Detach(); Modified: branches/shell-experiments/dll/win32/browseui/toolsband.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/toolsband.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -313,15 +313,11 @@ BITMAP bitmapInfo; GetObjectW(imgNormal, sizeof(bitmapInfo), &bitmapInfo); HIMAGELIST himlNormal = ImageList_Create(bitmapInfo.bmHeight, bitmapInfo.bmHeight, ILC_COLOR32, 4, 4); - ImageList_Add(himlNormal, imgNormal, NULL); - DeleteObject(imgNormal); GetObjectW(imgHot, sizeof(bitmapInfo), &bitmapInfo); HIMAGELIST himlHot = ImageList_Create(bitmapInfo.bmHeight, bitmapInfo.bmHeight, ILC_COLOR32, 4, 4); - ImageList_Add(himlHot, imgHot, NULL); - DeleteObject(imgHot); SendMessage(TB_SETIMAGELIST, 0, (LPARAM) himlNormal); SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM) himlHot); @@ -329,6 +325,11 @@ SendMessage(TB_ADDBUTTONSW, numShownButtons, (LPARAM)&tbButtonsAdd); + if (imgNormal) + DeleteObject(imgNormal); + if (imgHot) + DeleteObject(imgHot); + return hResult; } @@ -440,21 +441,6 @@ HRESULT CreateToolsBar(REFIID riid, void **ppv) { - CToolsBand *theToolbar; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(theToolbar = new CComObject<CToolsBand>); - if (theToolbar == NULL) - return E_OUTOFMEMORY; - hResult = theToolbar->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theToolbar; - return hResult; - } - return S_OK; -} - + return ShellObjectCreator<CToolsBand>(riid, ppv); +} + Modified: branches/shell-experiments/dll/win32/browseui/travellog.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
============================================================================== --- branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/browseui/travellog.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -621,23 +621,5 @@ HRESULT CreateTravelLog(REFIID riid, void **ppv) { - CComObject<CTravelLog> *theTravelLog; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theTravelLog = new CComObject<CTravelLog>); - if (theTravelLog == NULL) - return E_OUTOFMEMORY; - hResult = theTravelLog->QueryInterface(riid, reinterpret_cast<void **>(ppv)); - if (FAILED_UNEXPECTEDLY(hResult)) - { - delete theTravelLog; - return hResult; - } - hResult = theTravelLog->Initialize(); - if (FAILED_UNEXPECTEDLY(hResult)) - return hResult; - return S_OK; -} + return ShellObjectCreatorInit<CTravelLog>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/shell32/dataobject.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/dataobject.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/dataobject.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -127,30 +127,9 @@ return (*ppenum)->Skip(posFmt); } -HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **enumerator) -{ - CComObject<IEnumFORMATETCImpl> *theEnumerator; - CComPtr<IEnumFORMATETC> result; - HRESULT hResult; - - if (enumerator == NULL) - return E_POINTER; - *enumerator = NULL; - ATLTRY (theEnumerator = new CComObject<IEnumFORMATETCImpl>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface (IID_PPV_ARG(IEnumFORMATETC, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (cfmt, afmt); - if (FAILED (hResult)) - return hResult; - *enumerator = result.Detach (); - TRACE("(%p)->(%u,%p)\n", *enumerator, cfmt, afmt); - return S_OK; +HRESULT IEnumFORMATETC_Constructor(UINT cfmt, const FORMATETC afmt[], IEnumFORMATETC **ppFormat) +{ + return ShellObjectCreatorInit<IEnumFORMATETCImpl>(cfmt, afmt, IID_IEnumFORMATETC, ppFormat); } @@ -416,28 +395,7 @@ */ HRESULT IDataObject_Constructor(HWND hwndOwner, LPCITEMIDLIST pMyPidl, LPCITEMIDLIST * apidl, UINT cidl, IDataObject **dataObject) { - CComObject<IDataObjectImpl> *theDataObject; - CComPtr<IDataObject> result; - HRESULT hResult; - - if (dataObject == NULL) - return E_POINTER; - *dataObject = NULL; - ATLTRY (theDataObject = new CComObject<IDataObjectImpl>); - if (theDataObject == NULL) - return E_OUTOFMEMORY; - hResult = theDataObject->QueryInterface(IID_PPV_ARG(IDataObject, &result)); - if (FAILED (hResult)) - { - delete theDataObject; - return hResult; - } - hResult = theDataObject->Initialize (hwndOwner, pMyPidl, apidl, cidl); - if (FAILED (hResult)) - return hResult; - *dataObject = result.Detach (); - TRACE("(%p)->(apidl=%p cidl=%u)\n", *dataObject, apidl, cidl); - return S_OK; + return ShellObjectCreatorInit<IDataObjectImpl>(hwndOwner, pMyPidl, apidl, cidl, IID_IDataObject, dataObject); } /************************************************************************* Modified: branches/shell-experiments/dll/win32/shell32/enumidlist.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/enumidlist.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/enumidlist.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -281,22 +281,5 @@ */ HRESULT IEnumIDList_Constructor(IEnumIDList **enumerator) { - CComObject<IEnumIDListImpl> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - if (enumerator == NULL) - return E_POINTER; - *enumerator = NULL; - ATLTRY (theEnumerator = new CComObject<IEnumIDListImpl>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - *enumerator = result.Detach (); - return S_OK; -} + return ShellObjectCreator<IEnumIDListImpl>(IID_IEnumIDList, enumerator); +} Modified: branches/shell-experiments/dll/win32/shell32/extracticon.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/extracticon.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/extracticon.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -337,22 +337,5 @@ HRESULT WINAPI SHCreateDefaultExtractIcon(REFIID riid, void **ppv) { - CComObject<IconExtraction> *theExtractor; - CComPtr<IUnknown> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theExtractor = new CComObject<IconExtraction>); - if (theExtractor == NULL) - return E_OUTOFMEMORY; - hResult = theExtractor->QueryInterface (riid, (void **)&result); - if (FAILED (hResult)) - { - delete theExtractor; - return hResult; - } - *ppv = result.Detach (); - return S_OK; -} + return ShellObjectCreator<IconExtraction>(riid, ppv); +} Modified: branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/admintools.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -136,32 +136,7 @@ */ HRESULT WINAPI CAdminToolsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CDesktopFolderEnumY> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumY>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (szTarget, dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach (); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CDesktopFolderEnumY>(szTarget, dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/cpanel.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -371,37 +371,9 @@ /************************************************************************** * CControlPanelFolder::EnumObjects */ -HRESULT WINAPI CControlPanelFolder::EnumObjects( - HWND hwndOwner, - DWORD dwFlags, - LPENUMIDLIST *ppEnumIDList) -{ - CComObject<CControlPanelEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CControlPanelEnum>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach (); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; +HRESULT WINAPI CControlPanelFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) +{ + return ShellObjectCreatorInit<CControlPanelEnum>(dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/desktop.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -421,41 +421,9 @@ /************************************************************************** * CDesktopFolder::EnumObjects */ -HRESULT WINAPI CDesktopFolder::EnumObjects( - HWND hwndOwner, - DWORD dwFlags, - LPENUMIDLIST *ppEnumIDList) -{ - CComObject<CDesktopFolderEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - - ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnum>); - - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - - hResult = theEnumerator->Initialize (this, hwndOwner, dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach (); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; +HRESULT WINAPI CDesktopFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) +{ + return ShellObjectCreatorInit<CDesktopFolderEnum>(this, hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/fonts.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -219,32 +219,7 @@ */ HRESULT WINAPI CFontsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CDesktopFolderEnumZ> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CDesktopFolderEnumZ>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach (); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CDesktopFolderEnumZ>(dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/fs.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/fs.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -260,32 +260,7 @@ DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CFileSysEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CFileSysEnum>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED(hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize (sPathTarget, dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach(); - - TRACE("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CFileSysEnum>(sPathTarget, dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/mycomp.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -252,36 +252,7 @@ */ HRESULT WINAPI CDrivesFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CDrivesFolderEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - - *ppEnumIDList = NULL; - ATLTRY(theEnumerator = new CComObject<CDrivesFolderEnum>); - - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - - hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result); - if (FAILED(hResult)) - { - delete theEnumerator; - return hResult; - } - - hResult = theEnumerator->Initialize(hwndOwner, dwFlags); - if (FAILED(hResult)) - return hResult; - *ppEnumIDList = result.Detach(); - - TRACE("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CDrivesFolderEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/mydocuments.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -214,32 +214,7 @@ */ HRESULT WINAPI CMyDocsFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CFileSysEnumX> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CFileSysEnumX>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_IEnumIDList, (void **)&result); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize(dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach(); - - TRACE("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CFileSysEnumX>(dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/printers.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/printers.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -185,27 +185,7 @@ */ static HRESULT WINAPI IEI_Printers_Constructor(LPCITEMIDLIST pidl, REFIID riid, IUnknown **ppv) { - CComObject<CPrintersExtractIconW> *theExtractor; - CComPtr<IUnknown> result; - HRESULT hResult; - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY (theExtractor = new CComObject<CPrintersExtractIconW>); - if (theExtractor == NULL) - return E_OUTOFMEMORY; - hResult = theExtractor->QueryInterface(riid, (void **)&result); - if (FAILED (hResult)) - { - delete theExtractor; - return hResult; - } - hResult = theExtractor->Initialize(pidl); - if (FAILED (hResult)) - return hResult; - *ppv = result.Detach(); - return S_OK; + return ShellObjectCreatorInit<CPrintersExtractIconW>(pidl, riid, ppv); } /*********************************************************************** @@ -379,32 +359,7 @@ */ HRESULT WINAPI CPrinterFolder::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList) { - CComObject<CPrintersEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CPrintersEnum>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize(hwndOwner, dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach(); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CPrintersEnum>(hwndOwner, dwFlags, IID_IEnumIDList, ppEnumIDList); } /************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/folders/recyclebin.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -403,34 +403,6 @@ return E_NOTIMPL; } -static HRESULT WINAPI CRecycleBinItemContextMenuConstructor(REFIID riid, LPCITEMIDLIST pidl, LPVOID *ppv) -{ - CComObject<CRecycleBinItemContextMenu> *theMenu; - CComPtr<IUnknown> result; - HRESULT hResult; - - TRACE("%s\n", shdebugstr_guid(&riid)); - - if (ppv == NULL) - return E_POINTER; - *ppv = NULL; - ATLTRY(theMenu = new CComObject<CRecycleBinItemContextMenu>); - if (theMenu == NULL) - return E_OUTOFMEMORY; - hResult = theMenu->QueryInterface(riid, (void **)&result); - if (FAILED(hResult)) - { - delete theMenu; - return hResult; - } - hResult = theMenu->Initialize(pidl); - if (FAILED(hResult)) - return hResult; - *ppv = result.Detach(); - TRACE ("--(%p)\n", *ppv); - return S_OK; -} - /************************************************************************** * registers clipboardformat once */ @@ -509,32 +481,7 @@ HRESULT WINAPI CRecycleBin::EnumObjects(HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST *ppEnumIDList) { - CComObject<CRecycleBinEnum> *theEnumerator; - CComPtr<IEnumIDList> result; - HRESULT hResult; - - TRACE ("(%p)->(HWND=%p flags=0x%08x pplist=%p)\n", this, hwndOwner, dwFlags, ppEnumIDList); - - if (ppEnumIDList == NULL) - return E_POINTER; - *ppEnumIDList = NULL; - ATLTRY (theEnumerator = new CComObject<CRecycleBinEnum>); - if (theEnumerator == NULL) - return E_OUTOFMEMORY; - hResult = theEnumerator->QueryInterface(IID_PPV_ARG(IEnumIDList, &result)); - if (FAILED (hResult)) - { - delete theEnumerator; - return hResult; - } - hResult = theEnumerator->Initialize(dwFlags); - if (FAILED (hResult)) - return hResult; - *ppEnumIDList = result.Detach(); - - TRACE ("-- (%p)->(new ID List: %p)\n", this, *ppEnumIDList); - - return S_OK; + return ShellObjectCreatorInit<CRecycleBinEnum>(dwFlags, IID_IEnumIDList, ppEnumIDList); } HRESULT WINAPI CRecycleBin::BindToObject(PCUIDLIST_RELATIVE pidl, LPBC pbc, REFIID riid, void **ppv) @@ -617,12 +564,12 @@ if ((IsEqualIID (riid, IID_IContextMenu) || IsEqualIID(riid, IID_IContextMenu2)) && (cidl >= 1)) { - hr = CRecycleBinItemContextMenuConstructor(riid, apidl[0], (void **)&pObj); + hr = ShellObjectCreatorInit<CRecycleBinItemContextMenu>(apidl[0], riid, &pObj); } else if (IsEqualIID (riid, IID_IDropTarget) && (cidl == 1)) { IDropTarget * pDt = NULL; - hr = this->QueryInterface(IID_PPV_ARG(IDropTarget, &pDt)); + hr = QueryInterface(IID_PPV_ARG(IDropTarget, &pDt)); pObj = pDt; } else Modified: branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/openwithmenu.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -1376,7 +1376,6 @@ { MSG msg; HWND hwnd; - COpenWithDialog *pDialog; TRACE("SHOpenWithDialog hwndParent %p poainfo %p\n", hwndParent, poainfo); @@ -1385,11 +1384,9 @@ if (poainfo->pcszClass == NULL && poainfo->pcszFile == NULL) return E_FAIL; - pDialog = new COpenWithDialog(poainfo); - if (!pDialog) - return E_OUTOFMEMORY; - - hwnd = CreateDialogParam(shell32_hInstance, MAKEINTRESOURCE(IDD_OPEN_WITH), hwndParent, COpenWithDialog::DialogProc, (LPARAM)pDialog); + COpenWithDialog pDialog(poainfo); + + hwnd = CreateDialogParam(shell32_hInstance, MAKEINTRESOURCE(IDD_OPEN_WITH), hwndParent, COpenWithDialog::DialogProc, (LPARAM)&pDialog); if (hwnd == NULL) { ERR("Failed to create dialog\n"); @@ -1407,7 +1404,5 @@ } } - delete pDialog; - return S_OK; } Modified: branches/shell-experiments/dll/win32/shell32/precomp.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/precomp.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/precomp.h [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -30,6 +30,7 @@ #include <atlbase.h> #include <atlcom.h> #include <powrprof.h> +#include <undocshell.h> //#include "base/shell/explorer-new/todo.h" //#include "dlgs.h" Modified: branches/shell-experiments/dll/win32/shell32/shellole.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shellole.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shellole.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -376,27 +376,7 @@ HRESULT IDefClF_fnConstructor(LPFNCREATEINSTANCE lpfnCI, PLONG pcRefDll, const IID *riidInst, IClassFactory **theFactory) { - CComObject<IDefClFImpl> *theClassObject; - CComPtr<IClassFactory> result; - HRESULT hResult; - - if (theFactory == NULL) - return E_POINTER; - *theFactory = NULL; - ATLTRY (theClassObject = new CComObject<IDefClFImpl>); - if (theClassObject == NULL) - return E_OUTOFMEMORY; - hResult = theClassObject->QueryInterface (IID_PPV_ARG(IClassFactory, &result)); - if (FAILED (hResult)) - { - delete theClassObject; - return hResult; - } - hResult = theClassObject->Initialize (lpfnCI, pcRefDll, riidInst); - if (FAILED (hResult)) - return hResult; - *theFactory = result.Detach (); - return S_OK; + return ShellObjectCreatorInit<IDefClFImpl>(lpfnCI, pcRefDll, riidInst, IID_IClassFactory, theFactory); } /****************************************************************************** Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -2974,30 +2974,5 @@ */ HRESULT WINAPI IShellView_Constructor(IShellFolder *pFolder, IShellView **newView) { - CComObject<CDefView> *theView; - CComPtr<IShellView> result; - HRESULT hResult; - - if (newView == NULL) - return E_POINTER; - - *newView = NULL; - ATLTRY (theView = new CComObject<CDefView>); - - if (theView == NULL) - return E_OUTOFMEMORY; - - hResult = theView->QueryInterface(IID_PPV_ARG(IShellView, &result)); - if (FAILED (hResult)) - { - delete theView; - return hResult; - } - - hResult = theView->Initialize (pFolder); - if (FAILED (hResult)) - return hResult; - *newView = result.Detach (); - - return S_OK; -} + return ShellObjectCreatorInit<CDefView>(pFolder, IID_IShellView, newView); +} Removed: branches/shell-experiments/dll/win32/shell32/undocshell.h URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/undocshell.h [iso-8859-1] (original) +++ branches/shell-experiments/dll/win32/shell32/undocshell.h (removed) @@ -1,536 +0,0 @@ -/* - * Copyright 1999, 2000 Juergen Schmied - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_UNDOCSHELL_H -#define __WINE_UNDOCSHELL_H - -#ifdef __cplusplus -extern "C" { -#endif /* defined(__cplusplus) */ - -/**************************************************************************** - * IDList Functions - */ -BOOL WINAPI ILGetDisplayName( - LPCITEMIDLIST pidl, - LPVOID path); - -/* type parameter for ILGetDisplayNameEx() */ -#define ILGDN_FORPARSING 0 -#define ILGDN_NORMAL 1 -#define ILGDN_INFOLDER 2 - -BOOL WINAPI ILGetDisplayNameEx( - LPSHELLFOLDER psf, - LPCITEMIDLIST pidl, - LPVOID path, - DWORD type); - -LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl); -void WINAPI ILGlobalFree(LPITEMIDLIST pidl); -LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath); //FIXME -LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath); - -HRESULT WINAPI SHILCreateFromPathA ( - LPCSTR path, - LPITEMIDLIST * ppidl, - DWORD *attributes); - -HRESULT WINAPI SHILCreateFromPathW ( - LPCWSTR path, - LPITEMIDLIST * ppidl, - DWORD *attributes); - -/* - string functions -*/ -BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*); -BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*); - - -/**************************************************************************** -* SHChangeNotifyRegister API -*/ -#define SHCNRF_InterruptLevel 0x0001 -#define SHCNRF_ShellLevel 0x0002 -#define SHCNRF_RecursiveInterrupt 0x1000 /* Must be combined with SHCNRF_InterruptLevel */ -#define SHCNRF_NewDelivery 0x8000 /* Messages use shared memory */ - - -/**************************************************************************** - * Shell Common Dialogs - */ - -/* RunFileDlg flags */ -#define RFF_NOBROWSE 0x01 -#define RFF_NODEFAULT 0x02 -#define RFF_CALCDIRECTORY 0x04 -#define RFF_NOLABEL 0x08 -#define RFF_NOSEPARATEMEM 0x20 /* NT only */ - -#define DE_SAMEFILE 0x71 - -/* RunFileFlg notification structure */ -typedef struct -{ - NMHDR hdr; - LPCSTR lpFile; - LPCSTR lpDirectory; - int nShow; -} NM_RUNFILEDLG, * LPNM_RUNFILEDLG; - -/* RunFileDlg notification return values */ -#define RF_OK 0x00 -#define RF_CANCEL 0x01 -#define RF_RETRY 0x02 - -void WINAPI RunFileDlg( - HWND hwndOwner, - HICON hIcon, - LPCWSTR lpstrDirectory, - LPCWSTR lpstrTitle, - LPCWSTR lpstrDescription, - UINT uFlags); - -void WINAPI ExitWindowsDialog(HWND hwndOwner); - -BOOL WINAPI SHFindComputer( - LPCITEMIDLIST pidlRoot, - LPCITEMIDLIST pidlSavedSearch); - -void WINAPI SHHandleDiskFull(HWND hwndOwner, - UINT uDrive); - -int WINAPI SHOutOfMemoryMessageBox( - HWND hwndOwner, - LPCSTR lpCaption, - UINT uType); - -DWORD WINAPI SHNetConnectionDialog( - HWND hwndOwner, - LPCWSTR lpstrRemoteName, - DWORD dwType); - -/**************************************************************************** - * Cabinet Window Messages - */ - -#define CWM_SETPATH (WM_USER + 2) -#define CWM_WANTIDLE (WM_USER + 3) -#define CWM_GETSETCURRENTINFO (WM_USER + 4) -#define CWM_SELECTITEM (WM_USER + 5) -#define CWM_SELECTITEMSTR (WM_USER + 6) -#define CWM_GETISHELLBROWSER (WM_USER + 7) -#define CWM_TESTPATH (WM_USER + 9) -#define CWM_STATECHANGE (WM_USER + 10) -#define CWM_GETPATH (WM_USER + 12) - -/* CWM_TESTPATH types */ -#define CWTP_ISEQUAL 0 -#define CWTP_ISCHILD 1 - -/* CWM_TESTPATH structure */ -typedef struct -{ - DWORD dwType; - ITEMIDLIST idl; -} CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT; - -/**************************************************************************** - * System Imagelist Routines - */ - -int WINAPI Shell_GetCachedImageIndexA( - LPCSTR lpszFileName, - int nIconIndex, - UINT bSimulateDoc); - -BOOL WINAPI Shell_GetImageLists( - HIMAGELIST *lphimlLarge, - HIMAGELIST *lphimlSmall); - -HICON WINAPI SHGetFileIcon( - DWORD dwReserved, - LPCSTR lpszPath, - DWORD dwFileAttributes, - UINT uFlags); - -BOOL WINAPI FileIconInit(BOOL bFullInit); - -/**************************************************************************** - * File Menu Routines - */ -/* FileMenu_Create nSelHeight constants */ -#define FM_DEFAULT_SELHEIGHT -1 -#define FM_FULL_SELHEIGHT 0 - -/* FileMenu_Create flags */ -#define FMF_SMALL_ICONS 0x00 -#define FMF_LARGE_ICONS 0x08 -#define FMF_NO_COLUMN_BREAK 0x10 - -HMENU WINAPI FileMenu_Create( - COLORREF crBorderColor, - int nBorderWidth, - HBITMAP hBorderBmp, - int nSelHeight, - UINT uFlags); - -void WINAPI FileMenu_Destroy(HMENU hMenu); - -/* FileMenu_AppendItem constants */ -#define FM_SEPARATOR (LPCSTR)1 -#define FM_BLANK_ICON -1 -#define FM_DEFAULT_HEIGHT 0 - -BOOL WINAPI FileMenu_AppendItem( - HMENU hMenu, - LPCSTR lpszText, - UINT uID, - int iIcon, - HMENU hMenuPopup, - int nItemHeight); - -/* FileMenu_InsertUsingPidl flags */ -#define FMF_NO_EMPTY_ITEM 0x01 -#define FMF_NO_PROGRAM_GROUPS 0x04 - -/* FileMenu_InsertUsingPidl callback function */ -typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile); - -int WINAPI FileMenu_InsertUsingPidl( - HMENU hMenu, - UINT uID, - LPCITEMIDLIST pidl, - UINT uFlags, - UINT uEnumFlags, - LPFNFMCALLBACK lpfnCallback); - -int WINAPI FileMenu_ReplaceUsingPidl( - HMENU hMenu, - UINT uID, - LPCITEMIDLIST pidl, - UINT uEnumFlags, - LPFNFMCALLBACK lpfnCallback); - -void WINAPI FileMenu_Invalidate(HMENU hMenu); - -HMENU WINAPI FileMenu_FindSubMenuByPidl( - HMENU hMenu, - LPCITEMIDLIST pidl); - -BOOL WINAPI FileMenu_TrackPopupMenuEx( - HMENU hMenu, - UINT uFlags, - int x, - int y, - HWND hWnd, - LPTPMPARAMS lptpm); - -BOOL WINAPI FileMenu_GetLastSelectedItemPidls( - UINT uReserved, - LPCITEMIDLIST *ppidlFolder, - LPCITEMIDLIST *ppidlItem); - -LRESULT WINAPI FileMenu_MeasureItem( - HWND hWnd, - LPMEASUREITEMSTRUCT lpmis); - -LRESULT WINAPI FileMenu_DrawItem( - HWND hWnd, - LPDRAWITEMSTRUCT lpdis); - -BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu); - -void WINAPI FileMenu_AbortInitMenu(void); - -LRESULT WINAPI FileMenu_HandleMenuChar( - HMENU hMenu, - WPARAM wParam); - -BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu); - -BOOL WINAPI FileMenu_DeleteItemByCmd( - HMENU hMenu, - UINT uID); - -BOOL WINAPI FileMenu_DeleteItemByIndex( - HMENU hMenu, - UINT uPos); - -BOOL WINAPI FileMenu_DeleteMenuItemByFirstID( - HMENU hMenu, - UINT uID); - -BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu); - -BOOL WINAPI FileMenu_EnableItemByCmd( - HMENU hMenu, - UINT uID, - BOOL bEnable); - -DWORD WINAPI FileMenu_GetItemExtent( - HMENU hMenu, - UINT uPos); - -int WINAPI FileMenu_AppendFilesForPidl( - HMENU hMenu, - LPCITEMIDLIST pidl, - BOOL bAddSeparator); - -int WINAPI FileMenu_AddFilesForPidl( - HMENU hMenu, - UINT uReserved, - UINT uID, - LPCITEMIDLIST pidl, - UINT uFlags, - UINT uEnumFlags, - LPFNFMCALLBACK lpfnCallback); - -/**************************************************************************** - * Drag And Drop Routines - */ - -HRESULT WINAPI SHRegisterDragDrop( - HWND hWnd, - LPDROPTARGET lpDropTarget); - -HRESULT WINAPI SHRevokeDragDrop(HWND hWnd); - -BOOL WINAPI DAD_DragEnter(HWND hWnd); - -BOOL WINAPI DAD_SetDragImageFromListView( - HWND hWnd, - POINT pt); - -BOOL WINAPI DAD_ShowDragImage(BOOL bShow); - -/**************************************************************************** - * Path Manipulation Routines - */ - -BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2); - -LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile); - -LPVOID WINAPI PathAddBackslashAW(LPVOID path); - -LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive); - -LPVOID WINAPI PathFindExtensionAW(LPCVOID path); - -LPVOID WINAPI PathFindFileNameAW(LPCVOID path); - -LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath, DWORD void1, DWORD void2); - -LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath); - -BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath); - -void WINAPI PathRemoveBlanksAW(LPVOID lpszPath); - -VOID WINAPI PathQuoteSpacesAW(LPVOID path); - -void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath); - -BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath); - -BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath); - -BOOL WINAPI PathIsRootAW(LPCVOID x); - -BOOL WINAPI PathIsExeAW(LPCVOID lpszPath); - -BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath); - -BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath); - -BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec); - -BOOL WINAPI PathMakeUniqueNameAW( - LPVOID lpszBuffer, - DWORD dwBuffSize, - LPCVOID lpszShortName, - LPCVOID lpszLongName, - LPCVOID lpszPathName); - -BOOL WINAPI PathYetAnotherMakeUniqueName( - LPWSTR lpszBuffer, - LPCWSTR lpszPathName, - LPCWSTR lpszShortName, - LPCWSTR lpszLongName); - -BOOL WINAPI PathQualifyAW(LPCVOID path); - - -/* PathResolve flags */ -#define PRF_CHECKEXISTANCE 0x01 -#define PRF_EXECUTABLE 0x02 -#define PRF_QUALIFYONPATH 0x04 -#define PRF_WINDOWS31 0x08 - -BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags); - -VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath); - -/* PathProcessCommand flags */ -#define PPCF_QUOTEPATH 0x01 /* implies PPCF_INCLUDEARGS */ -#define PPCF_INCLUDEARGS 0x02 -//#define PPCF_NODIRECTORIES 0x10 move to shlobj -#define PPCF_DONTRESOLVE 0x20 -#define PPCF_PATHISRELATIVE 0x40 - -HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff, - DWORD dwBuffSize, DWORD dwFlags); - -void WINAPI PathStripPathAW(LPVOID lpszPath); - -BOOL WINAPI PathStripToRootAW(LPVOID lpszPath); - -void WINAPI PathRemoveArgsAW(LPVOID lpszPath); - -void WINAPI PathRemoveExtensionAW(LPVOID lpszPath); - -int WINAPI PathParseIconLocationAW(LPVOID lpszPath); - -BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2); - -BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID *sOtherDirs); - -/**************************************************************************** - * Shell Namespace Routines - */ - -/* Generic structure used by several messages */ -typedef struct -{ - DWORD dwReserved; - DWORD dwReserved2; - LPCITEMIDLIST pidl; - LPDWORD lpdwUser; -} SFVCBINFO, * LPSFVCBINFO; -typedef const SFVCBINFO * LPCSFVCBINFO; - -/* SFVCB_SELECTIONCHANGED structure */ -typedef struct -{ - UINT uOldState; - UINT uNewState; - LPCITEMIDLIST pidl; - LPDWORD lpdwUser; -} SFVSELECTSTATE, * LPSFVSELECTSTATE; -typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE; - -/* SFVCB_COPYHOOKCALLBACK structure */ -typedef struct -{ - HWND hwnd; - UINT wFunc; - UINT wFlags; - LPCSTR pszSrcFile; - DWORD dwSrcAttribs; - LPCSTR pszDestFile; - DWORD dwDestAttribs; -} SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO; -typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO; - -/* SFVCB_GETDETAILSOF structure */ -typedef struct -{ - LPCITEMIDLIST pidl; - int fmt; - int cx; - STRRET lpText; -} SFVCOLUMNINFO, * LPSFVCOLUMNINFO; - -/**************************************************************************** - * Misc Stuff - */ - -/* SHWaitForFileToOpen flags */ -#define SHWFF_ADD 0x01 -#define SHWFF_REMOVE 0x02 -#define SHWFF_WAIT 0x04 - -BOOL WINAPI SHWaitForFileToOpen( - LPCITEMIDLIST pidl, - DWORD dwFlags, - DWORD dwTimeout); - -WORD WINAPI ArrangeWindows( - HWND hwndParent, - DWORD dwReserved, - LPCRECT lpRect, - WORD cKids, - CONST HWND * lpKids); - -/* RegisterShellHook types */ -#define RSH_DEREGISTER 0 -#define RSH_REGISTER 1 -#define RSH_REGISTER_PROGMAN 2 -#define RSH_REGISTER_TASKMAN 3 - -BOOL WINAPI RegisterShellHook( - HWND hWnd, - DWORD dwType); - -/* SHCreateDefClassObject callback function */ -typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)( - LPUNKNOWN pUnkOuter, - REFIID riidObject, - LPVOID *ppvObject); - -HRESULT WINAPI SHCreateDefClassObject( - REFIID riidFactory, - LPVOID *ppvFactory, - LPFNCDCOCALLBACK lpfnCallback, - LPDWORD lpdwUsage, - REFIID riidObject); - -void WINAPI SHFreeUnusedLibraries(void); - -/* SHCreateLinks flags */ -#define SHCLF_PREFIXNAME 0x01 -#define SHCLF_CREATEONDESKTOP 0x02 - -HRESULT WINAPI SHCreateLinks( - HWND hWnd, - LPCSTR lpszDir, - LPDATAOBJECT lpDataObject, - UINT uFlags, - LPITEMIDLIST *lppidlLinks); - -DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len); -DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len); - -/* policy functions */ -BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey); - -/* Shell Desktop functions */ - -#define WM_GETISHELLBROWSER (WM_USER+7) - -BOOL WINAPI SHDesktopMessageLoop(HANDLE); - -#define CSIDL_FOLDER_MASK 0x00ff - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* defined(__cplusplus) */ - -#endif /* __WINE_UNDOCSHELL_H */ Copied: branches/shell-experiments/include/reactos/undocshell.h (from r64853, branches/shell-experiments/dll/win32/shell32/undocshell.h) URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/include/react…
============================================================================== --- branches/shell-experiments/dll/win32/shell32/undocshell.h [iso-8859-1] (original) +++ branches/shell-experiments/include/reactos/undocshell.h [iso-8859-1] Mon Oct 20 21:09:55 2014 @@ -529,8 +529,315 @@ #define CSIDL_FOLDER_MASK 0x00ff +/* Utility functions */ +#include <stdio.h> + +static inline ULONG +Win32DbgPrint(const char *filename, int line, const char *lpFormat, ...) +{ + char szMsg[512]; + char *szMsgStart; + const char *fname; + va_list vl; + ULONG uRet; + + fname = strrchr(filename, '\\'); + if (fname == NULL) + { + fname = strrchr(filename, '/'); + if (fname != NULL) + fname++; + } + else + fname++; + + if (fname == NULL) + fname = filename; + + szMsgStart = szMsg + sprintf(szMsg, "%s:%d: ", fname, line); + + va_start(vl, lpFormat); + uRet = (ULONG) vsprintf(szMsgStart, lpFormat, vl); + va_end(vl); + + OutputDebugStringA(szMsg); + + return uRet; +} + +#define DbgPrint(fmt, ...) \ + Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__) + +static inline void DbgDumpMenuInternal(HMENU hmenu, char* padding, int padlevel) +{ + WCHAR label[128]; + + padding[padlevel] = '.'; + padding[padlevel + 1] = '.'; + padding[padlevel + 2] = 0; + + int count = GetMenuItemCount(hmenu); + for (int i = 0; i < count; i++) + { + MENUITEMINFOW mii = { 0 }; + + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_STRING | MIIM_FTYPE | MIIM_SUBMENU | MIIM_STATE | MIIM_ID; + mii.dwTypeData = label; + mii.cch = _countof(label); + + GetMenuItemInfo(hmenu, i, TRUE, &mii); + + if (mii.fType & MFT_BITMAP) + DbgPrint("%s%2d - %08x: BITMAP %08p (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.hbmpItem, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); + else if (mii.fType & MFT_SEPARATOR) + DbgPrint("%s%2d - %08x ---SEPARATOR---\n", padding, i, mii.wID); + else + DbgPrint("%s%2d - %08x: %S (state=%d, has submenu=%s)\n", padding, i, mii.wID, mii.dwTypeData, mii.fState, mii.hSubMenu ? "TRUE" : "FALSE"); + + if (mii.hSubMenu) + DbgDumpMenuInternal(mii.hSubMenu, padding, padlevel + 2); + + } + + padding[padlevel] = 0; +} + +static __inline void DbgDumpMenu(HMENU hmenu) +{ + char padding[128]; + DbgDumpMenuInternal(hmenu, padding, 0); +} + +#if 1 +#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure %08x.\n", hr), TRUE)) +#else +#define FAILED_UNEXPECTEDLY(hr) FAILED(hr) +#endif + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ +#ifdef __cplusplus +template <class Base> +class CComDebugObject : public Base +{ +public: + CComDebugObject(void * = NULL) + { + _pAtlModule->Lock(); + } + + virtual ~CComDebugObject() + { + this->FinalRelease(); + _pAtlModule->Unlock(); + } + + STDMETHOD_(ULONG, AddRef)() + { + int rc = this->InternalAddRef(); + DbgPrint("RefCount is now %d(++)!\n", rc); + return rc; + } + + STDMETHOD_(ULONG, Release)() + { + ULONG newRefCount; + + newRefCount = this->InternalRelease(); + DbgPrint("RefCount is now %d(--)!\n", newRefCount); + if (newRefCount == 0) + delete this; + return newRefCount; + } + + STDMETHOD(QueryInterface)(REFIID iid, void **ppvObject) + { + return this->_InternalQueryInterface(iid, ppvObject); + } + + static HRESULT WINAPI CreateInstance(CComDebugObject<Base> **pp) + { + CComDebugObject<Base> *newInstance; + HRESULT hResult; + + ATLASSERT(pp != NULL); + if (pp == NULL) + return E_POINTER; + + hResult = E_OUTOFMEMORY; + newInstance = NULL; + ATLTRY(newInstance = new CComDebugObject<Base>()) + if (newInstance != NULL) + { + newInstance->SetVoid(NULL); + newInstance->InternalFinalConstructAddRef(); + hResult = newInstance->_AtlInitialConstruct(); + if (SUCCEEDED(hResult)) + hResult = newInstance->FinalConstruct(); + if (SUCCEEDED(hResult)) + hResult = newInstance->_AtlFinalConstruct(); + newInstance->InternalFinalConstructRelease(); + if (hResult != S_OK) + { + delete newInstance; + newInstance = NULL; + } + } + *pp = newInstance; + return hResult; + } +}; + +template<class T, class R> +HRESULT inline ShellObjectCreator(REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(ppv)); + if (FAILED(hResult)) + return hResult; + return S_OK; +} + +template<class T, class R> +HRESULT inline ShellObjectCreatorInit(REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + +template<class T, class T1, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(initArg1); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + +template<class T, class T1, class T2, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(initArg1, initArg2); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + +template<class T, class T1, class T2, class T3, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(initArg1, initArg2, initArg3); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} + +template<class T, class T1, class T2, class T3, class T4, class R> +HRESULT inline ShellObjectCreatorInit(T1 initArg1, T2 initArg2, T3 initArg3, T4 initArg4, REFIID riid, R ** ppv) +{ + CComPtr<T> obj; + CComPtr<R> result; + HRESULT hResult; + + if (ppv == NULL) + return E_POINTER; + *ppv = NULL; + ATLTRY(obj = new CComObject<T>); + if (obj.p == NULL) + return E_OUTOFMEMORY; + hResult = obj->QueryInterface(riid, reinterpret_cast<void **>(&result)); + if (FAILED(hResult)) + return hResult; + + hResult = obj->Initialize(initArg1, initArg2, initArg3, initArg4); + if (FAILED(hResult)) + return hResult; + + *ppv = result.Detach(); + + return S_OK; +} +#endif /* __cplusplus */ + #endif /* __WINE_UNDOCSHELL_H */
10 years, 2 months
1
0
0
0
[pschweitzer] 64853: [KERNEL32] Don't care for the return value (yet?) of StringCbPrintfW. This fixes release build.
by pschweitzer@svn.reactos.org
Author: pschweitzer Date: Mon Oct 20 20:26:07 2014 New Revision: 64853 URL:
http://svn.reactos.org/svn/reactos?rev=64853&view=rev
Log: [KERNEL32] Don't care for the return value (yet?) of StringCbPrintfW. This fixes release build. Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c Modified: trunk/reactos/dll/win32/kernel32/client/file/move.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/client/file/move.c [iso-8859-1] Mon Oct 20 20:26:07 2014 @@ -63,8 +63,7 @@ } else { - HRESULT hr = StringCbPrintfW(PendingOperationsBuffer, sizeof(PendingOperationsBuffer), L"PendingFileRenameOperations%d", KeyId); - ASSERT(SUCCEEDED(hr)); + StringCbPrintfW(PendingOperationsBuffer, sizeof(PendingOperationsBuffer), L"PendingFileRenameOperations%d", KeyId); PendingOperations = PendingOperationsBuffer; } RtlInitUnicodeString(&PendingOperationsString, PendingOperations);
10 years, 2 months
1
0
0
0
← Newer
1
...
28
29
30
31
32
33
34
...
73
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
Results per page:
10
25
50
100
200