https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0676247932d1f707e9b02…
commit 0676247932d1f707e9b02d46073d022c02a7893b
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Sat Sep 10 22:25:19 2022 +0200
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Sat Sep 10 22:52:00 2022 +0200
[FLOPPY] Correctly return media changed information
If disk changed since last time, we must either return STATUS_IO_DEVICE_ERROR
or STATUS_VERIFY_REQUIRED, depending of VPB_MOUNTED flag.
This is already handled by the SignalMediaChanged() function.
CORE-18244
---
drivers/storage/floppy/floppy/ioctl.c | 12 +++---------
drivers/storage/floppy/floppy/readwrite.c | 9 ++-------
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/drivers/storage/floppy/floppy/ioctl.c b/drivers/storage/floppy/floppy/ioctl.c
index 11875e51838..7673a0fd0f0 100644
--- a/drivers/storage/floppy/floppy/ioctl.c
+++ b/drivers/storage/floppy/floppy/ioctl.c
@@ -153,16 +153,10 @@ DeviceIoctlPassive(PDRIVE_INFO DriveInfo, PIRP Irp)
if(DiskChanged)
{
INFO_(FLOPPY, "DeviceIoctl(): detected disk changed; signalling media change and completing\n");
- SignalMediaChanged(DriveInfo->DeviceObject, Irp);
- /*
- * Just guessing here - I have a choice of returning NO_MEDIA or VERIFY_REQUIRED. If there's
- * really no disk in the drive, I'm thinking I can save time by just reporting that fact, rather
- * than forcing windows to ask me twice. If this doesn't work, we'll need to split this up and
- * handle the CHECK_VERIFY IOCTL separately.
- */
- if(ResetChangeFlag(DriveInfo) == STATUS_NO_MEDIA_IN_DEVICE)
- Irp->IoStatus.Status = STATUS_NO_MEDIA_IN_DEVICE;
+ /* The following call sets IoStatus.Status and IoStatus.Information */
+ SignalMediaChanged(DriveInfo->DeviceObject, Irp);
+ ResetChangeFlag(DriveInfo);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
diff --git a/drivers/storage/floppy/floppy/readwrite.c b/drivers/storage/floppy/floppy/readwrite.c
index 2ce3a6ccf17..35d1c60d79b 100644
--- a/drivers/storage/floppy/floppy/readwrite.c
+++ b/drivers/storage/floppy/floppy/readwrite.c
@@ -478,16 +478,11 @@ ReadWritePassive(PDRIVE_INFO DriveInfo, PIRP Irp)
if(DiskChanged)
{
- INFO_(FLOPPY, "ReadWritePhase1(): signalling media changed; Completing with STATUS_MEDIA_CHANGED\n");
+ INFO_(FLOPPY, "ReadWritePhase1(): detected disk changed: signalling media change and completing\n");
/* The following call sets IoStatus.Status and IoStatus.Information */
SignalMediaChanged(DeviceObject, Irp);
-
- /*
- * Guessing at something... see ioctl.c for more info
- */
- if(ResetChangeFlag(DriveInfo) == STATUS_NO_MEDIA_IN_DEVICE)
- Irp->IoStatus.Status = STATUS_NO_MEDIA_IN_DEVICE;
+ ResetChangeFlag(DriveInfo);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
StopMotor(DriveInfo->ControllerInfo);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=86addae3cc6653d2e04e0…
commit 86addae3cc6653d2e04e0d62ab4eb82db8b40ad9
Author: Kyle Katarn <contact(a)kcsoftwares.com>
AuthorDate: Sat Sep 10 15:59:00 2022 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Sat Sep 10 15:59:00 2022 +0200
[SHELL32] Fix Assertion when opening "File" menu in MyComputer twice (#4675)
ReactOS explorer shell asserts when opening the "File" menu in MyComputer for the second time.
This is due to the cached copy of IContextMenu not being released before attempting to cache it again.
Fix based on the patch proposed by JIRA user I_Kill_Bugs
CORE-18353
Signed-off by: I_Kill_Bugs (original patch author)
---
dll/win32/shell32/CDefView.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index a152ac6c263..98b597c59d4 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -1310,6 +1310,13 @@ HRESULT CDefView::FillFileMenu()
if (!hFileMenu)
return E_FAIL;
+ /* Release cached IContextMenu */
+ if (m_pCM)
+ {
+ IUnknown_SetSite(m_pCM, NULL);
+ m_pCM.Release();
+ }
+
/* Cleanup the items added previously */
for (int i = GetMenuItemCount(hFileMenu) - 1; i >= 0; i--)
{