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
May 2019
----- 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
17 participants
165 discussions
Start a n
N
ew thread
[reactos] 01/01: [GDI32_APITEST] Strengthen TextTransform more (#1568)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=68fcf906d9237dac842a4…
commit 68fcf906d9237dac842a4297722edfdcb39da0de Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun May 19 19:11:12 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun May 19 19:11:12 2019 +0900 [GDI32_APITEST] Strengthen TextTransform more (#1568) Appendant to #1567. Add more tests for gdi32_apitest!TextTransform. CORE-15554 --- modules/rostests/apitests/gdi32/TextTransform.c | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/modules/rostests/apitests/gdi32/TextTransform.c b/modules/rostests/apitests/gdi32/TextTransform.c index ca3eea8f7e6..47657e88a29 100644 --- a/modules/rostests/apitests/gdi32/TextTransform.c +++ b/modules/rostests/apitests/gdi32/TextTransform.c @@ -186,6 +186,18 @@ static const TEST_ENTRY s_entries[] = 3, {POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -1), POS(-1, -1)}}, {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, HEIGHT/4}, TRUE, L"305.bmp", 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -1), POS(-3, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, 0}, TRUE, L"306.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 1), POS(-1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, -HEIGHT/2}, TRUE, L"307.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 3), POS(-3, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, L"308.bmp", + 2, {POS(-1, -1), POS(1, -1)}, 2, {POS(-1, 1), POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, L"309.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, 1), POS(-1, 3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, HEIGHT/4}, TRUE, L"310.bmp", + 4, {POS(-1, -1), POS(1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 3), POS(-1, 3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, -HEIGHT/2}, TRUE, L"311.bmp", + 4, {POS(-1, -1), POS(1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 3), POS(-3, 1)}}, // GM_ADVANCED TA_CENTER TA_TOP {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, L"400.bmp", @@ -200,6 +212,18 @@ static const TEST_ENTRY s_entries[] = 2, {POS(-1, 1), POS(1, 1)}, 2, {POS(1, -1), POS(3, -1)}}, {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, HEIGHT/4}, TRUE, L"405.bmp", 2, {POS(-1, -1), POS(-1, 1)}, 2, {POS(1, -1), POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, -HEIGHT/2}, TRUE, L"406.bmp", + 4, {POS(-1, -1), POS(1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(-3, 1), POS(-3, 3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {2, 0, 0, 1, WIDTH/4, -HEIGHT/2}, TRUE, L"407.bmp", + 4, {POS(-1, -1), POS(1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(-3, -3), POS(-1, -3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {2, 0, 0, 2, WIDTH/4, -HEIGHT/2}, TRUE, L"408.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 4, {POS(-3, 3), POS(-3, 1), POS(-3, 1), POS(-1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, -HEIGHT/2}, TRUE, L"409.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 3), POS(-3, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {2, 0, 0, 1, WIDTH/4, -HEIGHT/2}, TRUE, L"410.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -3), POS(-1, -3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, -HEIGHT/2}, TRUE, L"411.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, 1), POS(-3, 3)}}, // GM_ADVANCED TA_RIGHT TA_TOP {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, L"500.bmp", @@ -214,6 +238,18 @@ static const TEST_ENTRY s_entries[] = 2, {POS(-1, 1), POS(1, 1)}, 2, {POS(-1, -1), POS(1, -1)}}, {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, L"505.bmp", 2, {POS(-1, -1), POS(-1, 1)}, 2, {POS(1, -1), POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, WIDTH/2, -HEIGHT/2}, TRUE, L"506.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -3), POS(-1, -3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/2, -HEIGHT/2}, TRUE, L"507.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, 3), POS(-1, 1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 2, WIDTH, -HEIGHT/2}, TRUE, L"508.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, -1)}, 4, {POS(1, 1), POS(3, 1), POS(1, 3), POS(3, 3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/2, -HEIGHT/2}, TRUE, L"509.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, 1), POS(-1, 3)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, WIDTH/2, -HEIGHT/4}, TRUE, L"510.bmp", + 3, {POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -1), POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {0, YCENTER}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/2, -HEIGHT/2}, TRUE, L"511.bmp", + 3, {POS(-1, -1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, 1), POS(-1, 3)}}, }; static const INT s_entry_count = (INT)(sizeof(s_entries) / sizeof(s_entries[0]));
5 years, 7 months
1
0
0
0
[reactos] 01/01: [GDI32_APITEST] Fix MSVC build
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a071a19efe3ff48b5f05…
commit 3a071a19efe3ff48b5f05c39c0843dee1fa8df7d Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun May 19 15:08:38 2019 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sun May 19 15:08:38 2019 +0900 [GDI32_APITEST] Fix MSVC build --- modules/rostests/apitests/gdi32/TextTransform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/rostests/apitests/gdi32/TextTransform.c b/modules/rostests/apitests/gdi32/TextTransform.c index c09579db649..ca3eea8f7e6 100644 --- a/modules/rostests/apitests/gdi32/TextTransform.c +++ b/modules/rostests/apitests/gdi32/TextTransform.c @@ -207,7 +207,7 @@ static const TEST_ENTRY s_entries[] = {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, 0}, TRUE, L"501.bmp", 3, {POS(-1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(1, -3), POS(1, -1)}}, {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 2, -WIDTH/4, HEIGHT/4}, TRUE, L"502.bmp", - 0, {}, 4, {POS(-1, -1), POS(1, -1), POS(1, -1), POS(-1, -1)}}, + 0, {POS(0, 0)}, 4, {POS(-1, -1), POS(1, -1), POS(1, -1), POS(-1, -1)}}, {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, 0}, TRUE, L"503.bmp", 3, {POS(-1, 1), POS(1, 1), POS(-1, -1)}, 2, {POS(1, -1), POS(1, -3)}}, {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, L"504.bmp",
5 years, 7 months
1
0
0
0
[reactos] 01/01: [GDI32_APITEST] Strengthen TextTransform testcase (#1567)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7373cb31740507f789d82…
commit 7373cb31740507f789d829f8a7cfe12a8f1e2a4c Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sun May 19 14:13:56 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sun May 19 14:13:56 2019 +0900 [GDI32_APITEST] Strengthen TextTransform testcase (#1567) CORE-15554 --- modules/rostests/apitests/gdi32/TextTransform.c | 351 ++++++++++++++---------- 1 file changed, 209 insertions(+), 142 deletions(-) diff --git a/modules/rostests/apitests/gdi32/TextTransform.c b/modules/rostests/apitests/gdi32/TextTransform.c index 7f7a1ccfa76..c09579db649 100644 --- a/modules/rostests/apitests/gdi32/TextTransform.c +++ b/modules/rostests/apitests/gdi32/TextTransform.c @@ -86,18 +86,201 @@ static BOOL SaveBitmapToFile(LPCWSTR pszFileName, HBITMAP hbm) } #endif -static VOID -setXFORM(XFORM *pxform, - FLOAT eM11, FLOAT eM12, - FLOAT eM21, FLOAT eM22, - FLOAT eDx, FLOAT eDy) +typedef struct TEST_ENTRY { - pxform->eM11 = eM11; - pxform->eM12 = eM12; - pxform->eM21 = eM21; - pxform->eM22 = eM22; - pxform->eDx = eDx; - pxform->eDy = eDy; + INT line; // line number + INT GraphicsMode; // GM_COMPATIBLE or GM_ADVANCED + POINT ptRef; // reference point + INT TextAlign; + XFORM xform; + BOOL xform_ok; + LPCWSTR filename; + INT cWhitePoints; // number of white points + POINT WhitePoints[4]; + INT cBlackPoints; // number of black points + POINT BlackPoints[4]; +} TEST_ENTRY; + +#define WIDTH 400 +#define HEIGHT 400 +#define XCENTER (WIDTH / 2) +#define YCENTER (HEIGHT / 2) +#define BLACK RGB(0, 0, 0) +#define WHITE RGB(255, 255, 255) +#define LFHEIGHT -100 + +static const RECT s_rc = {0, 0, WIDTH, HEIGHT}; +static HBRUSH s_hWhiteBrush = NULL; +static HPEN s_hRedPen = NULL; + +#define POS(ix, iy) {XCENTER + (ix) * WIDTH/8, YCENTER + (iy) * HEIGHT/8} + +#define NO_TRANS_1 \ + 3, {POS(1, 1), POS(-1, 1), POS(-1, -1)}, 1, {POS(1, -1)} + +#define NO_TRANS_2 \ + 3, {POS(1, -1), POS(-1, 1), POS(-1, -1)}, 1, {POS(1, 1)} + +static const TEST_ENTRY s_entries[] = +{ + // GM_COMPATIBLE TA_BOTTOM + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, FALSE, L"000.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1.5, 0, 0, 1, 0, 0}, FALSE, L"001.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1.5, 0, 0}, FALSE, L"002.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, FALSE, L"003.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, FALSE, L"004.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, FALSE, L"005.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, 1, 0, 0, 0}, FALSE, L"006.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, -1, 0, 0, 0}, FALSE, L"007.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, FALSE, L"009.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 0, 1, 0, 0}, FALSE, L"009.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, L"010.bmp", NO_TRANS_1}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, L"011.bmp", NO_TRANS_1}, + + // GM_COMPATIBLE TA_TOP + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1, 0, 0}, FALSE, L"100.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1.5, 0, 0, 1, 0, 0}, FALSE, L"101.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, 1.5, 0, 0}, FALSE, L"102.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {-1, 0, 0, 1, 0, 0}, FALSE, L"103.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 0, 0, -1, 0, 0}, FALSE, L"104.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 1, 0, 0, 0}, FALSE, L"105.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, 1, 0, 0, 0}, FALSE, L"106.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, -1, 0, 0, 0}, FALSE, L"107.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, -1, -1, 0, 0, 0}, FALSE, L"109.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 1, 0, 1, 0, 0}, FALSE, L"109.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {1, 1, 1, 1, 0, 0}, FALSE, L"110.bmp", NO_TRANS_2}, + {__LINE__, GM_COMPATIBLE, {XCENTER, YCENTER}, TA_LEFT | TA_TOP, {0, 0, 0, 0, 0, 0}, FALSE, L"111.bmp", NO_TRANS_2}, + + // GM_ADVANCED TA_LEFT TA_BOTTOM + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1, 0, 0}, TRUE, L"200.bmp", NO_TRANS_1}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1.5, 0, 0, 1, 0, 0}, TRUE, L"201.bmp", + 4, {POS(-1, -1), POS(1, -1), POS(-1, 1), POS(1, 1)}, 1, {POS(3, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, 1.5, 0, 0}, TRUE, L"202.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, -1)}, 1, {POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {-1, 0, 0, 1, 0, 0}, TRUE, L"203.bmp", + 3, {POS(1, -1), POS(-1, 1), POS(1, -1)}, 1, {POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {1, 0, 0, -1, 0, 0}, TRUE, L"204.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, -1)}, 1, {POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 1, 0, 0, 0}, TRUE, L"205.bmp", + 3, {POS(-1, -1), POS(1, 1), POS(1, -1)}, 1, {POS(-1, 1)}}, + {__LINE__, GM_ADVANCED, {-XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, 1, 0, 0, 0}, TRUE, L"206.bmp", + 3, {POS(-1, 1), POS(1, 1), POS(1, -1)}, 1, {POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, -1, 0, 0, 0}, TRUE, L"207.bmp", + 3, {POS(-1, 1), POS(-1, -1), POS(1, -1)}, 1, {POS(1, 1)}}, + {__LINE__, GM_ADVANCED, {-XCENTER, -YCENTER}, TA_LEFT | TA_BOTTOM, {0, -1, -1, 0, 0, 0}, TRUE, L"208.bmp", + 3, {POS(-1, 1), POS(-1, -1), POS(1, 1)}, 1, {POS(1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 1, 0, 1, 0, 0}, FALSE, L"209.bmp", NO_TRANS_1}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {1, 1, 1, 1, 0, 0}, FALSE, L"210.bmp", NO_TRANS_1}, + {__LINE__, GM_ADVANCED, {XCENTER, YCENTER}, TA_LEFT | TA_BOTTOM, {0, 0, 0, 0, 0, 0}, FALSE, L"211.bmp", NO_TRANS_1}, + + // GM_ADVANCED TA_LEFT TA_TOP + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, 0}, TRUE, L"300.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -3), POS(-1, -3)}}, + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, 0}, TRUE, L"301.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -3), POS(-3, -1)}}, + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, WIDTH/4, 0}, TRUE, L"302.bmp", + 3, {POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, -3), POS(1, -3)}}, + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, WIDTH/4, 0}, TRUE, L"303.bmp", + 3, {POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, -3), POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {2, 0, 0, 1, 0, HEIGHT/4}, TRUE, L"304.bmp", + 3, {POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -1), POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {0, 0}, TA_LEFT | TA_TOP, {1, 0, 0, 2, 0, HEIGHT/4}, TRUE, L"305.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-3, -1), POS(-3, 1)}}, + + // GM_ADVANCED TA_CENTER TA_TOP + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, L"400.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(1, -3), POS(3, -3)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, 0}, TRUE, L"401.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(1, -3), POS(1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 2, -WIDTH/4, HEIGHT/4}, TRUE, L"402.bmp", + 2, {POS(-1, 1), POS(-1, -1)}, 4, {POS(1, -1), POS(3, -1), POS(1, 1), POS(3, 1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, 0}, TRUE, L"403.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(1, -1), POS(1, -3)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, L"404.bmp", + 2, {POS(-1, 1), POS(1, 1)}, 2, {POS(1, -1), POS(3, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_CENTER | TA_TOP, {1, 0, 0, 2, WIDTH/8, HEIGHT/4}, TRUE, L"405.bmp", + 2, {POS(-1, -1), POS(-1, 1)}, 2, {POS(1, -1), POS(1, 1)}}, + + // GM_ADVANCED TA_RIGHT TA_TOP + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, 0}, TRUE, L"500.bmp", + 4, {POS(-1, -1), POS(-1, 1), POS(1, -1), POS(1, 1)}, 2, {POS(-1, -3), POS(1, -3)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, 0}, TRUE, L"501.bmp", + 3, {POS(-1, -1), POS(-1, 1), POS(1, 1)}, 2, {POS(1, -3), POS(1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 2, -WIDTH/4, HEIGHT/4}, TRUE, L"502.bmp", + 0, {}, 4, {POS(-1, -1), POS(1, -1), POS(1, -1), POS(-1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, 0}, TRUE, L"503.bmp", + 3, {POS(-1, 1), POS(1, 1), POS(-1, -1)}, 2, {POS(1, -1), POS(1, -3)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {2, 0, 0, 1, -WIDTH/4, HEIGHT/4}, TRUE, L"504.bmp", + 2, {POS(-1, 1), POS(1, 1)}, 2, {POS(-1, -1), POS(1, -1)}}, + {__LINE__, GM_ADVANCED, {XCENTER, 0}, TA_RIGHT | TA_TOP, {1, 0, 0, 2, WIDTH/4, HEIGHT/4}, TRUE, L"505.bmp", + 2, {POS(-1, -1), POS(-1, 1)}, 2, {POS(1, -1), POS(1, 1)}}, +}; +static const INT s_entry_count = (INT)(sizeof(s_entries) / sizeof(s_entries[0])); + +static void DoTestEntry(const TEST_ENTRY *entry, HDC hDC, HBITMAP hbm) +{ + HGDIOBJ hbmOld, hPenOld; + INT i; + COLORREF rgb; + BOOL ret; + static const WCHAR s_chBlackBox = L'g'; + + SetGraphicsMode(hDC, entry->GraphicsMode); + + hbmOld = SelectObject(hDC, hbm); + { + ModifyWorldTransform(hDC, NULL, MWT_IDENTITY); + + FillRect(hDC, &s_rc, s_hWhiteBrush); + + hPenOld = SelectObject(hDC, s_hRedPen); + { + MoveToEx(hDC, XCENTER / 2, 0, NULL); + LineTo(hDC, XCENTER / 2, HEIGHT); + + MoveToEx(hDC, XCENTER, 0, NULL); + LineTo(hDC, XCENTER, HEIGHT); + + MoveToEx(hDC, XCENTER * 3 / 2, 0, NULL); + LineTo(hDC, XCENTER * 3 / 2, HEIGHT); + + MoveToEx(hDC, 0, YCENTER / 2, NULL); + LineTo(hDC, WIDTH, YCENTER / 2); + + MoveToEx(hDC, 0, YCENTER, NULL); + LineTo(hDC, WIDTH, YCENTER); + + MoveToEx(hDC, 0, YCENTER * 3 / 2, NULL); + LineTo(hDC, WIDTH, YCENTER * 3 / 2); + } + SelectObject(hDC, hPenOld); + + ret = SetWorldTransform(hDC, &entry->xform); + ok(ret == entry->xform_ok, "Line %d: SetWorldTransform returned %d\n", entry->line, ret); + + SetTextAlign(hDC, entry->TextAlign); + + TextOutW(hDC, entry->ptRef.x, entry->ptRef.y, &s_chBlackBox, 1); + + ModifyWorldTransform(hDC, NULL, MWT_IDENTITY); + + for (i = 0; i < entry->cWhitePoints; ++i) + { + rgb = GetPixel(hDC, entry->WhitePoints[i].x, entry->WhitePoints[i].y); + ok(rgb == WHITE, "Line %d: %d: (%ld, %ld) is not white\n", entry->line, i, + entry->WhitePoints[i].x, entry->WhitePoints[i].y); + } + + for (i = 0; i < entry->cBlackPoints; ++i) + { + rgb = GetPixel(hDC, entry->BlackPoints[i].x, entry->BlackPoints[i].y); + ok(rgb == BLACK, "Line %d: %d: (%ld, %ld) is not black\n", entry->line, i, + entry->BlackPoints[i].x, entry->BlackPoints[i].y); + } + } + SelectObject(hDC, hbmOld); + + SaveBitmapToFile(entry->filename, hbm); } START_TEST(TextTransform) @@ -108,15 +291,11 @@ START_TEST(TextTransform) HBITMAP hbm; LOGFONTA lf; HFONT hFont; - HGDIOBJ hbmOld, hFontOld; - RECT rc; - WCHAR chBlackBox = L'g'; - SIZE siz; - POINT pt; - XFORM xform; - HBRUSH hWhiteBrush = (HBRUSH)GetStockObject(WHITE_BRUSH); - const COLORREF BLACK = RGB(0, 0, 0); - const COLORREF WHITE = RGB(255, 255, 255); + HGDIOBJ hFontOld; + INT i; + + s_hWhiteBrush = (HBRUSH)GetStockObject(WHITE_BRUSH); + s_hRedPen = CreatePen(PS_SOLID, 1, RGB(255, 0, 0)); hDC = CreateCompatibleDC(NULL); ok(hDC != NULL, "hDC was NULL.\n"); @@ -124,146 +303,34 @@ START_TEST(TextTransform) SetBkMode(hDC, TRANSPARENT); SetMapMode(hDC, MM_ANISOTROPIC); - siz.cx = siz.cy = 100; - pt.x = siz.cx / 2; - pt.y = siz.cy / 2; - SetWindowOrgEx(hDC, -pt.x, -pt.y, NULL); - ZeroMemory(&bmi, sizeof(bmi)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi.bmiHeader.biWidth = siz.cx; - bmi.bmiHeader.biHeight = siz.cy; + bmi.bmiHeader.biWidth = WIDTH; + bmi.bmiHeader.biHeight = HEIGHT; bmi.bmiHeader.biPlanes = 1; bmi.bmiHeader.biBitCount = 24; hbm = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0); ok(hbm != NULL, "hbm was NULL.\n"); ZeroMemory(&lf, sizeof(lf)); - lf.lfHeight = -50; + lf.lfHeight = LFHEIGHT; lf.lfCharSet = DEFAULT_CHARSET; lstrcpyA(lf.lfFaceName, "Marlett"); hFont = CreateFontIndirectA(&lf); ok(hFont != NULL, "hFont was NULL.\n"); - hbmOld = SelectObject(hDC, hbm); hFontOld = SelectObject(hDC, hFont); - - SetRect(&rc, -siz.cx / 2, -siz.cy / 2, siz.cx / 2, siz.cy / 2); - - FillRect(hDC, &rc, hWhiteBrush); - SaveBitmapToFile(L"1.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - FillRect(hDC, &rc, hWhiteBrush); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - SaveBitmapToFile(L"2.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - SetGraphicsMode(hDC, GM_ADVANCED); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, 2, 0, 0, 1, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"3.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, 1, 1, 1, 1, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), FALSE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"4.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, -1, 0, 0, 1, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"5.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), BLACK); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, 0, 1, 1, 0, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"6.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, 0, -1, 1, 0, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"7.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), BLACK); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, 0, 1, -1, 0, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"8.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - FillRect(hDC, &rc, hWhiteBrush); - setXFORM(&xform, -1, 0, 0.5, -1, 0, 0); - ok_int(SetWorldTransform(hDC, &xform), TRUE); - SetTextAlign(hDC, TA_LEFT | TA_BOTTOM); - TextOutW(hDC, 0, 0, &chBlackBox, 1); - ok_int(ModifyWorldTransform(hDC, NULL, MWT_IDENTITY), TRUE); - SaveBitmapToFile(L"9.bmp", hbm); - ok_long(GetPixel(hDC, +siz.cx / 4, +siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, +siz.cy / 4), BLACK); - ok_long(GetPixel(hDC, +siz.cx / 4, -siz.cy / 4), WHITE); - ok_long(GetPixel(hDC, -siz.cx / 4, -siz.cy / 4), WHITE); - + for (i = 0; i < s_entry_count; ++i) + { + DoTestEntry(&s_entries[i], hDC, hbm); + } SelectObject(hDC, hFontOld); - SelectObject(hDC, hbmOld); DeleteObject(hFont); DeleteObject(hbm); + DeleteObject(s_hWhiteBrush); + DeleteObject(s_hRedPen); + DeleteDC(hDC); }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Display the 'no logon hours' case in the USER command.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=23825149a2503d215f6cc…
commit 23825149a2503d215f6cc8cf49d88029b871c101 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat May 18 21:21:39 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat May 18 21:21:39 2019 +0200 [NET] Display the 'no logon hours' case in the USER command. --- base/applications/network/net/cmdUser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index f697d4570b4..314a8b28e74 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -307,6 +307,13 @@ PrintLogonHours( bFirst = FALSE; } } + + if (bFirst) + { + /* No logon hours */ + PrintMessageString(4434); + ConPuts(StdOut, L"\n"); + } }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Implement proper output of logon hour ranges in the USER command.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0ca929791ae4cbaff4ad6…
commit 0ca929791ae4cbaff4ad6440636305b7f833b6d1 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat May 18 14:46:04 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat May 18 14:46:54 2019 +0200 [NET] Implement proper output of logon hour ranges in the USER command. --- base/applications/network/net/cmdUser.c | 51 ++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index 5ebef48b127..f697d4570b4 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -10,6 +10,9 @@ #include "net.h" +#define SECONDS_PER_DAY (60 * 60 * 24) +#define SECONDS_PER_HOUR (60 * 60) + typedef struct _COUNTY_TABLE { DWORD dwCountryCode; @@ -147,6 +150,31 @@ PrintDateTime(DWORD dwSeconds) } +static +VOID +PrintLocalTime(DWORD dwSeconds) +{ + LARGE_INTEGER Time; + FILETIME FileTime; + SYSTEMTIME SystemTime; + WCHAR TimeBuffer[80]; + + RtlSecondsSince1970ToTime(dwSeconds, &Time); + FileTime.dwLowDateTime = Time.u.LowPart; + FileTime.dwHighDateTime = Time.u.HighPart; + FileTimeToSystemTime(&FileTime, &SystemTime); + + GetTimeFormatW(LOCALE_USER_DEFAULT, + TIME_NOSECONDS, + &SystemTime, + NULL, + TimeBuffer, + ARRAYSIZE(TimeBuffer)); + + ConPrintf(StdOut, L"%s", TimeBuffer); +} + + static DWORD GetTimeInSeconds(VOID) @@ -217,7 +245,7 @@ PrintLogonHours( INT nPaddedLength) { DWORD dwUnitsPerDay, dwBitNumber, dwSecondsPerUnit; - DWORD dwStartTime, dwEndTime; + DWORD dwStartTime, dwEndTime, dwStartDay, dwEndDay; BOOL bBitValue, bFirst = TRUE; if ((dwUnitsPerWeek == 0) || @@ -230,7 +258,7 @@ PrintLogonHours( ((dwUnitsPerDay / 24) > 6)) return; - dwSecondsPerUnit = (24 * 60 * 60) / dwUnitsPerDay; + dwSecondsPerUnit = (SECONDS_PER_DAY) / dwUnitsPerDay; for (dwBitNumber = 0; dwBitNumber < dwUnitsPerWeek; dwBitNumber++) { @@ -251,14 +279,29 @@ PrintLogonHours( if (!bFirst) PrintPadding(L' ', nPaddedLength); - if (dwStartTime == 0 && dwEndTime == (60 * 60 * 24 * 7)) + if (dwStartTime == 0 && dwEndTime == (SECONDS_PER_DAY * 7)) { PrintMessageString(4302); ConPuts(StdOut, L"\n"); } else { - ConPrintf(StdOut, L"%lu - %lu\n", dwStartTime, dwEndTime); + dwStartDay = dwStartTime / SECONDS_PER_DAY; + dwEndDay = (dwEndTime / SECONDS_PER_DAY) % 7; + + PrintMessageString(4307 + dwStartDay); + ConPuts(StdOut, L" "); + PrintLocalTime((dwStartTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); + + ConPrintf(StdOut, L" - "); + if (dwStartDay != dwEndDay) + { + PrintMessageString(4307 + dwEndDay); + ConPuts(StdOut, L" "); + } + + PrintLocalTime((dwEndTime % SECONDS_PER_DAY) + SECONDS_PER_HOUR); + ConPuts(StdOut, L"\n"); } bFirst = FALSE;
5 years, 7 months
1
0
0
0
[reactos] 01/01: [BASESRV] Handle failures instead of asserting
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f3c71baa0c89a62fef2cc…
commit f3c71baa0c89a62fef2cc199ba70e5188f9033c1 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat May 18 13:37:35 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sat May 18 13:37:55 2019 +0200 [BASESRV] Handle failures instead of asserting --- subsystems/win/basesrv/init.c | 72 ++++++++++++++++++++++++++++++++----------- 1 file changed, 54 insertions(+), 18 deletions(-) diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c index 5e5b5eff6c4..a1bf0f8c021 100644 --- a/subsystems/win/basesrv/init.c +++ b/subsystems/win/basesrv/init.c @@ -5,6 +5,7 @@ * PURPOSE: Initialization * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org) * Hermes Belusca-Maito (hermes.belusca(a)sfr.fr) + * Pierre Schweitzer (pierre(a)reactos.org) */ /* INCLUDES *******************************************************************/ @@ -232,21 +233,33 @@ CreateBaseAcls(OUT PACL* Dacl, 1, SECURITY_LOCAL_SYSTEM_RID, 0, 0, 0, 0, 0, 0, 0, &SystemSid); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + return Status; + } /* Allocate the World SID */ Status = RtlAllocateAndInitializeSid(&WorldAuthority, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &WorldSid); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + RtlFreeSid(SystemSid); + goto Return; + } /* Allocate the restricted SID */ Status = RtlAllocateAndInitializeSid(&NtAuthority, 1, SECURITY_RESTRICTED_CODE_RID, 0, 0, 0, 0, 0, 0, 0, &RestrictedSid); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + RtlFreeSid(WorldSid); + RtlFreeSid(SystemSid); + goto Return; + } /* Allocate one ACL with 3 ACEs each for one SID */ AclLength = sizeof(ACL) + 3 * sizeof(ACCESS_ALLOWED_ACE) + @@ -254,11 +267,19 @@ CreateBaseAcls(OUT PACL* Dacl, RtlLengthSid(WorldSid) + RtlLengthSid(RestrictedSid); *Dacl = RtlAllocateHeap(BaseSrvHeap, 0, AclLength); - ASSERT(*Dacl != NULL); + if (*Dacl == NULL) + { + Status = STATUS_NO_MEMORY; + goto FreeAndReturn; + } /* Set the correct header fields */ Status = RtlCreateAcl(*Dacl, AclLength, ACL_REVISION2); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(BaseSrvHeap, 0, *Dacl); + goto FreeAndReturn; + } /* Setup access for anyone depending on object security mode */ if (ObjectSecurityMode != 0) @@ -276,20 +297,29 @@ CreateBaseAcls(OUT PACL* Dacl, } /* Give the appropriate rights to each SID */ - Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, WorldAccess, WorldSid); - ASSERT(NT_SUCCESS(Status)); - Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid); - ASSERT(NT_SUCCESS(Status)); - Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_TRAVERSE, RestrictedSid); - ASSERT(NT_SUCCESS(Status)); + if (NT_SUCCESS(RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, WorldAccess, WorldSid)) && + NT_SUCCESS(RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid))) + { + RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_TRAVERSE, RestrictedSid); + } /* Now allocate the restricted DACL */ *RestrictedDacl = RtlAllocateHeap(BaseSrvHeap, 0, AclLength); - ASSERT(*RestrictedDacl != NULL); + if (*RestrictedDacl == NULL) + { + Status = STATUS_NO_MEMORY; + RtlFreeHeap(BaseSrvHeap, 0, *Dacl); + goto FreeAndReturn; + } /* Initialize it */ Status = RtlCreateAcl(*RestrictedDacl, AclLength, ACL_REVISION2); - ASSERT(NT_SUCCESS(Status)); + if (!NT_SUCCESS(Status)) + { + RtlFreeHeap(BaseSrvHeap, 0, *RestrictedDacl); + RtlFreeHeap(BaseSrvHeap, 0, *Dacl); + goto FreeAndReturn; + } /* Setup access for restricted sid depending on session id and protection mode */ if (SessionId == 0 || (ProtectionMode & 3) == 0) @@ -305,16 +335,22 @@ CreateBaseAcls(OUT PACL* Dacl, /* And add the same ACEs as before */ Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, WorldAccess, WorldSid); - ASSERT(NT_SUCCESS(Status)); - Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid); - ASSERT(NT_SUCCESS(Status)); - Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, RestrictedAccess, RestrictedSid); - ASSERT(NT_SUCCESS(Status)); + if (NT_SUCCESS(Status)) + { + Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid); + if (NT_SUCCESS(Status)) + { + Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, RestrictedAccess, RestrictedSid); + } + } /* The SIDs are captured, can free them now */ +FreeAndReturn: RtlFreeSid(RestrictedSid); RtlFreeSid(WorldSid); RtlFreeSid(SystemSid); + +Return: return Status; }
5 years, 7 months
1
0
0
0
[reactos] 01/01: [NET] Print raw logon hour ranges in the USER command.
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4cf5013a5433247934b18…
commit 4cf5013a5433247934b182c59e8a4044d8e95944 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat May 18 11:26:02 2019 +0200 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat May 18 11:27:00 2019 +0200 [NET] Print raw logon hour ranges in the USER command. --- base/applications/network/net/cmdUser.c | 85 +++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 3 deletions(-) diff --git a/base/applications/network/net/cmdUser.c b/base/applications/network/net/cmdUser.c index 50cdbf7aee7..5ebef48b127 100644 --- a/base/applications/network/net/cmdUser.c +++ b/base/applications/network/net/cmdUser.c @@ -134,14 +134,14 @@ PrintDateTime(DWORD dwSeconds) &SystemTime, NULL, DateBuffer, - 80); + ARRAYSIZE(DateBuffer)); GetTimeFormatW(LOCALE_USER_DEFAULT, TIME_NOSECONDS, &SystemTime, NULL, TimeBuffer, - 80); + ARRAYSIZE(TimeBuffer)); ConPrintf(StdOut, L"%s %s", DateBuffer, TimeBuffer); } @@ -196,6 +196,77 @@ GetCountryFromCountryCode( } +static +BOOL +BitValue( + PBYTE pLogonHours, + DWORD dwBitNumber) +{ + DWORD dwIndex = dwBitNumber / 8; + BYTE Mask = 1 << (dwBitNumber & 7); + + return ((pLogonHours[dwIndex] & Mask) != 0); +} + + +static +VOID +PrintLogonHours( + DWORD dwUnitsPerWeek, + PBYTE pLogonHours, + INT nPaddedLength) +{ + DWORD dwUnitsPerDay, dwBitNumber, dwSecondsPerUnit; + DWORD dwStartTime, dwEndTime; + BOOL bBitValue, bFirst = TRUE; + + if ((dwUnitsPerWeek == 0) || + ((dwUnitsPerWeek %7) != 0)) + return; + + dwUnitsPerDay = dwUnitsPerWeek / 7; + + if (((dwUnitsPerDay % 24) != 0) || + ((dwUnitsPerDay / 24) > 6)) + return; + + dwSecondsPerUnit = (24 * 60 * 60) / dwUnitsPerDay; + + for (dwBitNumber = 0; dwBitNumber < dwUnitsPerWeek; dwBitNumber++) + { + bBitValue = BitValue(pLogonHours, dwBitNumber); + if (bBitValue) + { + dwStartTime = dwSecondsPerUnit * dwBitNumber; + + while (bBitValue != 0 && dwBitNumber < dwUnitsPerWeek) + { + dwBitNumber++; + if (dwBitNumber < dwUnitsPerWeek) + bBitValue = BitValue(pLogonHours, dwBitNumber); + } + + dwEndTime = dwSecondsPerUnit * dwBitNumber; + + if (!bFirst) + PrintPadding(L' ', nPaddedLength); + + if (dwStartTime == 0 && dwEndTime == (60 * 60 * 24 * 7)) + { + PrintMessageString(4302); + ConPuts(StdOut, L"\n"); + } + else + { + ConPrintf(StdOut, L"%lu - %lu\n", dwStartTime, dwEndTime); + } + + bFirst = FALSE; + } + } +} + + static NET_API_STATUS DisplayUser(LPWSTR lpUserName) @@ -329,8 +400,16 @@ DisplayUser(LPWSTR lpUserName) PrintPaddedMessageString(4432, nPaddedLength); if (pUserInfo->usri4_logon_hours == NULL) + { PrintMessageString(4302); - ConPuts(StdOut, L"\n\n"); + ConPuts(StdOut, L"\n"); + } + else + { + PrintLogonHours(pUserInfo->usri4_units_per_week, + pUserInfo->usri4_logon_hours, + nPaddedLength); + } ConPuts(StdOut, L"\n"); PrintPaddedMessageString(4427, nPaddedLength);
5 years, 7 months
1
0
0
0
[reactos] 03/03: [BASESRV] Take ObjectSecurityMode and ProtectionMode into account when creating DACLs
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8159b205b644e48d0ef86…
commit 8159b205b644e48d0ef86553d06f51bcc3ada506 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat May 18 11:05:30 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sat May 18 11:05:30 2019 +0200 [BASESRV] Take ObjectSecurityMode and ProtectionMode into account when creating DACLs --- subsystems/win/basesrv/init.c | 44 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/subsystems/win/basesrv/init.c b/subsystems/win/basesrv/init.c index 6b93f29f9c1..5e5b5eff6c4 100644 --- a/subsystems/win/basesrv/init.c +++ b/subsystems/win/basesrv/init.c @@ -185,6 +185,8 @@ CreateBaseAcls(OUT PACL* Dacl, ULONG ResultLength; HANDLE hKey; OBJECT_ATTRIBUTES ObjectAttributes; + ULONG ObjectSecurityMode; + ACCESS_MASK WorldAccess, RestrictedAccess; /* Open the Session Manager Key */ RtlInitUnicodeString(&KeyName, SM_REG_KEY); @@ -218,6 +220,13 @@ CreateBaseAcls(OUT PACL* Dacl, NtClose(hKey); } + /* Get object security mode */ + if (SessionId == 0 || + !NT_SUCCESS(NtQuerySystemInformation(SystemObjectSecurityMode, &ObjectSecurityMode, sizeof(ULONG), NULL))) + { + ObjectSecurityMode = 0; + } + /* Allocate the System SID */ Status = RtlAllocateAndInitializeSid(&NtAuthority, 1, SECURITY_LOCAL_SYSTEM_RID, @@ -251,9 +260,23 @@ CreateBaseAcls(OUT PACL* Dacl, Status = RtlCreateAcl(*Dacl, AclLength, ACL_REVISION2); ASSERT(NT_SUCCESS(Status)); + /* Setup access for anyone depending on object security mode */ + if (ObjectSecurityMode != 0) + { + /* + * If we have restrictions on security mode, make it read only + * it also means session ID is not 0 + */ + WorldAccess = DIRECTORY_QUERY | DIRECTORY_TRAVERSE; + } + else + { + /* Otherwise, open wide */ + WorldAccess = READ_CONTROL | DIRECTORY_QUERY | DIRECTORY_TRAVERSE | DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_SUBDIRECTORY; + } + /* Give the appropriate rights to each SID */ - /* FIXME: Should check SessionId/ProtectionMode */ - Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_QUERY | DIRECTORY_TRAVERSE | DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_SUBDIRECTORY | READ_CONTROL, WorldSid); + Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, WorldAccess, WorldSid); ASSERT(NT_SUCCESS(Status)); Status = RtlAddAccessAllowedAce(*Dacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid); ASSERT(NT_SUCCESS(Status)); @@ -268,13 +291,24 @@ CreateBaseAcls(OUT PACL* Dacl, Status = RtlCreateAcl(*RestrictedDacl, AclLength, ACL_REVISION2); ASSERT(NT_SUCCESS(Status)); + /* Setup access for restricted sid depending on session id and protection mode */ + if (SessionId == 0 || (ProtectionMode & 3) == 0) + { + /* If we have no session ID or if protection mode is not set, then open wide */ + RestrictedAccess = READ_CONTROL | DIRECTORY_QUERY | DIRECTORY_TRAVERSE | DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_SUBDIRECTORY; + } + else + { + /* Otherwise, make read only */ + RestrictedAccess = READ_CONTROL | DIRECTORY_QUERY | DIRECTORY_TRAVERSE; + } + /* And add the same ACEs as before */ - /* FIXME: Not really fully correct */ - Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, DIRECTORY_QUERY | DIRECTORY_TRAVERSE | DIRECTORY_CREATE_OBJECT | DIRECTORY_CREATE_SUBDIRECTORY | READ_CONTROL, WorldSid); + Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, WorldAccess, WorldSid); ASSERT(NT_SUCCESS(Status)); Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, DIRECTORY_ALL_ACCESS, SystemSid); ASSERT(NT_SUCCESS(Status)); - Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, DIRECTORY_TRAVERSE, RestrictedSid); + Status = RtlAddAccessAllowedAce(*RestrictedDacl, ACL_REVISION2, RestrictedAccess, RestrictedSid); ASSERT(NT_SUCCESS(Status)); /* The SIDs are captured, can free them now */
5 years, 7 months
1
0
0
0
[reactos] 02/03: [NTOSKRNL] Implement NtQuerySystemInformation(SystemObjectSecurityMode)
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f821e1742cb1272a544a1…
commit f821e1742cb1272a544a1fa013b676134733ba17 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat May 18 10:36:29 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sat May 18 10:37:25 2019 +0200 [NTOSKRNL] Implement NtQuerySystemInformation(SystemObjectSecurityMode) --- ntoskrnl/ex/sysinfo.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/ex/sysinfo.c b/ntoskrnl/ex/sysinfo.c index 4949705ab29..e3c6ece86d6 100644 --- a/ntoskrnl/ex/sysinfo.c +++ b/ntoskrnl/ex/sysinfo.c @@ -2615,6 +2615,22 @@ QSI_DEF(SystemExtendedHandleInformation) return Status; } +/* Class 70 - System object security mode information */ +QSI_DEF(SystemObjectSecurityMode) +{ + PULONG ObjectSecurityInfo = (PULONG)Buffer; + + /* Validate input size */ + if (Size != sizeof(ULONG)) + { + return STATUS_INFO_LENGTH_MISMATCH; + } + + *ObjectSecurityInfo = ObpObjectSecurityMode; + + return STATUS_SUCCESS; +} + /* Class 76 - System firmware table information */ QSI_DEF(SystemFirmwareTableInformation) { @@ -2807,7 +2823,7 @@ CallQS [] = SI_XX(SystemSessionPoolTagInformation), /* FIXME: not implemented */ SI_XX(SystemSessionMappedViewInformation), /* FIXME: not implemented */ SI_XX(SystemHotpatchInformation), /* FIXME: not implemented */ - SI_XX(SystemObjectSecurityMode), /* FIXME: not implemented */ + SI_QX(SystemObjectSecurityMode), SI_XX(SystemWatchdogTimerHandler), /* FIXME: not implemented */ SI_XX(SystemWatchdogTimerInformation), /* FIXME: not implemented */ SI_XX(SystemLogicalProcessorInformation), /* FIXME: not implemented */
5 years, 7 months
1
0
0
0
[reactos] 01/03: [NTOSKRNL] Save ObjectSecurityMode value on boot
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a33a69b3f4c8124f5d236…
commit a33a69b3f4c8124f5d2364300f64612a049c0872 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Sat May 18 10:28:32 2019 +0200 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Sat May 18 10:37:24 2019 +0200 [NTOSKRNL] Save ObjectSecurityMode value on boot --- ntoskrnl/config/cmdata.c | 2 +- ntoskrnl/include/internal/ob.h | 1 + ntoskrnl/ob/obinit.c | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ntoskrnl/config/cmdata.c b/ntoskrnl/config/cmdata.c index 77d82616ded..9b788b5f461 100644 --- a/ntoskrnl/config/cmdata.c +++ b/ntoskrnl/config/cmdata.c @@ -149,7 +149,7 @@ INIT_SECTION CM_SYSTEM_CONTROL_VECTOR CmControlVector[] = { L"Session Manager", L"ObjectSecurityMode", - &DummyData, + &ObpObjectSecurityMode, NULL, NULL }, diff --git a/ntoskrnl/include/internal/ob.h b/ntoskrnl/include/internal/ob.h index 355e9339d8d..59bd66956c2 100644 --- a/ntoskrnl/include/internal/ob.h +++ b/ntoskrnl/include/internal/ob.h @@ -618,6 +618,7 @@ extern ALIGNEDNAME ObpDosDevicesShortNameRoot; extern UNICODE_STRING ObpDosDevicesShortName; extern WCHAR ObpUnsecureGlobalNamesBuffer[128]; extern ULONG ObpUnsecureGlobalNamesLength; +extern ULONG ObpObjectSecurityMode; // // Inlined Functions diff --git a/ntoskrnl/ob/obinit.c b/ntoskrnl/ob/obinit.c index e4de1a16d7d..fece62e45a3 100644 --- a/ntoskrnl/ob/obinit.c +++ b/ntoskrnl/ob/obinit.c @@ -52,6 +52,8 @@ PsInitializeQuotaSystem(VOID); ULONG ObpInitializationPhase; +ULONG ObpObjectSecurityMode = 0; + /* PRIVATE FUNCTIONS *********************************************************/ static
5 years, 7 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
17
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Results per page:
10
25
50
100
200