https://git.reactos.org/?p=reactos.git;a=commitdiff;h=111c40e012dc07e7f829b…
commit 111c40e012dc07e7f829bc314615f4e37d86e6d0
Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
AuthorDate: Wed Feb 14 00:03:35 2018 +0200
Commit: Giannis Adamopoulos <gadamopoulos(a)reactos.org>
CommitDate: Wed Feb 14 00:03:35 2018 +0200
[SHELL32] CDefViewBckgrndMenu: Fix handling string verbs.
It shouldn't be necessary for QueryContextMenu to be called before InvokeCommand.
Move retrieving the IContextMenu of the folder to the initialization of the class.
CORE-12866
---
dll/win32/shell32/CDefViewBckgrndMenu.cpp | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dll/win32/shell32/CDefViewBckgrndMenu.cpp b/dll/win32/shell32/CDefViewBckgrndMenu.cpp
index 2fc6f1ac02..3815019894 100644
--- a/dll/win32/shell32/CDefViewBckgrndMenu.cpp
+++ b/dll/win32/shell32/CDefViewBckgrndMenu.cpp
@@ -113,6 +113,11 @@ HRESULT
CDefViewBckgrndMenu::Initialize(IShellFolder* psf)
{
m_psf = psf;
+
+ /* Get the context menu of the folder. Do it here because someone may call
+ InvokeCommand without calling QueryContextMenu. It is fine if this fails */
+ m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM));
+
return S_OK;
}
@@ -154,9 +159,8 @@ CDefViewBckgrndMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFir
but as stated above, its sole user is CDefView and should really be that way. */
m_idCmdFirst = idCmdFirst;
- /* Query the shell folder to add any items it wants to add in the background context menu */
- hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM));
- if (SUCCEEDED(hr))
+ /* Let the shell folder add any items it wants to add in the background context menu */
+ if (m_folderCM)
{
hr = m_folderCM->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
if (SUCCEEDED(hr))
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a5e89014dc943b2cbddb1…
commit a5e89014dc943b2cbddb16fc4d92e13b7e5068e1
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Mon Feb 12 20:45:12 2018 +0100
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Mon Feb 12 20:47:32 2018 +0100
[CDFS_NEW] Fix a bug in Microsoft CDFS implementation where the top level IRP
is set before locking is actually attempted for Cc worker thread (lazy write/read ahead).
So in case locking fails, the top level IRP is set and never unset, and latter
call will hit the assert where it expects the top level IRP to be NULL.
Should be reported upstream (tm).
CORE-14315
---
drivers/filesystems/cdfs_new/resrcsup.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/filesystems/cdfs_new/resrcsup.c b/drivers/filesystems/cdfs_new/resrcsup.c
index c9eaa7be26..3bb38bb529 100755
--- a/drivers/filesystems/cdfs_new/resrcsup.c
+++ b/drivers/filesystems/cdfs_new/resrcsup.c
@@ -164,10 +164,20 @@ Return Value:
{
PAGED_CODE();
+#ifdef __REACTOS__
+ if (!ExAcquireResourceSharedLite( Fcb->Resource, Wait )) {
+ return FALSE;
+ }
+#endif
+
NT_ASSERT(IoGetTopLevelIrp() == NULL);
IoSetTopLevelIrp((PIRP)FSRTL_CACHE_TOP_LEVEL_IRP);
+#ifndef __REACTOS__
return ExAcquireResourceSharedLite( Fcb->Resource, Wait );
+#else
+ return TRUE;
+#endif
}