https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d2976ca58e1409a9b6a23…
commit d2976ca58e1409a9b6a2322db1157cc8d9f19fb8
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Fri Sep 20 00:11:10 2019 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Fri Sep 20 00:11:10 2019 +0200
[EXPLORER] Mitigate CORE-15760 'system menu may close unexpectedly'
Looks like a race condition of the async part of SetForegroundWindow().
KVM https://reactos.org/testman/compare.php?ids=69065,69069
VBOX https://reactos.org/testman/compare.php?ids=69064,69068
I intend to merge that back into 0.4.12RC as well.
---
base/shell/explorer/taskswnd.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/base/shell/explorer/taskswnd.cpp b/base/shell/explorer/taskswnd.cpp
index 0a5d4db4424..deeb50f2547 100644
--- a/base/shell/explorer/taskswnd.cpp
+++ b/base/shell/explorer/taskswnd.cpp
@@ -1633,6 +1633,13 @@ public:
ActivateTask(TaskItem->hWnd);
+ /* Wait up to 2 seconds for the window to process the foreground notification. */
+ DWORD_PTR resultDummy;
+ if (!SendMessageTimeout(TaskItem->hWnd, WM_NULL, 0, 0, 0, 2000, &resultDummy))
+ ERR("HandleTaskItemRightClick detected the window was unresponsive for 2 seconds, or was destroyed\n");
+ if (GetForegroundWindow() != TaskItem->hWnd)
+ ERR("HandleTaskItemRightClick detected the window did not become foreground\n");
+
::SendMessageW(TaskItem->hWnd, WM_POPUPSYSTEMMENU, 0, MAKELPARAM(pt.x, pt.y));
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2ed695fc83296f206097b…
commit 2ed695fc83296f206097b4ab82e64ab37793ff7b
Author: Eric Kohl <eric.kohl(a)reactos.org>
AuthorDate: Thu Sep 19 23:24:43 2019 +0200
Commit: Eric Kohl <eric.kohl(a)reactos.org>
CommitDate: Thu Sep 19 23:27:11 2019 +0200
[FREELDR] Hack: Boot ReactOS even when a cdrom-drive does not report a proper geometry
We need to find a way to retrieve the LBA sector count of a drive, not only its CHS geometry.
---
boot/freeldr/freeldr/arch/i386/hwdisk.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/boot/freeldr/freeldr/arch/i386/hwdisk.c b/boot/freeldr/freeldr/arch/i386/hwdisk.c
index d67494d508d..1717bdbd2dd 100644
--- a/boot/freeldr/freeldr/arch/i386/hwdisk.c
+++ b/boot/freeldr/freeldr/arch/i386/hwdisk.c
@@ -225,7 +225,9 @@ DiskSeek(ULONG FileId, LARGE_INTEGER* Position, SEEKMODE SeekMode)
/* Convert in number of sectors */
NewPosition.QuadPart /= Context->SectorSize;
- if (NewPosition.QuadPart >= Context->SectorCount)
+
+ /* HACK: CDROMs may have a SectorCount of 0 */
+ if (Context->SectorCount != 0 && NewPosition.QuadPart >= Context->SectorCount)
return EINVAL;
Context->SectorNumber = NewPosition.QuadPart;