https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4193b8d8ace0b84d0bf82…
commit 4193b8d8ace0b84d0bf82c72bc9263a35ee414a8
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Tue Aug 20 12:07:56 2019 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Tue Aug 20 12:07:56 2019 +0200
[WIN32SS] WindowSnap must not affect the taskbar
This fixes regression CORE-16289 where we could not longer
move the taskbar at a different than default location,
as WindowSnap would interfere.
Many Thanks to the patches author Doug Lyons.
Eventually the heuristic that we use here to identify the
taskbar via used window-styles could be improved later.
Theoretically possible that it bails out on some other windows.
The regression was introduced by 0.4.12-dev-373-g
7e396787ed00a3939031447725f79697a41878e1
---
win32ss/user/ntuser/defwnd.c | 20 +++++++++++++++++++-
win32ss/user/ntuser/nonclient.c | 21 +++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c
index fc55c4acfba..7b07ec4b0ad 100644
--- a/win32ss/user/ntuser/defwnd.c
+++ b/win32ss/user/ntuser/defwnd.c
@@ -539,6 +539,9 @@ IntDefWindowProc(
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
LRESULT lResult = 0;
USER_REFERENCE_ENTRY Ref;
+ BOOL IsTaskBar;
+ DWORD Style;
+ DWORD ExStyle;
if (Msg > WM_USER) return 0;
@@ -785,7 +788,22 @@ IntDefWindowProc(
{
HWND hwndTop = UserGetForegroundWindow();
PWND topWnd = UserGetWindowObject(hwndTop);
- if (topWnd)
+
+ /* Test for typical TaskBar ExStyle Values */
+ ExStyle = (topWnd->ExStyle & WS_EX_TOOLWINDOW);
+ TRACE("ExStyle is '%x'.\n", ExStyle);
+
+ /* Test for typical TaskBar Style Values */
+ Style = (topWnd->style & (WS_POPUP | WS_VISIBLE |
+ WS_CLIPSIBLINGS | WS_CLIPCHILDREN));
+ TRACE("Style is '%x'.\n", Style);
+
+ /* Test for masked typical TaskBar Style and ExStyles to detect TaskBar */
+ IsTaskBar = (Style == (WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN))
+ && (ExStyle == WS_EX_TOOLWINDOW);
+ TRACE("This %s the TaskBar.\n", IsTaskBar ? "is" : "is not");
+
+ if (topWnd && !IsTaskBar) /* Second test is so we are not touching the Taskbar */
{
if ((topWnd->style & WS_THICKFRAME) == 0)
{
diff --git a/win32ss/user/ntuser/nonclient.c b/win32ss/user/ntuser/nonclient.c
index ba8dececb13..0c7dac84c48 100644
--- a/win32ss/user/ntuser/nonclient.c
+++ b/win32ss/user/ntuser/nonclient.c
@@ -256,6 +256,8 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
//PMONITOR mon = 0; Don't port sync from wine!!! This breaks explorer task bar sizing!!
// The task bar can grow in size and can not reduce due to the change
// in the work area.
+ DWORD ExStyleTB, StyleTB;
+ BOOL IsTaskBar;
Style = pwnd->style;
ExStyle = pwnd->ExStyle;
@@ -394,6 +396,20 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
/* Exit on button-up */
if (msg.message == WM_LBUTTONUP)
{
+ /* Test for typical TaskBar ExStyle Values */
+ ExStyleTB = (ExStyle & WS_EX_TOOLWINDOW);
+ TRACE("ExStyle is '%x'.\n", ExStyleTB);
+
+ /* Test for typical TaskBar Style Values */
+ StyleTB = (Style & (WS_POPUP | WS_VISIBLE |
+ WS_CLIPSIBLINGS | WS_CLIPCHILDREN));
+ TRACE("Style is '%x'.\n", StyleTB);
+
+ /* Test for masked typical TaskBar Style and ExStyles to detect TaskBar */
+ IsTaskBar = (StyleTB == (WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN))
+ && (ExStyleTB == WS_EX_TOOLWINDOW);
+ TRACE("This %s the TaskBar.\n", IsTaskBar ? "is" : "is not");
+
// check for snapping if was moved by caption
if (hittest == HTCAPTION && thickframe && (ExStyle & WS_EX_MDICHILD) == 0)
{
@@ -401,6 +417,11 @@ DefWndDoSizeMove(PWND pwnd, WORD wParam)
BOOL doSideSnap = FALSE;
UserSystemParametersInfo(SPI_GETWORKAREA, 0, &snapRect, 0);
+ /* if this is the taskbar, then we want to just exit */
+ if (IsTaskBar)
+ {
+ break;
+ }
// snap to left
if (pt.x <= snapRect.left)
{
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b99272702c94f5c6707dc…
commit b99272702c94f5c6707dc095d3d11bb5a0147c43
Author: Stanislav Motylkov <x86corez(a)gmail.com>
AuthorDate: Tue Aug 20 00:48:49 2019 +0300
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Tue Aug 20 01:51:16 2019 +0200
[HAL] Refactor PCI blacklisting for Xbox
- Use a separate function for detecting blacklisted PCI slots
- Blacklist PCI-to-PCI bridge to avoid stack overflow on real hardware Microsoft Xbox 1.3
CORE-16319 CORE-16216
---
hal/halx86/legacy/bus/pcibus.c | 66 +++++++++++++++++++++---------------------
1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/hal/halx86/legacy/bus/pcibus.c b/hal/halx86/legacy/bus/pcibus.c
index a0aff2c70da..ab7ed855cdc 100644
--- a/hal/halx86/legacy/bus/pcibus.c
+++ b/hal/halx86/legacy/bus/pcibus.c
@@ -311,6 +311,36 @@ HalpWritePCIConfig(IN PBUS_HANDLER BusHandler,
}
}
+#ifdef SARCH_XBOX
+BOOLEAN
+NTAPI
+HalpXboxBlacklistedPCISlot(IN PBUS_HANDLER BusHandler,
+ IN PCI_SLOT_NUMBER Slot)
+{
+ /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
+ * hang the Xbox. Also, the device number doesn't seem to be decoded for the
+ * video card, so it appears to be present on 1:0:0 - 1:31:0.
+ * We hack around these problems by indicating "device not present" for devices
+ * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
+ if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
+ (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
+ (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
+ {
+ DPRINT("Blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
+ return TRUE;
+ }
+
+ /* Temporary hack to avoid stack overflow in kernel, see CORE-16319 */
+ if (BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 8 && Slot.u.bits.FunctionNumber == 0)
+ {
+ DPRINT("Blacklisted PCI-to-PCI bridge (00:08.0 - PCI\\VEN_10DE&DEV_01B8, see CORE-16319)\n");
+ return TRUE;
+ }
+
+ return FALSE;
+}
+#endif
+
BOOLEAN
NTAPI
HalpValidPCISlot(IN PBUS_HANDLER BusHandler,
@@ -326,18 +356,7 @@ HalpValidPCISlot(IN PBUS_HANDLER BusHandler,
if (Slot.u.bits.DeviceNumber >= BusData->MaxDevice) return FALSE;
#ifdef SARCH_XBOX
- /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
- * hang the Xbox. Also, the device number doesn't seem to be decoded for the
- * video card, so it appears to be present on 1:0:0 - 1:31:0.
- * We hack around these problems by indicating "device not present" for devices
- * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
- if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
- (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
- (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
- {
- DPRINT("HalpValidPCISlot(): Blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
- return FALSE;
- }
+ if (HalpXboxBlacklistedPCISlot(BusHandler, Slot)) return FALSE;
#endif
/* Function 0 doesn't need checking */
@@ -378,16 +397,8 @@ HalpGetPCIData(IN PBUS_HANDLER BusHandler,
Slot.u.AsULONG = SlotNumber;
#ifdef SARCH_XBOX
- /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
- * hang the Xbox. Also, the device number doesn't seem to be decoded for the
- * video card, so it appears to be present on 1:0:0 - 1:31:0.
- * We hack around these problems by indicating "device not present" for devices
- * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
- if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
- (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
- (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
+ if (HalpXboxBlacklistedPCISlot(BusHandler, Slot))
{
- DPRINT("Blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
if (Offset == 0 && Length >= sizeof(USHORT))
{
*(PUSHORT)Buffer = PCI_INVALID_VENDORID;
@@ -470,18 +481,7 @@ HalpSetPCIData(IN PBUS_HANDLER BusHandler,
Slot.u.AsULONG = SlotNumber;
#ifdef SARCH_XBOX
- /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
- * hang the Xbox. Also, the device number doesn't seem to be decoded for the
- * video card, so it appears to be present on 1:0:0 - 1:31:0.
- * We hack around these problems by indicating "device not present" for devices
- * 0:0:1, 0:0:2, 1:1:0, 1:2:0, 1:3:0, ...., 1:31:0 */
- if ((BusHandler->BusNumber == 0 && Slot.u.bits.DeviceNumber == 0 &&
- (Slot.u.bits.FunctionNumber == 1 || Slot.u.bits.FunctionNumber == 2)) ||
- (BusHandler->BusNumber == 1 && Slot.u.bits.DeviceNumber != 0))
- {
- DPRINT1("Trying to set data on blacklisted PCI slot (%d:%d:%d)\n", BusHandler->BusNumber, Slot.u.bits.DeviceNumber, Slot.u.bits.FunctionNumber);
- return 0;
- }
+ if (HalpXboxBlacklistedPCISlot(BusHandler, Slot)) return 0;
#endif
/* Normalize the length */