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
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 2017
----- 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
43 participants
275 discussions
Start a n
N
ew thread
[reactos] 03/03: [FFS] Don't leak on failure CID 1363596
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=361664d57fca98f01ec5c…
commit 361664d57fca98f01ec5c6d430d8901873d1ea7a Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Mon Oct 23 10:30:27 2017 +0200 [FFS] Don't leak on failure CID 1363596 --- drivers/filesystems/ffs/src/block.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/filesystems/ffs/src/block.c b/drivers/filesystems/ffs/src/block.c index 423842f51b..8507695974 100644 --- a/drivers/filesystems/ffs/src/block.c +++ b/drivers/filesystems/ffs/src/block.c @@ -255,6 +255,10 @@ FFSReadWriteBlocks( (CCHAR)(Vcb->TargetDeviceObject->StackSize + 1)); if (!Irp) { +#ifdef __REACTOS__ + ExFreePoolWithTag(pContext, FFS_POOL_TAG); + pContext = NULL; +#endif Status = STATUS_INSUFFICIENT_RESOURCES; _SEH2_LEAVE; } @@ -268,6 +272,10 @@ FFSReadWriteBlocks( if (!Mdl) { +#ifdef __REACTOS__ + ExFreePoolWithTag(pContext, FFS_POOL_TAG); + pContext = NULL; +#endif Status = STATUS_INSUFFICIENT_RESOURCES; _SEH2_LEAVE; }
7 years, 2 months
1
0
0
0
[reactos] 02/03: [FFS] Don't leak memory on volume mount CID 1363583
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=34d74fbd17ce6046c3633…
commit 34d74fbd17ce6046c363301df9e67444c205529f Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Mon Oct 23 10:25:40 2017 +0200 [FFS] Don't leak memory on volume mount CID 1363583 --- drivers/filesystems/ffs/src/fsctl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/filesystems/ffs/src/fsctl.c b/drivers/filesystems/ffs/src/fsctl.c index 251ea88b83..175b325820 100644 --- a/drivers/filesystems/ffs/src/fsctl.c +++ b/drivers/filesystems/ffs/src/fsctl.c @@ -183,6 +183,9 @@ FFSLoadDiskLabel( Vcb->FSOffset[0] = 0; Vcb->PartitionNumber = 0; Vcb->ffs_super_block = FFSSb; +#ifdef __REACTOS__ + ExFreePoolWithTag(Disklabel, FFS_POOL_TAG); +#endif Status = STATUS_SUCCESS; return Status; } @@ -202,12 +205,18 @@ FFSLoadDiskLabel( Vcb->FSOffset[0] = 0; Vcb->PartitionNumber = 0; Vcb->ffs_super_block = FFSSb; +#ifdef __REACTOS__ + ExFreePoolWithTag(Disklabel, FFS_POOL_TAG); +#endif Status = STATUS_SUCCESS; return Status; } else { KdPrint(("FFSLoadDiskLabel() No BSD file system was found on the \"normal\" partition.\n")); +#ifdef __REACTOS__ + ExFreePoolWithTag(Disklabel, FFS_POOL_TAG); +#endif Status = STATUS_UNRECOGNIZED_VOLUME; return Status; } @@ -217,6 +226,9 @@ FFSLoadDiskLabel( if (!NT_SUCCESS(Status)) { KdPrint(("FFSLoadDiskLabel() Slice info failed, Status %u\n", Status)); +#ifdef __REACTOS__ + ExFreePoolWithTag(Disklabel, FFS_POOL_TAG); +#endif return Status; } @@ -303,6 +315,10 @@ FFSLoadDiskLabel( if (Vcb->ffs_super_block == NULL) Status = STATUS_UNRECOGNIZED_VOLUME; +#ifdef __REACTOS__ + ExFreePoolWithTag(Disklabel, FFS_POOL_TAG); +#endif + return Status; }
7 years, 2 months
1
0
0
0
[reactos] 01/03: [FFS] Don't allocate (and leak :-)) an unused event CID 1363607
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=19bf484a5b5bf50483552…
commit 19bf484a5b5bf50483552aa5bd628203c2cd91e1 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Mon Oct 23 10:21:32 2017 +0200 [FFS] Don't allocate (and leak :-)) an unused event CID 1363607 --- drivers/filesystems/ffs/src/shutdown.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/filesystems/ffs/src/shutdown.c b/drivers/filesystems/ffs/src/shutdown.c index 67062dab9b..ecfcf25ff4 100644 --- a/drivers/filesystems/ffs/src/shutdown.c +++ b/drivers/filesystems/ffs/src/shutdown.c @@ -33,7 +33,9 @@ FFSShutDown( { NTSTATUS Status; +#ifndef __REACTOS__ PKEVENT Event; +#endif PIRP Irp; PIO_STACK_LOCATION IrpSp; @@ -70,8 +72,10 @@ FFSShutDown( GlobalResourceAcquired = TRUE; +#ifndef __REACTOS__ Event = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), FFS_POOL_TAG); KeInitializeEvent(Event, NotificationEvent, FALSE); +#endif for (ListEntry = FFSGlobal->VcbList.Flink; ListEntry != &(FFSGlobal->VcbList);
7 years, 2 months
1
0
0
0
[reactos] 01/01: [EXPLORER] Reduce the spam due to the broken CBandSite in browseui
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0503d8808cbe0ae68381b…
commit 0503d8808cbe0ae68381bc3db63aa4752482aad5 Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Mon Oct 23 00:32:52 2017 +0300 [EXPLORER] Reduce the spam due to the broken CBandSite in browseui --- base/shell/explorer/taskband.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/shell/explorer/taskband.cpp b/base/shell/explorer/taskband.cpp index b7bc13388d..6dd4d9e80d 100644 --- a/base/shell/explorer/taskband.cpp +++ b/base/shell/explorer/taskband.cpp @@ -314,7 +314,7 @@ public: virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult) { - UNIMPLEMENTED; + //UNIMPLEMENTED; return E_NOTIMPL; }
7 years, 2 months
1
0
0
0
[reactos] 02/02: [REISERFS] Don't leak on failure CID 1363597
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c5d20e50cd10a5386e9e…
commit 5c5d20e50cd10a5386e9e7999d88f5b50a0d7274 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Oct 22 22:51:02 2017 +0200 [REISERFS] Don't leak on failure CID 1363597 --- drivers/filesystems/reiserfs/src/blockio.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/filesystems/reiserfs/src/blockio.c b/drivers/filesystems/reiserfs/src/blockio.c index 4762ab62c4..befe4136a5 100644 --- a/drivers/filesystems/reiserfs/src/blockio.c +++ b/drivers/filesystems/reiserfs/src/blockio.c @@ -246,6 +246,10 @@ RfsdReadWriteBlocks( if (!Irp) { Status = STATUS_INSUFFICIENT_RESOURCES; +#ifdef __REACTOS__ + ExFreePool(pContext); + pContext = NULL; +#endif _SEH2_LEAVE; } @@ -258,6 +262,10 @@ RfsdReadWriteBlocks( if (!Mdl) { Status = STATUS_INSUFFICIENT_RESOURCES; +#ifdef __REACTOS__ + ExFreePool(pContext); + pContext = NULL; +#endif _SEH2_LEAVE; }
7 years, 2 months
1
0
0
0
[reactos] 01/02: [REISERFS] Don't leak on failure CID 1363593
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2df125472b5a991a1b8f7…
commit 2df125472b5a991a1b8f7875b815deaf4607ce72 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Oct 22 22:40:21 2017 +0200 [REISERFS] Don't leak on failure CID 1363593 --- drivers/filesystems/reiserfs/src/create.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/filesystems/reiserfs/src/create.c b/drivers/filesystems/reiserfs/src/create.c index 3a879dd78c..d373f7846a 100644 --- a/drivers/filesystems/reiserfs/src/create.c +++ b/drivers/filesystems/reiserfs/src/create.c @@ -542,6 +542,9 @@ Dissecting: } if(!RfsdLoadInode(Vcb, &(ParentMcb->Key), pTmpInode)) { +#ifdef __REACTOS__ + ExFreePool(pTmpInode); +#endif Status = STATUS_OBJECT_PATH_NOT_FOUND; _SEH2_LEAVE; }
7 years, 2 months
1
0
0
0
[reactos] 01/01: [REISERFS] Don't allocate (and leak :-)) an unused event CID 1363603
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=05f00fe63b93e38d3a96c…
commit 05f00fe63b93e38d3a96cdc0756211775e8251be Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sun Oct 22 22:30:22 2017 +0200 [REISERFS] Don't allocate (and leak :-)) an unused event CID 1363603 --- drivers/filesystems/reiserfs/src/shutdown.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/filesystems/reiserfs/src/shutdown.c b/drivers/filesystems/reiserfs/src/shutdown.c index 9b644bdc9c..8bacff6024 100644 --- a/drivers/filesystems/reiserfs/src/shutdown.c +++ b/drivers/filesystems/reiserfs/src/shutdown.c @@ -27,7 +27,9 @@ NTSTATUS RfsdShutDown (IN PRFSD_IRP_CONTEXT IrpContext) { NTSTATUS Status; +#ifndef __REACTOS__ PKEVENT Event; +#endif PIRP Irp; PIO_STACK_LOCATION IrpSp; PRFSD_VCB Vcb; @@ -61,8 +63,10 @@ RfsdShutDown (IN PRFSD_IRP_CONTEXT IrpContext) GlobalResourceAcquired = TRUE; +#ifndef __REACTOS__ Event = ExAllocatePoolWithTag(NonPagedPool, sizeof(KEVENT), RFSD_POOL_TAG); KeInitializeEvent(Event, NotificationEvent, FALSE ); +#endif for (ListEntry = RfsdGlobal->VcbList.Flink; ListEntry != &(RfsdGlobal->VcbList);
7 years, 2 months
1
0
0
0
[reactos] 01/01: [ATL] Implement CDialogImpl CORE-13903
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=31a11bba7e59833699061…
commit 31a11bba7e598336990610a96666cd36665fa8bb Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sat Oct 21 00:25:36 2017 +0200 [ATL] Implement CDialogImpl CORE-13903 --- sdk/lib/atl/atlwin.h | 184 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 178 insertions(+), 6 deletions(-) diff --git a/sdk/lib/atl/atlwin.h b/sdk/lib/atl/atlwin.h index f384b90b89..5540574e03 100644 --- a/sdk/lib/atl/atlwin.h +++ b/sdk/lib/atl/atlwin.h @@ -44,6 +44,9 @@ inline LONG_PTR GetWindowLongPtr(HWND hWnd, int nIndex) } #endif +#pragma push_macro("SubclassWindow") +#undef SubclassWindow + namespace ATL { @@ -1276,20 +1279,177 @@ public: __declspec(selectany) RECT CWindow::rcDefault = { CW_USEDEFAULT, CW_USEDEFAULT, 0, 0 }; -template <class TBase = CWindow, class TWinTraits = CControlWinTraits> -class CWindowImplBaseT : public TBase, public CMessageMap +template <class TBase = CWindow> +class CWindowImplRoot : public TBase, public CMessageMap { public: enum { WINSTATE_DESTROYED = 0x00000001 }; - DWORD m_dwState; - const _ATL_MSG *m_pCurrentMsg; + +public: CWndProcThunk m_thunk; + const _ATL_MSG *m_pCurrentMsg; + DWORD m_dwState; + + CWindowImplRoot() + : m_pCurrentMsg(NULL) + , m_dwState(0) + { + } + + virtual ~CWindowImplRoot() + { + } +}; + + +template <class TBase = CWindow> +class CDialogImplBaseT : public CWindowImplRoot<TBase> +{ +public: + // + Hacks for gcc + using CWindowImplRoot<TBase>::WINSTATE_DESTROYED; + // - Hacks for gcc + + virtual ~CDialogImplBaseT() + { + } + virtual DLGPROC GetDialogProc() + { + return DialogProc; + } + + static INT_PTR CALLBACK StartDialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) + { + CDialogImplBaseT<TBase> *pThis; + DLGPROC newDlgProc; + DLGPROC GCCU(pOldProc); + + pThis = reinterpret_cast<CDialogImplBaseT<TBase>*>(_AtlWinModule.ExtractCreateWndData()); + ATLASSERT(pThis != NULL); + if (pThis == NULL) + return 0; + pThis->m_thunk.Init((WNDPROC)pThis->GetDialogProc(), pThis); + newDlgProc = reinterpret_cast<DLGPROC>(pThis->m_thunk.GetWNDPROC()); + pOldProc = reinterpret_cast<DLGPROC>(::SetWindowLongPtr(hWnd, DWLP_DLGPROC, reinterpret_cast<LONG_PTR>(newDlgProc))); + Unused(pOldProc); // TODO: should generate trace message if overwriting another subclass + pThis->m_hWnd = hWnd; + return newDlgProc(hWnd, uMsg, wParam, lParam); + } + + static INT_PTR CALLBACK DialogProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) + { + CDialogImplBaseT<TBase> *pThis = reinterpret_cast<CDialogImplBaseT<TBase>*>(hWnd); + _ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam); + LRESULT lResult = 0; + const _ATL_MSG *previousMessage; + BOOL handled; + + hWnd = pThis->m_hWnd; + previousMessage = pThis->m_pCurrentMsg; + pThis->m_pCurrentMsg = &msg; + + handled = pThis->ProcessWindowMessage(hWnd, uMsg, wParam, lParam, lResult, 0); + ATLASSERT(pThis->m_pCurrentMsg == &msg); + + if (handled) + { + if ((pThis->m_dwState & WINSTATE_DESTROYED) == 0) + { + ::SetWindowLongPtr(pThis->m_hWnd, DWLP_MSGRESULT, lResult); + } + } + else + { + if (uMsg == WM_NCDESTROY) + { + pThis->m_dwState |= WINSTATE_DESTROYED; + } + } + + ATLASSERT(pThis->m_pCurrentMsg == &msg); + pThis->m_pCurrentMsg = previousMessage; + + if (previousMessage == NULL && (pThis->m_dwState & WINSTATE_DESTROYED) != 0) + { + pThis->m_dwState &= ~WINSTATE_DESTROYED; + pThis->m_hWnd = NULL; + pThis->OnFinalMessage(hWnd); + } + return lResult; + } + + virtual void OnFinalMessage(HWND) + { + } +}; + + +template <class T, class TBase = CWindow> +class CDialogImpl : public CDialogImplBaseT< TBase > +{ +public: + // + Hacks for gcc + using CWindowImplRoot<TBase>::m_thunk; + using CWindowImplRoot<TBase>::m_hWnd; + // - Hacks for gcc + + HWND Create(HWND hWndParent, LPARAM dwInitParam = NULL) + { + BOOL result; + HWND hWnd; + T* pImpl; + + result = m_thunk.Init(NULL, NULL); + if (result == FALSE) + return NULL; + + _AtlWinModule.AddCreateWndData(&m_thunk.cd, this); + + pImpl = static_cast<T*>(this); + hWnd = ::CreateDialogParam(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(pImpl->IDD), hWndParent, T::StartDialogProc, dwInitParam); + return hWnd; + } + + INT_PTR DoModal(HWND hWndParent = ::GetActiveWindow(), LPARAM dwInitParam = NULL) + { + BOOL result; + T* pImpl; + + result = m_thunk.Init(NULL, NULL); + if (result == FALSE) + return -1; + + _AtlWinModule.AddCreateWndData(&m_thunk.cd, this); + + pImpl = static_cast<T*>(this); + return ::DialogBoxParam(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCE(pImpl->IDD), hWndParent, T::StartDialogProc, dwInitParam); + } + + BOOL EndDialog(_In_ int nRetCode) + { + return ::EndDialog(m_hWnd, nRetCode); + } + + BOOL DestroyWindow() + { + return ::DestroyWindow(m_hWnd); + } +}; + +template <class TBase = CWindow, class TWinTraits = CControlWinTraits> +class CWindowImplBaseT : public CWindowImplRoot<TBase> +{ +public: + // + Hacks for gcc + using CWindowImplRoot<TBase>::WINSTATE_DESTROYED; + using CWindowImplRoot<TBase>::m_thunk; + // - Hacks for gcc + WNDPROC m_pfnSuperWindowProc; + public: CWindowImplBaseT() { - m_dwState = 0; - m_pCurrentMsg = NULL; m_pfnSuperWindowProc = ::DefWindowProc; } @@ -1436,6 +1596,7 @@ public: } }; + template <class T, class TBase = CWindow, class TWinTraits = CControlWinTraits> class CWindowImpl : public CWindowImplBaseT<TBase, TWinTraits> { @@ -1693,9 +1854,20 @@ struct _ATL_WNDCLASSINFOW if (m_wc.hInstance == NULL) m_wc.hInstance = _AtlBaseModule.GetModuleInstance(); if (m_atom == 0) + { + if (m_bSystemCursor) + m_wc.hCursor = ::LoadCursor(NULL, m_lpszCursorID); + else + m_wc.hCursor = ::LoadCursor(_AtlBaseModule.GetResourceInstance(), m_lpszCursorID); + m_atom = RegisterClassEx(&m_wc); + } + return m_atom; } }; }; // namespace ATL + +#pragma pop_macro("SubclassWindow") +
7 years, 2 months
1
0
0
0
[reactos] 09/09: [BROWSEUI] CBandSiteMenu: Use CSimpleArray and CComHeapPtr.
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=143c3060066f1d67ca11c…
commit 143c3060066f1d67ca11c48d4773d42e50726f18 Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Sun Oct 22 18:59:01 2017 +0300 [BROWSEUI] CBandSiteMenu: Use CSimpleArray and CComHeapPtr. --- dll/win32/browseui/precomp.h | 1 + dll/win32/browseui/shellbars/CBandSiteMenu.cpp | 108 +++++++++---------------- dll/win32/browseui/shellbars/CBandSiteMenu.h | 6 +- dll/win32/browseui/shellbars/CMakeLists.txt | 3 + dll/win32/browseui/shellbars/shellbars.h | 1 + 5 files changed, 45 insertions(+), 74 deletions(-) diff --git a/dll/win32/browseui/precomp.h b/dll/win32/browseui/precomp.h index 26ff15a23d..3303834b13 100644 --- a/dll/win32/browseui/precomp.h +++ b/dll/win32/browseui/precomp.h @@ -21,6 +21,7 @@ #include <atlbase.h> #include <atlcom.h> #include <atlwin.h> +#include <atlsimpcoll.h> #include <undocuser.h> #include <perhist.h> #include <exdispid.h> diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp index 0f8089791d..ea0f9cf9b6 100644 --- a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp +++ b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp @@ -32,7 +32,6 @@ #define FIRST_COMCAT_MENU_ID 0x5 CBandSiteMenu::CBandSiteMenu(): - m_comcatDsa(NULL), m_hmenu(NULL), m_DesktopPidl(NULL), m_QLaunchPidl(NULL) @@ -44,15 +43,6 @@ CBandSiteMenu::~CBandSiteMenu() if (m_hmenu) DestroyMenu(m_hmenu); - if (m_comcatDsa) - DSA_Destroy(m_comcatDsa); - - if (m_DesktopPidl) - ILFree(m_DesktopPidl); - - if (m_QLaunchPidl) - ILFree(m_QLaunchPidl); - m_BandSite = NULL; } @@ -67,7 +57,7 @@ HRESULT WINAPI CBandSiteMenu::FinalConstruct() if (FAILED_UNEXPECTEDLY(hr)) return hr; - m_QLaunchPidl = ILCreateFromPathW(buffer); + m_QLaunchPidl.Attach(ILCreateFromPathW(buffer)); if (m_QLaunchPidl == NULL) return E_FAIL; @@ -90,18 +80,11 @@ HRESULT CBandSiteMenu::_CreateMenuPart() if (m_hmenu) DestroyMenu(m_hmenu); - if (m_comcatDsa) - DSA_Destroy(m_comcatDsa); - /* Load the template we will fill in */ m_hmenu = LoadMenuW(GetModuleHandleW(L"browseui.dll"), MAKEINTRESOURCEW(IDM_TASKBAR_TOOLBARS)); if (!m_hmenu) return HRESULT_FROM_WIN32(GetLastError()); - m_comcatDsa = DSA_Create(sizeof(GUID), 5); - if (!m_comcatDsa) - return E_OUTOFMEMORY; - /* Get the handle of the submenu where the available items will be shown */ hmenuToolbars = GetSubMenu(m_hmenu, 0); @@ -110,6 +93,8 @@ HRESULT CBandSiteMenu::_CreateMenuPart() if (FAILED_UNEXPECTEDLY(hr)) return hr; + m_ComCatGuids.RemoveAll(); + /* Enumerate the classes in the CATID_DeskBand category */ cBands = 0; do @@ -128,8 +113,8 @@ HRESULT CBandSiteMenu::_CreateMenuPart() SHGetValue(HKEY_CLASSES_ROOT, wRegKey, NULL, NULL, wszBandName, &dwDataSize); /* Insert it */ - InsertMenu(hmenuToolbars, cBands, MF_BYPOSITION, DSA_GetItemCount(m_comcatDsa) + FIRST_COMCAT_MENU_ID, wszBandName); - DSA_AppendItem(m_comcatDsa, &iter); + InsertMenu(hmenuToolbars, cBands, MF_BYPOSITION, m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID, wszBandName); + m_ComCatGuids.Add(iter); cBands++; } while (dwRead > 0); @@ -148,24 +133,21 @@ HRESULT CBandSiteMenu::_CreateNewISFBand(HWND hwnd, REFIID riid, void** ppv) else bi.lpszTitle = L"Choose a folder"; - LPITEMIDLIST pidlSelected = SHBrowseForFolderW(&bi); + CComHeapPtr<ITEMIDLIST> pidlSelected; + pidlSelected.Attach(SHBrowseForFolderW(&bi)); if (pidlSelected == NULL) return S_FALSE; CComPtr<IShellFolderBand> pISFB; HRESULT hr = CISFBand_CreateInstance(IID_IShellFolderBand, (PVOID*)&pISFB); if (FAILED_UNEXPECTEDLY(hr)) - goto done; + return hr; hr = pISFB->InitializeSFB(NULL, pidlSelected); if (FAILED_UNEXPECTEDLY(hr)) - goto done; - - hr = pISFB->QueryInterface(riid, ppv); + return hr; -done: - ILFree(pidlSelected); - return hr; + return pISFB->QueryInterface(riid, ppv); } HRESULT CBandSiteMenu::_CreateBuiltInISFBand(UINT uID, REFIID riid, void** ppv) @@ -206,15 +188,19 @@ HRESULT CBandSiteMenu::_AddISFBandToMenu(HMENU hmenu, UINT indexMenu, UINT idCmd if (FAILED_UNEXPECTEDLY(hr)) return hr; - if (!bi.pidl) + CComHeapPtr<ITEMIDLIST> pidl(bi.pidl); + if (!pidl) + { + ERR("Failed to get the pidl of the CISFBand\n"); return E_OUTOFMEMORY; + } WCHAR buffer[MAX_PATH]; - hr = ILGetDisplayNameEx(NULL, bi.pidl, buffer, ILGDN_INFOLDER) ? S_OK : E_FAIL; + hr = ILGetDisplayNameEx(NULL, pidl, buffer, ILGDN_INFOLDER) ? S_OK : E_FAIL; if (FAILED_UNEXPECTEDLY(hr)) return hr; - UINT id = idCmdFirst + DSA_GetItemCount(m_comcatDsa) + FIRST_COMCAT_MENU_ID + dwBandID; + UINT id = idCmdFirst + m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID + dwBandID; if (id >= idCmdLast) return E_FAIL; @@ -225,60 +211,39 @@ HRESULT CBandSiteMenu::_AddISFBandToMenu(HMENU hmenu, UINT indexMenu, UINT idCmd UINT CBandSiteMenu::_GetMenuIdFromISFBand(IUnknown *pBand) { - UINT ret = UINT_MAX; - CComPtr<IShellFolderBand> psfb; HRESULT hr = pBand->QueryInterface(IID_PPV_ARG(IShellFolderBand, &psfb)); if (FAILED_UNEXPECTEDLY(hr)) - return ret; + return UINT_MAX; BANDINFOSFB bi = {ISFB_MASK_IDLIST}; hr = psfb->GetBandInfoSFB(&bi); if (FAILED_UNEXPECTEDLY(hr)) - return ret; + return UINT_MAX; - CComPtr<IShellFolder> psfDesktop; - LPITEMIDLIST pidl = bi.pidl; + CComHeapPtr<ITEMIDLIST> pidl(bi.pidl); if (!pidl) - return ret; + { + ERR("Failed to get the pidl of the CISFBand\n"); + return UINT_MAX; + } if (pidl->mkid.cb == 0) { - ret = IDM_TASKBAR_TOOLBARS_DESKTOP; - goto done; + return IDM_TASKBAR_TOOLBARS_DESKTOP; } + CComPtr<IShellFolder> psfDesktop; hr = SHGetDesktopFolder(&psfDesktop); if (FAILED_UNEXPECTEDLY(hr)) - goto done; + return UINT_MAX; hr = psfDesktop->CompareIDs(0, pidl, m_QLaunchPidl); if (FAILED_UNEXPECTEDLY(hr)) - goto done; + return UINT_MAX; if (HRESULT_CODE(hr) == 0) - ret = IDM_TASKBAR_TOOLBARS_QUICKLAUNCH; - -done: - if (pidl) - ILFree(pidl); - - return ret; -} - -UINT CBandSiteMenu::_GetMenuIdFromBand(CLSID *BandCLSID) -{ - /* Try to find the clsid of the band in the dsa */ - UINT count = DSA_GetItemCount(m_comcatDsa); - for (UINT i = 0; i < count; i++) - { - GUID* pdsaGUID = (GUID*)DSA_GetItemPtr(m_comcatDsa, i); - if (IsEqualGUID(*pdsaGUID, *BandCLSID)) - { - /* The index in the dsa is also the index in the menu */ - return i + FIRST_COMCAT_MENU_ID; - } - } + return IDM_TASKBAR_TOOLBARS_QUICKLAUNCH; return UINT_MAX; } @@ -294,7 +259,7 @@ UINT CBandSiteMenu::_GetBandIdFromClsid(CLSID* pclsid) if (FAILED(m_BandSite->GetBandObject(dwBandID, IID_PPV_ARG(IPersist, &pBand)))) continue; - if (FAILED(pBand->GetClassID(&BandCLSID))) + if (FAILED_UNEXPECTEDLY(pBand->GetClassID(&BandCLSID))) continue; if (IsEqualGUID(*pclsid, BandCLSID)) @@ -315,7 +280,7 @@ UINT CBandSiteMenu::_GetBandIdForBuiltinISFBand(UINT uID) if (FAILED(m_BandSite->GetBandObject(dwBandID, IID_PPV_ARG(IPersist, &pBand)))) continue; - if (FAILED(pBand->GetClassID(&BandCLSID))) + if (FAILED_UNEXPECTEDLY(pBand->GetClassID(&BandCLSID))) continue; if (!IsEqualGUID(BandCLSID, CLSID_ISFBand)) @@ -360,7 +325,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu( if (FAILED(m_BandSite->GetBandObject(dwBandID, IID_PPV_ARG(IPersist, &pBand)))) continue; - if (FAILED(pBand->GetClassID(&BandCLSID))) + if (FAILED_UNEXPECTEDLY(pBand->GetClassID(&BandCLSID))) continue; UINT menuID; @@ -378,7 +343,8 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu( } else { - menuID = _GetMenuIdFromBand(&BandCLSID); + int i = m_ComCatGuids.Find(BandCLSID); + menuID = (i == -1 ? UINT_MAX : i + FIRST_COMCAT_MENU_ID); } if (menuID != UINT_MAX) @@ -411,9 +377,9 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi return S_OK; } - else if (uID > (UINT)DSA_GetItemCount(m_comcatDsa) + FIRST_COMCAT_MENU_ID ) + else if (uID > (UINT) m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID ) { - dwBandID = uID - (DSA_GetItemCount(m_comcatDsa) + FIRST_COMCAT_MENU_ID ); + dwBandID = uID - (m_ComCatGuids.GetSize() + FIRST_COMCAT_MENU_ID ); m_BandSite->RemoveBand(dwBandID); @@ -441,7 +407,7 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi } /* Get the GUID of the item that was clicked */ - GUID *pguidToolbar = (GUID *)DSA_GetItemPtr(m_comcatDsa, uID - FIRST_COMCAT_MENU_ID); + GUID *pguidToolbar = &m_ComCatGuids[uID - FIRST_COMCAT_MENU_ID]; if (!pguidToolbar) return E_FAIL; diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.h b/dll/win32/browseui/shellbars/CBandSiteMenu.h index f05107b529..6a78ae7c54 100644 --- a/dll/win32/browseui/shellbars/CBandSiteMenu.h +++ b/dll/win32/browseui/shellbars/CBandSiteMenu.h @@ -29,10 +29,10 @@ class CBandSiteMenu : public IShellService { CComPtr<IBandSite> m_BandSite; - HDSA m_comcatDsa; + CSimpleArray<GUID> m_ComCatGuids; HMENU m_hmenu; - LPITEMIDLIST m_DesktopPidl; - LPITEMIDLIST m_QLaunchPidl; + CComHeapPtr<ITEMIDLIST> m_DesktopPidl; + CComHeapPtr<ITEMIDLIST> m_QLaunchPidl; HRESULT _CreateMenuPart(); HRESULT _CreateNewISFBand(HWND hwnd, REFIID riid, void** ppv); diff --git a/dll/win32/browseui/shellbars/CMakeLists.txt b/dll/win32/browseui/shellbars/CMakeLists.txt index d52e71807c..28c55176b5 100644 --- a/dll/win32/browseui/shellbars/CMakeLists.txt +++ b/dll/win32/browseui/shellbars/CMakeLists.txt @@ -3,6 +3,7 @@ PROJECT(SHELL) set_cpp(WITH_RUNTIME) add_definitions(-DUNICODE -D_UNICODE) +add_definitions(-D_ATL_NO_EXCEPTIONS) include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) @@ -16,6 +17,8 @@ list(APPEND SOURCE add_library(shellbars ${SOURCE}) add_dependencies(shellbars xdk) +target_link_libraries(shellbars atlnew) + if(NOT MSVC) if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") add_target_compile_flags(shellbars "-Wno-unused-but-set-variable") diff --git a/dll/win32/browseui/shellbars/shellbars.h b/dll/win32/browseui/shellbars/shellbars.h index ae1e6ed218..b6ebf70d6c 100644 --- a/dll/win32/browseui/shellbars/shellbars.h +++ b/dll/win32/browseui/shellbars/shellbars.h @@ -18,6 +18,7 @@ #include <atlbase.h> #include <atlcom.h> #include <atlwin.h> +#include <atlsimpcoll.h> #include <undocuser.h> #include <shlwapi.h> #include <shlwapi_undoc.h>
7 years, 2 months
1
0
0
0
[reactos] 08/09: [BROWSEUI] Improve CBandSiteBase::OnWinEvent to forward messages correctly to the child bands.
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3bfdbf3b2c253a0ef2130…
commit 3bfdbf3b2c253a0ef21303b8fc7aed5e67947146 Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Fri Oct 20 19:41:01 2017 +0300 [BROWSEUI] Improve CBandSiteBase::OnWinEvent to forward messages correctly to the child bands. --- dll/win32/browseui/shellbars/CBandSite.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/dll/win32/browseui/shellbars/CBandSite.cpp b/dll/win32/browseui/shellbars/CBandSite.cpp index 24ca2e9322..520f9eba58 100644 --- a/dll/win32/browseui/shellbars/CBandSite.cpp +++ b/dll/win32/browseui/shellbars/CBandSite.cpp @@ -694,12 +694,32 @@ HRESULT STDMETHODCALLTYPE CBandSiteBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM return S_OK; } - - if (hWnd == fRebarWindow) + else if (uMsg == WM_COMMAND && lParam) { - /* FIXME: Just send the message? */ - *plrResult = SendMessageW(hWnd, uMsg, wParam, lParam); - return S_OK; + hWnd = reinterpret_cast<HWND>(lParam); + } + else if (uMsg == WM_NOTIFY) + { + NMHDR* pnmhdr = reinterpret_cast<NMHDR*>(lParam); + if (pnmhdr->hwndFrom != fRebarWindow) + { + hWnd = pnmhdr->hwndFrom; + } + else + { + for (int i = 0; i < fBandsAllocated; i++) + { + if (fBands[i].WndEvtHandler && fBands[i].OleWindow) + { + HWND hwndBand; + if (SUCCEEDED(fBands[i].OleWindow->GetWindow(&hwndBand))) + { + fBands[i].WndEvtHandler->OnWinEvent(hwndBand, uMsg, wParam, lParam, plrResult); + } + } + } + return S_OK; + } } Band = GetBandFromHwnd(hWnd);
7 years, 2 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
28
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
Results per page:
10
25
50
100
200