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
September 2023
----- 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
23 participants
113 discussions
Start a n
N
ew thread
[reactos] 01/01: [NTOS:MM] Fix missing \n in unimplemented codepath DPRINT
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8c7687063979a6a787c67…
commit 8c7687063979a6a787c67f9360aa91eb43af4db6 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sat Sep 30 19:06:30 2023 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sat Sep 30 19:06:30 2023 +0200 [NTOS:MM] Fix missing \n in unimplemented codepath DPRINT We can hit that unimplemented code-path-line in NtQuerySection() when browsing
youtube.com
with Chromium 49. --- ntoskrnl/mm/section.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ntoskrnl/mm/section.c b/ntoskrnl/mm/section.c index fe07ac03df0..35c36d45cfa 100644 --- a/ntoskrnl/mm/section.c +++ b/ntoskrnl/mm/section.c @@ -17,7 +17,6 @@ * * * PROJECT: ReactOS kernel - * FILE: ntoskrnl/mm/section.c * PURPOSE: Implements section objects * * PROGRAMMERS: Rex Jolliff @@ -3874,7 +3873,7 @@ NtQuerySection( } else { - DPRINT1("Unimplemented code path!"); + DPRINT1("Unimplemented code path\n"); } _SEH2_TRY
1 year, 2 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Larger/smaller Rubber/AirBrush on Ctrl+Plus/Minus (#5740)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=945ee4b2a47402e99beb8…
commit 945ee4b2a47402e99beb8a8e877c32e6cf81bbcd Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 28 21:54:32 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 28 21:54:32 2023 +0900 [MSPAINT] Larger/smaller Rubber/AirBrush on Ctrl+Plus/Minus (#5740) - Enable changing rubber/airbrush thickness by Ctrl+Plus / Ctrl+Minus key combination in TOOL_AIRBRUSH and TOOL_RUBBER. CORE-19094 --- base/applications/mspaint/mouse.cpp | 10 ++++++++++ base/applications/mspaint/toolsmodel.cpp | 12 ++++++++++++ base/applications/mspaint/toolsmodel.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index fc4b1792bec..793efedf3ec 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -505,6 +505,11 @@ struct RubberTool : SmoothDrawTool else Replace(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius()); } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakeRubberThickerOrThinner(bMinus); + } }; // TOOL_FILL @@ -631,6 +636,11 @@ struct AirBrushTool : SmoothDrawTool COLORREF rgb = bLeftButton ? m_fg : m_bg; Airbrush(m_hdc, x, y, rgb, toolsModel.GetAirBrushWidth()); } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakeAirBrushThickerOrThinner(bMinus); + } }; // TOOL_TEXT diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index 07ded56ea99..dec101adc9e 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -99,6 +99,18 @@ void ToolsModel::MakeBrushThickerOrThinner(BOOL bThinner) SetBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); } +void ToolsModel::MakeAirBrushThickerOrThinner(BOOL bThinner) +{ + INT thickness = GetAirBrushWidth(); + SetAirBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); +} + +void ToolsModel::MakeRubberThickerOrThinner(BOOL bThinner) +{ + INT thickness = GetRubberRadius(); + SetRubberRadius(bThinner ? max(1, thickness - 1) : (thickness + 1)); +} + int ToolsModel::GetShapeStyle() const { return m_shapeStyle; diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index b6f2c96fbdb..d90faee117b 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -120,9 +120,11 @@ public: int GetAirBrushWidth() const; void SetAirBrushWidth(int nAirBrushWidth); + void MakeAirBrushThickerOrThinner(BOOL bThinner); int GetRubberRadius() const; void SetRubberRadius(int nRubberRadius); + void MakeRubberThickerOrThinner(BOOL bThinner); BOOL IsBackgroundTransparent() const; void SetBackgroundTransparent(BOOL bTransparent);
1 year, 2 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Larger/smaller brush nib on Ctrl+Plus/Minus (#5739)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8a4787b3841970bc59c55…
commit 8a4787b3841970bc59c5503cb2eeee074a45a7f8 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 28 21:30:34 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 28 21:30:34 2023 +0900 [MSPAINT] Larger/smaller brush nib on Ctrl+Plus/Minus (#5739) - Introduce the concept of "brush width" to the tools model. - Enable changing the brush width by Ctrl+Plus/Minus key combination in TOOL_BRUSH. - Re-define brush styles. CORE-19094 --- base/applications/mspaint/drawing.cpp | 117 ++++++++++++++--------------- base/applications/mspaint/drawing.h | 2 +- base/applications/mspaint/mouse.cpp | 5 +- base/applications/mspaint/toolsettings.cpp | 34 +++++++-- base/applications/mspaint/toolsmodel.cpp | 25 +++++- base/applications/mspaint/toolsmodel.h | 25 +++++- 6 files changed, 132 insertions(+), 76 deletions(-) diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index 96064fff229..3b7579196ce 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -165,73 +165,66 @@ Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r) } void -Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style) +Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style, INT thickness) { HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, 1, color)); HBRUSH oldBrush = (HBRUSH) SelectObject(hdc, CreateSolidBrush(color)); - LONG a, b; - b = max(1, max(labs(x2 - x1), labs(y2 - y1))); - switch (style) + + if (thickness <= 1) + { + Line(hdc, x1, y1, x2, y2, color, thickness); + } + else { - case 0: - for(a = 0; a <= b; a++) - Ellipse(hdc, (x1 * (b - a) + x2 * a) / b - 3, (y1 * (b - a) + y2 * a) / b - 3, - (x1 * (b - a) + x2 * a) / b + 4, (y1 * (b - a) + y2 * a) / b + 4); - break; - case 1: - for(a = 0; a <= b; a++) - Ellipse(hdc, - (x1 * (b - a) + x2 * a) / b - 2, - (y1 * (b - a) + y2 * a) / b - 2, - (x1 * (b - a) + x2 * a) / b + 2, - (y1 * (b - a) + y2 * a) / b + 2); - break; - case 2: - MoveToEx(hdc, x1, y1, NULL); - LineTo(hdc, x2, y2); - ::SetPixelV(hdc, x2, y2, color); - break; - case 3: - for(a = 0; a <= b; a++) - Rectangle(hdc, - (x1 * (b - a) + x2 * a) / b - 4, - (y1 * (b - a) + y2 * a) / b - 4, - (x1 * (b - a) + x2 * a) / b + 4, - (y1 * (b - a) + y2 * a) / b + 4); - break; - case 4: - for(a = 0; a <= b; a++) - Rectangle(hdc, (x1 * (b - a) + x2 * a) / b - 2, (y1 * (b - a) + y2 * a) / b - 2, - (x1 * (b - a) + x2 * a) / b + 3, (y1 * (b - a) + y2 * a) / b + 3); - break; - case 5: - for(a = 0; a <= b; a++) - Rectangle(hdc, (x1 * (b - a) + x2 * a) / b - 1, (y1 * (b - a) + y2 * a) / b - 1, - (x1 * (b - a) + x2 * a) / b + 1, (y1 * (b - a) + y2 * a) / b + 1); - break; - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: + LONG a, b = max(1, max(labs(x2 - x1), labs(y2 - y1))); + switch ((BrushStyle)style) { - POINT offsTop[] = {{3, -3}, {2, -2}, {0, 0}, - {-4, -4}, {-2, -2}, {-1, 0}}; - POINT offsBtm[] = {{-3, 3}, {-2, 2}, {-1, 1}, - {3, 3}, {2, 2}, {0, 1}}; - LONG idx = style - 6; - POINT pts[4]; - pts[0].x = x1 + offsTop[idx].x; - pts[0].y = y1 + offsTop[idx].y; - pts[1].x = x1 + offsBtm[idx].x; - pts[1].y = y1 + offsBtm[idx].y; - pts[2].x = x2 + offsBtm[idx].x; - pts[2].y = y2 + offsBtm[idx].y; - pts[3].x = x2 + offsTop[idx].x; - pts[3].y = y2 + offsTop[idx].y; - Polygon(hdc, pts, 4); - break; + case BrushStyleRound: + for (a = 0; a <= b; a++) + { + Ellipse(hdc, + (x1 * (b - a) + x2 * a) / b - (thickness / 2), + (y1 * (b - a) + y2 * a) / b - (thickness / 2), + (x1 * (b - a) + x2 * a) / b + (thickness / 2), + (y1 * (b - a) + y2 * a) / b + (thickness / 2)); + } + break; + + case BrushStyleSquare: + for (a = 0; a <= b; a++) + { + Rectangle(hdc, + (x1 * (b - a) + x2 * a) / b - (thickness / 2), + (y1 * (b - a) + y2 * a) / b - (thickness / 2), + (x1 * (b - a) + x2 * a) / b + (thickness / 2), + (y1 * (b - a) + y2 * a) / b + (thickness / 2)); + } + break; + + case BrushStyleForeSlash: + case BrushStyleBackSlash: + { + POINT offsetTop, offsetBottom; + if ((BrushStyle)style == BrushStyleForeSlash) + { + offsetTop = { (thickness - 1) / 2, -(thickness - 1) / 2 }; + offsetBottom = { -thickness / 2, thickness / 2 }; + } + else + { + offsetTop = { -thickness / 2, -thickness / 2 }; + offsetBottom = { (thickness - 1) / 2, (thickness - 1) / 2 }; + } + POINT points[4] = + { + { x1 + offsetTop.x, y1 + offsetTop.y }, + { x1 + offsetBottom.x, y1 + offsetBottom.y }, + { x2 + offsetBottom.x, y2 + offsetBottom.y }, + { x2 + offsetTop.x, y2 + offsetTop.y }, + }; + Polygon(hdc, points, _countof(points)); + break; + } } } DeleteObject(SelectObject(hdc, oldBrush)); diff --git a/base/applications/mspaint/drawing.h b/base/applications/mspaint/drawing.h index 950bfdd6974..44936f08503 100644 --- a/base/applications/mspaint/drawing.h +++ b/base/applications/mspaint/drawing.h @@ -27,7 +27,7 @@ void Replace(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF fg, COLORREF void Airbrush(HDC hdc, LONG x, LONG y, COLORREF color, LONG r); -void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style); +void Brush(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, LONG style, INT thickness); void RectSel(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2); diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 04e749db88b..fc4b1792bec 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -609,12 +609,13 @@ struct BrushTool : SmoothDrawTool void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; - Brush(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetBrushStyle()); + Brush(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetBrushStyle(), + toolsModel.GetBrushWidth()); } void OnSpecialTweak(BOOL bMinus) override { - // TODO: + toolsModel.MakeBrushThickerOrThinner(bMinus); } }; diff --git a/base/applications/mspaint/toolsettings.cpp b/base/applications/mspaint/toolsettings.cpp index b2ee9039817..3d869848480 100644 --- a/base/applications/mspaint/toolsettings.cpp +++ b/base/applications/mspaint/toolsettings.cpp @@ -112,23 +112,43 @@ static inline INT getBrushRects(RECT rects[12], LPCRECT prc, LPPOINT ppt = NULL) return getSplitRects(rects, 3, 4, prc, ppt); } +struct BrushStyleAndWidth +{ + BrushStyle style; + INT width; +}; + +static const BrushStyleAndWidth c_BrushPresets[] = +{ + { BrushStyleRound, 7 }, { BrushStyleRound, 4 }, { BrushStyleRound, 1 }, + { BrushStyleSquare, 8 }, { BrushStyleSquare, 5 }, { BrushStyleSquare, 2 }, + { BrushStyleForeSlash, 8 }, { BrushStyleForeSlash, 5 }, { BrushStyleForeSlash, 2 }, + { BrushStyleBackSlash, 8 }, { BrushStyleBackSlash, 5 }, { BrushStyleBackSlash, 2 }, +}; + VOID CToolSettingsWindow::drawBrush(HDC hdc, LPCRECT prc) { RECT rects[12]; getBrushRects(rects, prc); - ::FillRect(hdc, &rects[toolsModel.GetBrushStyle()], (HBRUSH)(COLOR_HIGHLIGHT + 1)); - for (INT i = 0; i < 12; i++) { RECT rcItem = rects[i]; INT x = (rcItem.left + rcItem.right) / 2, y = (rcItem.top + rcItem.bottom) / 2; + INT iColor; - if (i == toolsModel.GetBrushStyle()) + const BrushStyleAndWidth& data = c_BrushPresets[i]; + if (data.width == toolsModel.GetBrushWidth() && data.style == toolsModel.GetBrushStyle()) + { iColor = COLOR_HIGHLIGHTTEXT; + ::FillRect(hdc, &rcItem, (HBRUSH)(COLOR_HIGHLIGHT + 1)); + } else + { iColor = COLOR_WINDOWTEXT; - Brush(hdc, x, y, x, y, ::GetSysColor(iColor), i); + } + + Brush(hdc, x, y, x, y, ::GetSysColor(iColor), data.style, data.width); } } @@ -383,7 +403,11 @@ LRESULT CToolSettingsWindow::OnLButtonDown(UINT nMsg, WPARAM wParam, LPARAM lPar case TOOL_BRUSH: iItem = getBrushRects(rects, &rect1, &pt); if (iItem != -1) - toolsModel.SetBrushStyle(iItem); + { + const BrushStyleAndWidth& data = c_BrushPresets[iItem]; + toolsModel.SetBrushStyle(data.style); + toolsModel.SetBrushWidth(data.width); + } break; case TOOL_AIRBRUSH: iItem = getAirBrushRects(rects, &rect1, &pt); diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index 6b5e41d483a..07ded56ea99 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -14,8 +14,9 @@ ToolsModel toolsModel; ToolsModel::ToolsModel() { m_lineWidth = m_penWidth = 1; + m_brushWidth = 4; m_shapeStyle = 0; - m_brushStyle = 0; + m_brushStyle = BrushStyleRound; m_oldActiveTool = m_activeTool = TOOL_PEN; m_airBrushWidth = 5; m_rubberRadius = 4; @@ -68,6 +69,18 @@ void ToolsModel::SetPenWidth(INT nPenWidth) imageModel.NotifyImageChanged(); } +INT ToolsModel::GetBrushWidth() const +{ + return m_brushWidth; +} + +void ToolsModel::SetBrushWidth(INT nBrushWidth) +{ + m_brushWidth = nBrushWidth; + NotifyToolSettingsChanged(); + imageModel.NotifyImageChanged(); +} + void ToolsModel::MakeLineThickerOrThinner(BOOL bThinner) { INT thickness = GetLineWidth(); @@ -80,6 +93,12 @@ void ToolsModel::MakePenThickerOrThinner(BOOL bThinner) SetPenWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); } +void ToolsModel::MakeBrushThickerOrThinner(BOOL bThinner) +{ + INT thickness = GetBrushWidth(); + SetBrushWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); +} + int ToolsModel::GetShapeStyle() const { return m_shapeStyle; @@ -91,12 +110,12 @@ void ToolsModel::SetShapeStyle(int nShapeStyle) NotifyToolSettingsChanged(); } -int ToolsModel::GetBrushStyle() const +BrushStyle ToolsModel::GetBrushStyle() const { return m_brushStyle; } -void ToolsModel::SetBrushStyle(int nBrushStyle) +void ToolsModel::SetBrushStyle(BrushStyle nBrushStyle) { m_brushStyle = nBrushStyle; NotifyToolSettingsChanged(); diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index efb63b09022..b6f2c96fbdb 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -28,6 +28,14 @@ enum TOOLTYPE TOOL_MAX = TOOL_RRECT, }; +enum BrushStyle +{ + BrushStyleRound, + BrushStyleSquare, + BrushStyleForeSlash, + BrushStyleBackSlash, +}; + /* CLASSES **********************************************************/ struct ToolBase @@ -68,8 +76,9 @@ class ToolsModel private: int m_lineWidth; INT m_penWidth; + INT m_brushWidth; int m_shapeStyle; - int m_brushStyle; + BrushStyle m_brushStyle; TOOLTYPE m_activeTool; TOOLTYPE m_oldActiveTool; int m_airBrushWidth; @@ -97,17 +106,27 @@ public: int GetShapeStyle() const; void SetShapeStyle(int nShapeStyle); - int GetBrushStyle() const; - void SetBrushStyle(int nBrushStyle); + + INT GetBrushWidth() const; + void SetBrushWidth(INT nBrushWidth); + void MakeBrushThickerOrThinner(BOOL bThinner); + + BrushStyle GetBrushStyle() const; + void SetBrushStyle(BrushStyle nBrushStyle); + TOOLTYPE GetActiveTool() const; TOOLTYPE GetOldActiveTool() const; void SetActiveTool(TOOLTYPE nActiveTool); + int GetAirBrushWidth() const; void SetAirBrushWidth(int nAirBrushWidth); + int GetRubberRadius() const; void SetRubberRadius(int nRubberRadius); + BOOL IsBackgroundTransparent() const; void SetBackgroundTransparent(BOOL bTransparent); + int GetZoom() const; void SetZoom(int nZoom);
1 year, 2 months
1
0
0
0
[reactos] 01/01: [NTOS:CM] Simplify CmpDelayAllocBucketLock code a bit (#5729)
by Serge Gautherie
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c84b5007d07c205ff5e00…
commit c84b5007d07c205ff5e00a68489e312a06ad689b Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com> AuthorDate: Thu Sep 28 11:39:13 2023 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 28 11:39:13 2023 +0200 [NTOS:CM] Simplify CmpDelayAllocBucketLock code a bit (#5729) - Remove duplicate CmpDelayAllocBucketLock definition. - Remove an else. --- ntoskrnl/config/cmalloc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/ntoskrnl/config/cmalloc.c b/ntoskrnl/config/cmalloc.c index 7d44ff82135..deabafb82bb 100644 --- a/ntoskrnl/config/cmalloc.c +++ b/ntoskrnl/config/cmalloc.c @@ -15,9 +15,9 @@ /* GLOBALS *******************************************************************/ BOOLEAN CmpAllocInited; -KGUARDED_MUTEX CmpAllocBucketLock, CmpDelayAllocBucketLock; - +KGUARDED_MUTEX CmpAllocBucketLock; LIST_ENTRY CmpFreeKCBListHead; + KGUARDED_MUTEX CmpDelayAllocBucketLock; LIST_ENTRY CmpFreeDelayItemsListHead; @@ -252,16 +252,14 @@ SearchList: /* Clear the KCB pointer */ Entry->Kcb = NULL; } - } - else - { - /* Release the lock */ - KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); - return NULL; + + /* Do the search again */ + goto SearchList; } - /* Do the search again */ - goto SearchList; + /* Release the lock */ + KeReleaseGuardedMutex(&CmpDelayAllocBucketLock); + return NULL; } VOID
1 year, 2 months
1
0
0
0
[reactos] 01/01: [MSPAINT] Larger/smaller pen nib on Ctrl+Plus/Minus (#5738)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f2a012240f8014566cc17…
commit f2a012240f8014566cc17c407f53f2033fca1ffc Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 28 16:32:36 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 28 16:32:36 2023 +0900 [MSPAINT] Larger/smaller pen nib on Ctrl+Plus/Minus (#5738) - Introduce the concept of pen width (not line width) to the tools model. - Enable changing pen/line width by Ctrl+Plus/Minus key combination in TOOL_PEN, TOOL_LINE, TOOL_BEZIER, TOOL_RECT, TOOL_SHAPE, TOO_ELLIPSE, and TOOL_RRECT tools. CORE-19094 --- base/applications/mspaint/drawing.cpp | 1 + base/applications/mspaint/mouse.cpp | 34 ++++++++++++++++----- base/applications/mspaint/toolbox.cpp | 17 +++++------ base/applications/mspaint/toolbox.h | 4 --- base/applications/mspaint/toolsmodel.cpp | 52 ++++++++++++++++++++++++++++---- base/applications/mspaint/toolsmodel.h | 8 +++++ 6 files changed, 89 insertions(+), 27 deletions(-) diff --git a/base/applications/mspaint/drawing.cpp b/base/applications/mspaint/drawing.cpp index 638e78396e2..96064fff229 100644 --- a/base/applications/mspaint/drawing.cpp +++ b/base/applications/mspaint/drawing.cpp @@ -17,6 +17,7 @@ Line(HDC hdc, LONG x1, LONG y1, LONG x2, LONG y2, COLORREF color, int thickness) HPEN oldPen = (HPEN) SelectObject(hdc, CreatePen(PS_SOLID, thickness, color)); MoveToEx(hdc, x1, y1, NULL); LineTo(hdc, x2, y2); + SetPixelV(hdc, x2, y2, color); DeleteObject(SelectObject(hdc, oldPen)); } diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index 70247293361..04e749db88b 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -320,6 +320,11 @@ struct TwoPointDrawTool : ToolBase m_bDrawing = FALSE; ToolBase::OnCancelDraw(); } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakeLineThickerOrThinner(bMinus); + } }; typedef enum DIRECTION @@ -499,8 +504,6 @@ struct RubberTool : SmoothDrawTool Erase(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_bg, toolsModel.GetRubberRadius()); else Replace(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, m_fg, m_bg, toolsModel.GetRubberRadius()); - g_ptEnd.x = x; - g_ptEnd.y = y; } }; @@ -587,10 +590,12 @@ struct PenTool : SmoothDrawTool void draw(BOOL bLeftButton, LONG x, LONG y) override { COLORREF rgb = bLeftButton ? m_fg : m_bg; - Line(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, 1); - ::SetPixelV(m_hdc, x, y, rgb); - g_ptEnd.x = x; - g_ptEnd.y = y; + Line(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetPenWidth()); + } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakePenThickerOrThinner(bMinus); } }; @@ -605,8 +610,11 @@ struct BrushTool : SmoothDrawTool { COLORREF rgb = bLeftButton ? m_fg : m_bg; Brush(m_hdc, g_ptEnd.x, g_ptEnd.y, x, y, rgb, toolsModel.GetBrushStyle()); - g_ptEnd.x = x; - g_ptEnd.y = y; + } + + void OnSpecialTweak(BOOL bMinus) override + { + // TODO: } }; @@ -863,6 +871,11 @@ struct BezierTool : ToolBase m_bDrawing = FALSE; ToolBase::OnFinishDraw(); } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakeLineThickerOrThinner(bMinus); + } }; // TOOL_RECT @@ -991,6 +1004,11 @@ struct ShapeTool : ToolBase ToolBase::OnFinishDraw(); } + + void OnSpecialTweak(BOOL bMinus) override + { + toolsModel.MakeLineThickerOrThinner(bMinus); + } }; // TOOL_ELLIPSE diff --git a/base/applications/mspaint/toolbox.cpp b/base/applications/mspaint/toolbox.cpp index b02d4fb99b8..54d5bd8c2a4 100644 --- a/base/applications/mspaint/toolbox.cpp +++ b/base/applications/mspaint/toolbox.cpp @@ -20,8 +20,13 @@ CPaintToolBar::ToolBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam { // We have to detect clicking on toolbar even if no change of pressed button POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; - INT id = (INT)SendMessage(hwnd, TB_HITTEST, 0, (LPARAM)&pt); - ::PostMessage(::GetParent(hwnd), WM_TOOLBARHIT, id, 0); + INT index = (INT)::SendMessage(hwnd, TB_HITTEST, 0, (LPARAM)&pt); + if (index >= 0) + { + TBBUTTON button; + if (::SendMessage(hwnd, TB_GETBUTTON, index, (LPARAM)&button)) + ::PostMessage(::GetParent(hwnd), WM_COMMAND, button.idCommand, 0); + } } return ::CallWindowProc(oldWndProc, hwnd, uMsg, wParam, lParam); } @@ -112,6 +117,7 @@ static const COMMAND_TO_TOOL CommandToToolMapping[] = { ID_ELLIPSE, TOOL_ELLIPSE }, { ID_RRECT, TOOL_RRECT }, }; +static_assert(_countof(CommandToToolMapping) == TOOL_MAX, "Logical error"); LRESULT CToolBox::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { @@ -183,10 +189,3 @@ LRESULT CToolBox::OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa ::ReleaseCapture(); return 0; } - -LRESULT CToolBox::OnToolBarHit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - // See also: CPaintToolBar::ToolBarWndProc - selectionModel.Landing(); - return 0; -} diff --git a/base/applications/mspaint/toolbox.h b/base/applications/mspaint/toolbox.h index 859493407a4..291032c1fcf 100644 --- a/base/applications/mspaint/toolbox.h +++ b/base/applications/mspaint/toolbox.h @@ -14,8 +14,6 @@ #define CX_TOOLBAR (TOOLBAR_COLUMNS * CXY_TB_BUTTON) #define CY_TOOLBAR (TOOLBAR_ROWS * CXY_TB_BUTTON) -#define WM_TOOLBARHIT (WM_APP + 1) - class CPaintToolBar : public CWindow { public: @@ -36,7 +34,6 @@ public: MESSAGE_HANDLER(WM_MOUSEMOVE, OnMouseMove) MESSAGE_HANDLER(WM_LBUTTONUP, OnLButtonUp) MESSAGE_HANDLER(WM_TOOLSMODELTOOLCHANGED, OnToolsModelToolChanged) - MESSAGE_HANDLER(WM_TOOLBARHIT, OnToolBarHit) END_MSG_MAP() BOOL DoCreate(HWND hwndParent); @@ -51,5 +48,4 @@ private: LRESULT OnMouseMove(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnLButtonUp(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnToolsModelToolChanged(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnToolBarHit(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); }; diff --git a/base/applications/mspaint/toolsmodel.cpp b/base/applications/mspaint/toolsmodel.cpp index b787e6d591e..6b5e41d483a 100644 --- a/base/applications/mspaint/toolsmodel.cpp +++ b/base/applications/mspaint/toolsmodel.cpp @@ -13,7 +13,7 @@ ToolsModel toolsModel; ToolsModel::ToolsModel() { - m_lineWidth = 1; + m_lineWidth = m_penWidth = 1; m_shapeStyle = 0; m_brushStyle = 0; m_oldActiveTool = m_activeTool = TOOL_PEN; @@ -53,6 +53,31 @@ void ToolsModel::SetLineWidth(int nLineWidth) { m_lineWidth = nLineWidth; NotifyToolSettingsChanged(); + imageModel.NotifyImageChanged(); +} + +INT ToolsModel::GetPenWidth() const +{ + return m_penWidth; +} + +void ToolsModel::SetPenWidth(INT nPenWidth) +{ + m_penWidth = nPenWidth; + NotifyToolSettingsChanged(); + imageModel.NotifyImageChanged(); +} + +void ToolsModel::MakeLineThickerOrThinner(BOOL bThinner) +{ + INT thickness = GetLineWidth(); + SetLineWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); +} + +void ToolsModel::MakePenThickerOrThinner(BOOL bThinner) +{ + INT thickness = GetPenWidth(); + SetPenWidth(bThinner ? max(1, thickness - 1) : (thickness + 1)); } int ToolsModel::GetShapeStyle() const @@ -91,23 +116,38 @@ void ToolsModel::SetActiveTool(TOOLTYPE nActiveTool) { OnFinishDraw(); + selectionModel.Landing(); + + m_activeTool = nActiveTool; + switch (m_activeTool) { case TOOL_FREESEL: case TOOL_RECTSEL: - case TOOL_RUBBER: case TOOL_COLOR: case TOOL_ZOOM: case TOOL_TEXT: + // The active tool is not an actually drawing tool break; - default: - m_oldActiveTool = m_activeTool; + case TOOL_LINE: + case TOOL_BEZIER: + case TOOL_RECT: + case TOOL_SHAPE: + case TOOL_ELLIPSE: + case TOOL_FILL: + case TOOL_AIRBRUSH: + case TOOL_RRECT: + case TOOL_RUBBER: + case TOOL_BRUSH: + case TOOL_PEN: + // The active tool is an actually drawing tool. Save it for TOOL_COLOR to restore + m_oldActiveTool = nActiveTool; break; } - m_activeTool = nActiveTool; m_pToolObject = GetOrCreateTool(m_activeTool); + NotifyToolChanged(); } @@ -189,9 +229,9 @@ void ToolsModel::NotifyZoomChanged() void ToolsModel::OnButtonDown(BOOL bLeftButton, LONG x, LONG y, BOOL bDoubleClick) { m_pToolObject->beginEvent(); - m_pToolObject->OnButtonDown(bLeftButton, x, y, bDoubleClick); g_ptStart.x = g_ptEnd.x = x; g_ptStart.y = g_ptEnd.y = y; + m_pToolObject->OnButtonDown(bLeftButton, x, y, bDoubleClick); m_pToolObject->endEvent(); } diff --git a/base/applications/mspaint/toolsmodel.h b/base/applications/mspaint/toolsmodel.h index 09f48672a01..efb63b09022 100644 --- a/base/applications/mspaint/toolsmodel.h +++ b/base/applications/mspaint/toolsmodel.h @@ -67,6 +67,7 @@ class ToolsModel { private: int m_lineWidth; + INT m_penWidth; int m_shapeStyle; int m_brushStyle; TOOLTYPE m_activeTool; @@ -85,8 +86,15 @@ public: ~ToolsModel(); BOOL IsSelection() const; + int GetLineWidth() const; void SetLineWidth(int nLineWidth); + void MakeLineThickerOrThinner(BOOL bThinner); + + INT GetPenWidth() const; + void SetPenWidth(INT nPenWidth); + void MakePenThickerOrThinner(BOOL bThinner); + int GetShapeStyle() const; void SetShapeStyle(int nShapeStyle); int GetBrushStyle() const;
1 year, 2 months
1
0
0
0
[reactos] 01/01: [MSPAINT] "Selection Clone" and "Selection Brush" (#5734)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cbc63d876c3295635a6bb…
commit cbc63d876c3295635a6bb1b30993e9bd79873941 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Sep 28 07:34:25 2023 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Sep 28 07:34:25 2023 +0900 [MSPAINT] "Selection Clone" and "Selection Brush" (#5734) - Stamp the image of the selection when the user clicks on the selection while holding down the Ctrl key. - Draw the image of the selection continuously when the user starts dragging the selection while holding down the Shift key. CORE-19094 --- base/applications/mspaint/canvas.cpp | 15 +++++++++++++++ base/applications/mspaint/history.cpp | 13 +++++++++++++ base/applications/mspaint/history.h | 1 + base/applications/mspaint/mouse.cpp | 6 ------ base/applications/mspaint/selectionmodel.cpp | 11 +++++++++++ base/applications/mspaint/selectionmodel.h | 1 + base/applications/mspaint/winproc.cpp | 10 ++++++++++ 7 files changed, 51 insertions(+), 6 deletions(-) diff --git a/base/applications/mspaint/canvas.cpp b/base/applications/mspaint/canvas.cpp index a403c8bd456..d62779f39a6 100644 --- a/base/applications/mspaint/canvas.cpp +++ b/base/applications/mspaint/canvas.cpp @@ -268,9 +268,18 @@ LRESULT CCanvasWindow::OnLRButtonDown(BOOL bLeftButton, UINT nMsg, WPARAM wParam HITTEST hitSelection = SelectionHitTest(pt); if (hitSelection != HIT_NONE) { + selectionModel.m_nSelectionBrush = 0; // Selection Brush is OFF if (bLeftButton) { CanvasToImage(pt); + if (::GetKeyState(VK_CONTROL) < 0) // Ctrl+Click is Selection Clone + { + imageModel.SelectionClone(); + } + else if (::GetKeyState(VK_SHIFT) < 0) // Shift+Dragging is Selection Brush + { + selectionModel.m_nSelectionBrush = 1; // Selection Brush is ON + } StartSelectionDrag(hitSelection, pt); } else @@ -790,6 +799,12 @@ VOID CCanvasWindow::StartSelectionDrag(HITTEST hit, POINT ptImage) VOID CCanvasWindow::SelectionDragging(POINT ptImage) { + if (selectionModel.m_nSelectionBrush) + { + imageModel.SelectionClone(selectionModel.m_nSelectionBrush == 1); + selectionModel.m_nSelectionBrush = 2; // Selection Brush is ON and drawn + } + selectionModel.Dragging(m_hitSelection, ptImage); Invalidate(FALSE); } diff --git a/base/applications/mspaint/history.cpp b/base/applications/mspaint/history.cpp index e44eca7dc4d..9e924b9e3db 100644 --- a/base/applications/mspaint/history.cpp +++ b/base/applications/mspaint/history.cpp @@ -299,3 +299,16 @@ void ImageModel::UnlockBitmap(HBITMAP hbmLocked) m_hBms[m_currInd] = hbmLocked; m_hbmOld = ::SelectObject(m_hDrawingDC, hbmLocked); // Re-select } + +void ImageModel::SelectionClone(BOOL bUndoable) +{ + if (!selectionModel.m_bShow || ::IsRectEmpty(&selectionModel.m_rc)) + return; + + if (bUndoable) + PushImageForUndo(CopyBitmap()); + + selectionModel.DrawSelection(m_hDrawingDC, paletteModel.GetBgColor(), + toolsModel.IsBackgroundTransparent()); + NotifyImageChanged(); +} diff --git a/base/applications/mspaint/history.h b/base/applications/mspaint/history.h index fb369dff72c..24f1e09cd13 100644 --- a/base/applications/mspaint/history.h +++ b/base/applications/mspaint/history.h @@ -41,6 +41,7 @@ public: void NotifyImageChanged(); BOOL IsBlackAndWhite(); void PushBlackAndWhite(); + void SelectionClone(BOOL bUndoable = TRUE); protected: HDC m_hDrawingDC; // The device context for this class diff --git a/base/applications/mspaint/mouse.cpp b/base/applications/mspaint/mouse.cpp index d8e3585c252..70247293361 100644 --- a/base/applications/mspaint/mouse.cpp +++ b/base/applications/mspaint/mouse.cpp @@ -112,10 +112,7 @@ struct FreeSelTool : ToolBase void OnDrawOverlayOnImage(HDC hdc) override { if (!selectionModel.IsLanded()) - { - selectionModel.DrawBackgroundPoly(hdc, selectionModel.m_rgbBack); selectionModel.DrawSelection(hdc, paletteModel.GetBgColor(), toolsModel.IsBackgroundTransparent()); - } if (canvasWindow.m_drawing) { @@ -208,10 +205,7 @@ struct RectSelTool : ToolBase void OnDrawOverlayOnImage(HDC hdc) override { if (!selectionModel.IsLanded()) - { - selectionModel.DrawBackgroundRect(hdc, selectionModel.m_rgbBack); selectionModel.DrawSelection(hdc, paletteModel.GetBgColor(), toolsModel.IsBackgroundTransparent()); - } if (canvasWindow.m_drawing) { diff --git a/base/applications/mspaint/selectionmodel.cpp b/base/applications/mspaint/selectionmodel.cpp index c768c360744..e7263fa4e1f 100644 --- a/base/applications/mspaint/selectionmodel.cpp +++ b/base/applications/mspaint/selectionmodel.cpp @@ -187,6 +187,17 @@ BOOL SelectionModel::TakeOff() // Save the selection area m_rcOld = m_rc; + if (toolsModel.GetActiveTool() == TOOL_RECTSEL) + { + imageModel.PushImageForUndo(); + selectionModel.DrawBackgroundRect(imageModel.GetDC(), selectionModel.m_rgbBack); + } + else if (toolsModel.GetActiveTool() == TOOL_FREESEL) + { + imageModel.PushImageForUndo(); + selectionModel.DrawBackgroundPoly(imageModel.GetDC(), selectionModel.m_rgbBack); + } + imageModel.NotifyImageChanged(); return TRUE; } diff --git a/base/applications/mspaint/selectionmodel.h b/base/applications/mspaint/selectionmodel.h index 1d0c1b28614..308952a6e67 100644 --- a/base/applications/mspaint/selectionmodel.h +++ b/base/applications/mspaint/selectionmodel.h @@ -23,6 +23,7 @@ public: CRect m_rc; // in image pixel coordinates POINT m_ptHit; // in image pixel coordinates CRect m_rcOld; // in image pixel coordinates + INT m_nSelectionBrush = 0; SelectionModel(); ~SelectionModel(); diff --git a/base/applications/mspaint/winproc.cpp b/base/applications/mspaint/winproc.cpp index 99658fccd52..b0330b4292d 100644 --- a/base/applications/mspaint/winproc.cpp +++ b/base/applications/mspaint/winproc.cpp @@ -704,6 +704,16 @@ LRESULT CMainWindow::OnCommand(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bH if (toolsModel.IsSelection()) { canvasWindow.cancelDrawing(); + if (toolsModel.GetActiveTool() == TOOL_FREESEL || + toolsModel.GetActiveTool() == TOOL_RECTSEL) + { + imageModel.Undo(); + if (selectionModel.m_nSelectionBrush == 2) // Selection Brush is drawn + { + imageModel.Undo(); + selectionModel.m_nSelectionBrush = 0; + } + } break; } }
1 year, 2 months
1
0
0
0
[reactos] 01/01: [NTOS/Mm] Fix SWAPENTRY bit-check in MmCreatePageFileMapping
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03283371c101521b7eab4…
commit 03283371c101521b7eab459c2be71ecce6f0a1d8 Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Wed Jan 4 23:17:57 2023 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Thu Sep 28 01:19:47 2023 +0300 [NTOS/Mm] Fix SWAPENTRY bit-check in MmCreatePageFileMapping Test for the highest bit, not for bit 3 / 7. --- ntoskrnl/mm/i386/page.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntoskrnl/mm/i386/page.c b/ntoskrnl/mm/i386/page.c index e0f7a304c8b..df13cb013e2 100644 --- a/ntoskrnl/mm/i386/page.c +++ b/ntoskrnl/mm/i386/page.c @@ -598,7 +598,7 @@ MmCreatePageFileMapping(PEPROCESS Process, /* And we don't support creating for other process */ ASSERT(Process == PsGetCurrentProcess()); - if (SwapEntry & (1 << (sizeof(SWAPENTRY) - 1))) + if (SwapEntry & ((ULONG_PTR)1 << (RTL_BITS_OF(SWAPENTRY) - 1))) { KeBugCheck(MEMORY_MANAGEMENT); }
1 year, 2 months
1
0
0
0
[reactos] 01/01: [SHELL32] *.rc: AGAIN! Use 1996 as birth year in IDD_ABOUT for consistency
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=058b746bbe0884e27f8c2…
commit 058b746bbe0884e27f8c24d8f56cfb3270cc5f51 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Wed Sep 27 22:23:31 2023 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Wed Sep 27 22:23:31 2023 +0200 [SHELL32] *.rc: AGAIN! Use 1996 as birth year in IDD_ABOUT for consistency We do use the birth year 1996 instead of 1998 within our msgina pictures already, and also within the [SDK] for autogenerated file-info. Since SHELL32 IDD_ABOUT is used by many applications it makes sense to harmonize with that. Was done already during 0.4.15-dev for SHELL32, but we have to do it again, since some recent translation PRs to match the en-US.rc again. --- dll/win32/shell32/lang/et-EE.rc | 2 +- dll/win32/shell32/lang/he-IL.rc | 2 +- dll/win32/shell32/lang/hi-IN.rc | 2 +- dll/win32/shell32/lang/ro-RO.rc | 2 +- dll/win32/shell32/lang/tr-TR.rc | 2 +- dll/win32/shell32/lang/zh-CN.rc | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dll/win32/shell32/lang/et-EE.rc b/dll/win32/shell32/lang/et-EE.rc index c61f8875535..82ba06904c7 100644 --- a/dll/win32/shell32/lang/et-EE.rc +++ b/dll/win32/shell32/lang/et-EE.rc @@ -142,7 +142,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "Autoriõigus 1998-", IDC_STATIC, 35, 75, 53, 10 + LTEXT "Autoriõigus 1996-", IDC_STATIC, 35, 75, 53, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 88, 75, 17, 10 LTEXT " ReactOS Team\0", IDC_STATIC, 105, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX diff --git a/dll/win32/shell32/lang/he-IL.rc b/dll/win32/shell32/lang/he-IL.rc index e41a4b769a3..197e6a853fa 100644 --- a/dll/win32/shell32/lang/he-IL.rc +++ b/dll/win32/shell32/lang/he-IL.rc @@ -137,7 +137,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "זכויות יוצרים 1998-", IDC_STATIC, 35, 75, 53, 10 + LTEXT "זכויות יוצרים 1996-", IDC_STATIC, 35, 75, 53, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 88, 75, 17, 10 LTEXT " צוות ReactOS\0", IDC_STATIC, 105, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX diff --git a/dll/win32/shell32/lang/hi-IN.rc b/dll/win32/shell32/lang/hi-IN.rc index 609c2bb38a8..1e22c50b0d8 100644 --- a/dll/win32/shell32/lang/hi-IN.rc +++ b/dll/win32/shell32/lang/hi-IN.rc @@ -142,7 +142,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "कॉपीराइट 1998-", IDC_STATIC, 35, 75, 53, 10 + LTEXT "कॉपीराइट 1996-", IDC_STATIC, 35, 75, 53, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 88, 75, 17, 10 LTEXT " रिऐक्ट ओएस टीम\0", IDC_STATIC, 105, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX diff --git a/dll/win32/shell32/lang/ro-RO.rc b/dll/win32/shell32/lang/ro-RO.rc index 2ad102e0fc6..fa976a2f9fe 100644 --- a/dll/win32/shell32/lang/ro-RO.rc +++ b/dll/win32/shell32/lang/ro-RO.rc @@ -138,7 +138,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "Drept de autor 1998-", IDC_STATIC, 35, 75, 68, 10 + LTEXT "Drept de autor 1996-", IDC_STATIC, 35, 75, 68, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 103, 75, 17, 10 LTEXT " Echipa ReactOS\0", IDC_STATIC, 120, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX diff --git a/dll/win32/shell32/lang/tr-TR.rc b/dll/win32/shell32/lang/tr-TR.rc index b45a252a61f..910816daf69 100644 --- a/dll/win32/shell32/lang/tr-TR.rc +++ b/dll/win32/shell32/lang/tr-TR.rc @@ -137,7 +137,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "Telif Hakkı 1998-", IDC_STATIC, 35, 75, 53, 10 + LTEXT "Telif Hakkı 1996-", IDC_STATIC, 35, 75, 53, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 88, 75, 17, 10 LTEXT " ReactOS Takımı\0", IDC_STATIC, 105, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX diff --git a/dll/win32/shell32/lang/zh-CN.rc b/dll/win32/shell32/lang/zh-CN.rc index 32f4421c1b0..24a81bf627b 100644 --- a/dll/win32/shell32/lang/zh-CN.rc +++ b/dll/win32/shell32/lang/zh-CN.rc @@ -145,7 +145,7 @@ BEGIN ICON "", IDC_ABOUT_ICON, 7, 55, 21, 20 LTEXT "", IDC_ABOUT_APPNAME, 35, 55, 200, 10, SS_NOPREFIX LTEXT "", IDC_ABOUT_VERSION, 35, 65, 250, 10, SS_NOPREFIX - LTEXT "版权所有 1998-", IDC_STATIC, 35, 75, 53, 10 + LTEXT "版权所有 1996-", IDC_STATIC, 35, 75, 53, 10 LTEXT COPYRIGHT_YEAR, IDC_STATIC, 88, 75, 17, 10 LTEXT " ReactOS Team\0", IDC_STATIC, 105, 75, 53, 10 LTEXT "", IDC_ABOUT_OTHERSTUFF, 35, 90, 180, 20, SS_NOPREFIX
1 year, 2 months
1
0
0
0
[reactos] 01/01: [MAZESCR] Avoid (DLGPROC) cast, fix a typo (#5694)
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=29c0e23fd4a5de8ae15b9…
commit 29c0e23fd4a5de8ae15b9f0efecf7f2833c30761 Author: Joachim Henze <joachim.henze(a)reactos.org> AuthorDate: Wed Sep 27 19:37:44 2023 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Sep 27 17:37:44 2023 +0000 [MAZESCR] Avoid (DLGPROC) cast, fix a typo (#5694) May help a bit with x64. Co-authored-by: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> --- modules/rosapps/applications/screensavers/mazescr/maze.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/modules/rosapps/applications/screensavers/mazescr/maze.c b/modules/rosapps/applications/screensavers/mazescr/maze.c index 1b1ed42340b..bff5bdd63a6 100644 --- a/modules/rosapps/applications/screensavers/mazescr/maze.c +++ b/modules/rosapps/applications/screensavers/mazescr/maze.c @@ -632,7 +632,7 @@ static BOOL OnCreate(HWND hWnd, LPCREATESTRUCT lpCreateStruct) return TRUE; } -BOOL WINAPI AboutProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) +INT_PTR CALLBACK AboutProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam) { switch(message){ case WM_COMMAND: @@ -684,7 +684,6 @@ LRESULT CALLBACK ScreenSaverProc( start_timer(hWnd, solve_delay); break; - case 3: if (!solve_maze(hWnd)) { @@ -696,7 +695,6 @@ LRESULT CALLBACK ScreenSaverProc( start_timer(hWnd, post_solve_delay); } break; - default: initialize_maze(); @@ -711,14 +709,12 @@ LRESULT CALLBACK ScreenSaverProc( break; } break; - case WM_DESTROY: // message: window being destroyed DeleteObject(hBrushLiving); DeleteObject(hBrushDead); ReleaseDC(hWnd, hDC); break; - - default: // Passes it on if unproccessed + default: // Passes it on if unprocessed return DefScreenSaverProc(hWnd, message, wParam, lParam); } return 0; @@ -757,7 +753,7 @@ BOOL WINAPI ScreenSaverConfigureDialog(HWND hWnd, UINT message, WPARAM wparam, L EndDialog(hWnd, TRUE); break; case IDABOUT: - DialogBox(hMainInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hWnd, (DLGPROC)AboutProc); + DialogBox(hMainInstance, MAKEINTRESOURCE(IDD_DLG_ABOUT), hWnd, AboutProc); break; } case WM_HSCROLL:
1 year, 2 months
1
0
0
0
[reactos] 01/01: [CMICONTROL] Fix MSVC 14.2 dbg x64 warning C4267 (#5696)
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e69d2e8b89f34ddb99442…
commit e69d2e8b89f34ddb99442f36a75c5e3d61f34629 Author: Joachim Henze <joachim.henze(a)reactos.org> AuthorDate: Wed Sep 27 19:34:32 2023 +0200 Commit: GitHub <noreply(a)github.com> CommitDate: Wed Sep 27 17:34:32 2023 +0000 [CMICONTROL] Fix MSVC 14.2 dbg x64 warning C4267 (#5696) Can be observed on the buildbots: 2023-09-17T14:19:34.2051345Z [10663/14808] Building CXX object drivers\wdm\audio\drivers\CMIDriver\cmicontrol\CMakeFiles\cmicontrol.dir\main.cpp.obj 2023-09-17T14:19:34.2052611Z D:\a\reactos\reactos\src\drivers\wdm\audio\drivers\CMIDriver\cmicontrol\main.cpp(818): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data --- drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp index e5711703966..7317b363456 100644 --- a/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp +++ b/drivers/wdm/audio/drivers/CMIDriver/cmicontrol/main.cpp @@ -799,7 +799,7 @@ void printUsage() void deleteDriverFiles() { TCHAR SysDir[MAX_PATH]; - unsigned int len; + size_t len; if (GetSystemDirectory(SysDir, sizeof(SysDir))==0) { PrintLastError("GetSystemDirectory()"); return;
1 year, 2 months
1
0
0
0
← Newer
1
2
3
4
...
12
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
Results per page:
10
25
50
100
200