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
June 2021
----- 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
19 participants
228 discussions
Start a n
N
ew thread
[reactos] 01/03: [SHELL32] Don't check for link files being targets for other link files. Addendum to 3a822e4f.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3249a003648aff04bbef4…
commit 3249a003648aff04bbef46a0ff74a76fe0c6614b Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Jun 28 01:59:31 2021 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Jun 28 02:19:30 2021 +0200 [SHELL32] Don't check for link files being targets for other link files. Addendum to 3a822e4f. --- dll/win32/shell32/CShellLink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index cd5d74e2c3f..cef374175aa 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -2207,7 +2207,7 @@ HRESULT CShellLink::SetTargetFromPIDLOrPath(LPCITEMIDLIST pidl, LPCWSTR pszFile) /* This failed, try to resolve the path, then create a simple PIDL */ StringCchCopyW(szPath, _countof(szPath), pszFile); - PathResolveW(szPath, NULL, PRF_TRYPROGRAMEXTENSIONS); + PathResolveW(szPath, NULL, PRF_DONTFINDLNK | PRF_TRYPROGRAMEXTENSIONS); if (PathIsFileSpecW(szPath)) {
3 years, 6 months
1
0
0
0
[reactos] 01/01: [COMCTL32] Addendum to last commit (#3674) CORE-17199
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=adee5ca255b7ed21f359c…
commit adee5ca255b7ed21f359ca8c1ca06bd44db90dcf Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Mon Jun 28 02:05:56 2021 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Mon Jun 28 02:05:56 2021 +0200 [COMCTL32] Addendum to last commit (#3674) CORE-17199 Keep that section like we had it to support compilation on VS2010. It does still work like that. Addendum to commit 0.4.15-dev-2796-g e382b7bc3561a895d0a196a724865880b9a735f5 --- dll/win32/comctl32/datetime.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dll/win32/comctl32/datetime.c b/dll/win32/comctl32/datetime.c index 71bb3d238b0..51e58fc71f1 100644 --- a/dll/win32/comctl32/datetime.c +++ b/dll/win32/comctl32/datetime.c @@ -130,8 +130,13 @@ static const WCHAR allowedformatchars[] = L"dhHmMstyX"; static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1}; /* valid date limits */ +#ifndef __REACTOS__ static const SYSTEMTIME max_allowed_date = { .wYear = 9999, .wMonth = 12, .wDayOfWeek = 0, .wDay = 31 }; static const SYSTEMTIME min_allowed_date = { .wYear = 1752, .wMonth = 9, .wDayOfWeek = 0, .wDay = 14 }; +#else +static const SYSTEMTIME max_allowed_date = { /*.wYear =*/ 9999, /*.wMonth =*/ 12, /*.wDayOfWeek =*/ 0, /*.wDay =*/ 31 }; +static const SYSTEMTIME min_allowed_date = { /*.wYear =*/ 1752, /*.wMonth =*/ 9, /*.wDayOfWeek =*/ 0, /*.wDay =*/ 14 }; +#endif static DWORD DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *systime)
3 years, 6 months
1
0
0
0
[reactos] 01/01: [COMCTL32] Sync datetime.c to Wine-6.0 (#3674) CORE-17199
by Doug Lyons
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e382b7bc3561a895d0a19…
commit e382b7bc3561a895d0a196a724865880b9a735f5 Author: Doug Lyons <douglyons(a)douglyons.com> AuthorDate: Sun Jun 27 18:18:10 2021 -0500 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jun 28 01:18:10 2021 +0200 [COMCTL32] Sync datetime.c to Wine-6.0 (#3674) CORE-17199 Fix automatic toggling of date display on second stage setup Update comctrl from Wine with fix. Sync datetime.c to Wine-6.0 --- dll/win32/comctl32/datetime.c | 194 ++++++++++++++++++++++++++---------------- 1 file changed, 121 insertions(+), 73 deletions(-) diff --git a/dll/win32/comctl32/datetime.c b/dll/win32/comctl32/datetime.c index 97f82260592..71bb3d238b0 100644 --- a/dll/win32/comctl32/datetime.c +++ b/dll/win32/comctl32/datetime.c @@ -44,7 +44,6 @@ #include "commctrl.h" #include "comctl32.h" #include "wine/debug.h" -#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(datetime); @@ -127,12 +126,12 @@ extern int MONTHCAL_CalculateDayOfWeek(SYSTEMTIME *date, BOOL inplace); static BOOL DATETIME_SendSimpleNotify (const DATETIME_INFO *infoPtr, UINT code); static BOOL DATETIME_SendDateTimeChangeNotify (const DATETIME_INFO *infoPtr); -static const WCHAR allowedformatchars[] = {'d', 'h', 'H', 'm', 'M', 's', 't', 'y', 'X', 0}; +static const WCHAR allowedformatchars[] = L"dhHmMstyX"; static const int maxrepetition [] = {4,2,2,2,4,2,2,4,-1}; /* valid date limits */ -static const SYSTEMTIME max_allowed_date = { /* wYear */ 9999, /* wMonth */ 12, /* wDayOfWeek */ 0, /* wDay */ 31 }; -static const SYSTEMTIME min_allowed_date = { /* wYear */ 1752, /* wMonth */ 9, /* wDayOfWeek */ 0, /* wDay */ 14 }; +static const SYSTEMTIME max_allowed_date = { .wYear = 9999, .wMonth = 12, .wDayOfWeek = 0, .wDay = 31 }; +static const SYSTEMTIME min_allowed_date = { .wYear = 1752, .wMonth = 9, .wDayOfWeek = 0, .wDay = 14 }; static DWORD DATETIME_GetSystemTime (const DATETIME_INFO *infoPtr, SYSTEMTIME *systime) @@ -238,7 +237,7 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy * *'dddddd' is handled as 'dddd' plus 'dd'. * *unrecognized formats are strings (here given the type DT_STRING; * start of the string is encoded in lower bits of DT_STRING. - * Therefore, 'string' ends finally up as '<show seconds>tring'. + * Therefore, 'string' ends up as '<show seconds>tring'. * */ static void @@ -251,7 +250,7 @@ DATETIME_UseFormat (DATETIME_INFO *infoPtr, LPCWSTR formattxt) *nrFields = 0; infoPtr->fieldspec[*nrFields] = 0; - len = strlenW(allowedformatchars); + len = lstrlenW(allowedformatchars); k = 0; for (i = 0; formattxt[i]; i++) { @@ -322,10 +321,12 @@ DATETIME_SetFormatW (DATETIME_INFO *infoPtr, LPCWSTR format) if (!format) { DWORD format_item; - if (infoPtr->dwStyle & DTS_LONGDATEFORMAT) - format_item = LOCALE_SLONGDATE; - else if ((infoPtr->dwStyle & DTS_TIMEFORMAT) == DTS_TIMEFORMAT) - format_item = LOCALE_STIMEFORMAT; + if ((infoPtr->dwStyle & DTS_SHORTDATECENTURYFORMAT) == DTS_SHORTDATECENTURYFORMAT) + format_item = LOCALE_SSHORTDATE; + else if ((infoPtr->dwStyle & DTS_LONGDATEFORMAT) == DTS_LONGDATEFORMAT) + format_item = LOCALE_SLONGDATE; + else if ((infoPtr->dwStyle & DTS_TIMEFORMAT) == DTS_TIMEFORMAT) + format_item = LOCALE_STIMEFORMAT; else /* DTS_SHORTDATEFORMAT */ format_item = LOCALE_SSHORTDATE; GetLocaleInfoW(LOCALE_USER_DEFAULT, format_item, format_buf, ARRAY_SIZE(format_buf)); @@ -360,9 +361,6 @@ DATETIME_SetFormatA (DATETIME_INFO *infoPtr, LPCSTR lpszFormat) static void DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int resultSize) { - static const WCHAR fmt_dW[] = { '%', 'd', 0 }; - static const WCHAR fmt__2dW[] = { '%', '.', '2', 'd', 0 }; - static const WCHAR fmt__3sW[] = { '%', '.', '3', 's', 0 }; SYSTEMTIME date = infoPtr->date; int spec; WCHAR buffer[80]; @@ -394,10 +392,10 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int *result = 0; break; case ONEDIGITDAY: - wsprintfW (result, fmt_dW, date.wDay); + wsprintfW (result, L"%d", date.wDay); break; case TWODIGITDAY: - wsprintfW (result, fmt__2dW, date.wDay); + wsprintfW (result, L"%.2d", date.wDay); break; case THREECHARDAY: GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1+(date.wDayOfWeek+6)%7, result, 4); @@ -413,7 +411,7 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int result[2] = 0; } else - wsprintfW (result, fmt_dW, date.wHour - (date.wHour > 12 ? 12 : 0)); + wsprintfW (result, L"%d", date.wHour - (date.wHour > 12 ? 12 : 0)); break; case TWODIGIT12HOUR: if (date.wHour == 0) { @@ -422,35 +420,35 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int result[2] = 0; } else - wsprintfW (result, fmt__2dW, date.wHour - (date.wHour > 12 ? 12 : 0)); + wsprintfW (result, L"%.2d", date.wHour - (date.wHour > 12 ? 12 : 0)); break; case ONEDIGIT24HOUR: - wsprintfW (result, fmt_dW, date.wHour); + wsprintfW (result, L"%d", date.wHour); break; case TWODIGIT24HOUR: - wsprintfW (result, fmt__2dW, date.wHour); + wsprintfW (result, L"%.2d", date.wHour); break; case ONEDIGITSECOND: - wsprintfW (result, fmt_dW, date.wSecond); + wsprintfW (result, L"%d", date.wSecond); break; case TWODIGITSECOND: - wsprintfW (result, fmt__2dW, date.wSecond); + wsprintfW (result, L"%.2d", date.wSecond); break; case ONEDIGITMINUTE: - wsprintfW (result, fmt_dW, date.wMinute); + wsprintfW (result, L"%d", date.wMinute); break; case TWODIGITMINUTE: - wsprintfW (result, fmt__2dW, date.wMinute); + wsprintfW (result, L"%.2d", date.wMinute); break; case ONEDIGITMONTH: - wsprintfW (result, fmt_dW, date.wMonth); + wsprintfW (result, L"%d", date.wMonth); break; case TWODIGITMONTH: - wsprintfW (result, fmt__2dW, date.wMonth); + wsprintfW (result, L"%.2d", date.wMonth); break; case THREECHARMONTH: GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1, buffer, ARRAY_SIZE(buffer)); - wsprintfW (result, fmt__3sW, buffer); + wsprintfW (result, L"%s.3s", buffer); break; case FULLMONTH: GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1+date.wMonth -1, @@ -471,14 +469,14 @@ DATETIME_ReturnTxt (const DATETIME_INFO *infoPtr, int count, LPWSTR result, int result[1] = 0; break; case ONEDIGITYEAR: - wsprintfW (result, fmt_dW, date.wYear-10* (int) floor(date.wYear/10)); + wsprintfW (result, L"%d", date.wYear % 10); break; case TWODIGITYEAR: - wsprintfW (result, fmt__2dW, date.wYear-100* (int) floor(date.wYear/100)); + wsprintfW (result, L"%.2d", date.wYear % 100); break; case INVALIDFULLYEAR: case FULLYEAR: - wsprintfW (result, fmt_dW, date.wYear); + wsprintfW (result, L"%d", date.wYear); break; } @@ -596,28 +594,16 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta) } } -static void -DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHORT *width) +static int DATETIME_GetFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count) { /* fields are a fixed width, determined by the largest possible string */ /* presumably, these widths should be language dependent */ - static const WCHAR fld_d1W[] = { '2', 0 }; - static const WCHAR fld_d2W[] = { '2', '2', 0 }; - static const WCHAR fld_d4W[] = { '2', '2', '2', '2', 0 }; - static const WCHAR fld_am1[] = { 'A', 0 }; - static const WCHAR fld_am2[] = { 'A', 'M', 0 }; int spec; WCHAR buffer[80]; LPCWSTR bufptr; SIZE size; - TRACE ("%d,%d\n", infoPtr->nrFields, count); - if (count>infoPtr->nrFields || count < 0) { - WARN ("buffer overrun, have %d want %d\n", infoPtr->nrFields, count); - return; - } - - if (!infoPtr->fieldspec) return; + if (!infoPtr->fieldspec) return 0; spec = infoPtr->fieldspec[count]; if (spec & DT_STRING) { @@ -646,22 +632,17 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO case TWODIGITMINUTE: case TWODIGITMONTH: case TWODIGITYEAR: - bufptr = fld_d2W; + bufptr = L"22"; break; case INVALIDFULLYEAR: case FULLYEAR: - bufptr = fld_d4W; + bufptr = L"2222"; break; case THREECHARMONTH: case FULLMONTH: case THREECHARDAY: case FULLDAY: { - static const WCHAR fld_day[] = {'W','e','d','n','e','s','d','a','y',0}; - static const WCHAR fld_abbrday[] = {'W','e','d',0}; - static const WCHAR fld_mon[] = {'S','e','p','t','e','m','b','e','r',0}; - static const WCHAR fld_abbrmon[] = {'D','e','c',0}; - const WCHAR *fall; LCTYPE lctype; INT i, max_count; @@ -670,22 +651,22 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO /* choose locale data type and fallback string */ switch (spec) { case THREECHARDAY: - fall = fld_abbrday; + fall = L"Wed"; lctype = LOCALE_SABBREVDAYNAME1; max_count = 7; break; case FULLDAY: - fall = fld_day; + fall = L"Wednesday"; lctype = LOCALE_SDAYNAME1; max_count = 7; break; case THREECHARMONTH: - fall = fld_abbrmon; + fall = L"Dec"; lctype = LOCALE_SABBREVMONTHNAME1; max_count = 12; break; default: /* FULLMONTH */ - fall = fld_mon; + fall = L"September"; lctype = LOCALE_SMONTHNAME1; max_count = 12; break; @@ -695,7 +676,7 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO for (i = 0; i < max_count; i++) { if(GetLocaleInfoW(LOCALE_USER_DEFAULT, lctype + i, - buffer, lstrlenW(buffer))) + buffer, ARRAY_SIZE(buffer))) { GetTextExtentPoint32W(hdc, buffer, lstrlenW(buffer), &size); if (size.cx > cx) cx = size.cx; @@ -707,22 +688,21 @@ DATETIME_ReturnFieldWidth (const DATETIME_INFO *infoPtr, HDC hdc, int count, SHO break; } } - *width = cx; - return; + return cx; } case ONELETTERAMPM: - bufptr = fld_am1; + bufptr = L"A"; break; case TWOLETTERAMPM: - bufptr = fld_am2; + bufptr = L"AM"; break; default: - bufptr = fld_d1W; + bufptr = L"2"; break; } } - GetTextExtentPoint32W (hdc, bufptr, strlenW(bufptr), &size); - *width = size.cx; + GetTextExtentPoint32W (hdc, bufptr, lstrlenW(bufptr), &size); + return size.cx; } static void @@ -736,24 +716,22 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) RECT *rcDraw = &infoPtr->rcDraw; SIZE size; COLORREF oldTextColor; - SHORT fieldWidth = 0; HFONT oldFont = SelectObject (hdc, infoPtr->hFont); INT oldBkMode = SetBkMode (hdc, TRANSPARENT); WCHAR txt[80]; DATETIME_ReturnTxt (infoPtr, 0, txt, ARRAY_SIZE(txt)); - GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); + GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size); rcDraw->bottom = size.cy + 2; prevright = infoPtr->checkbox.right = ((infoPtr->dwStyle & DTS_SHOWNONE) ? 18 : 2); for (i = 0; i < infoPtr->nrFields; i++) { DATETIME_ReturnTxt (infoPtr, i, txt, ARRAY_SIZE(txt)); - GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); - DATETIME_ReturnFieldWidth (infoPtr, hdc, i, &fieldWidth); + GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size); field = &infoPtr->fieldRect[i]; field->left = prevright; - field->right = prevright + fieldWidth; + field->right = prevright + DATETIME_GetFieldWidth (infoPtr, hdc, i); field->top = rcDraw->top; field->bottom = rcDraw->bottom; prevright = field->right; @@ -770,7 +748,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) { memcpy(txt, infoPtr->charsEntered, infoPtr->nCharsEntered * sizeof(WCHAR)); txt[infoPtr->nCharsEntered] = 0; - GetTextExtentPoint32W (hdc, txt, strlenW(txt), &size); + GetTextExtentPoint32W (hdc, txt, lstrlenW(txt), &size); } SetRect(&selection, 0, 0, size.cx, size.cy); @@ -786,7 +764,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc) oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText); /* draw the date text using the colour set above */ - DrawTextW (hdc, txt, strlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE); + DrawTextW (hdc, txt, lstrlenW(txt), field, DT_CENTER | DT_VCENTER | DT_SINGLELINE); SetTextColor (hdc, oldTextColor); } SetBkMode (hdc, oldBkMode); @@ -1299,7 +1277,7 @@ DATETIME_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) dwExStyle |= WS_EX_CLIENTEDGE; SetWindowLongW(hwnd, GWL_EXSTYLE, dwExStyle); - return DefWindowProcW(hwnd, WM_NCCREATE, 0, (LPARAM)lpcs); + return 1; } @@ -1452,6 +1430,56 @@ DATETIME_StyleChanged(DATETIME_INFO *infoPtr, WPARAM wStyleType, const STYLESTRU return 0; } +static BOOL DATETIME_GetIdealSize(DATETIME_INFO *infoPtr, SIZE *size) +{ + SIZE field_size; + RECT rect; + WCHAR txt[80]; + HDC hdc; + HFONT oldFont; + int i; + + size->cx = size->cy = 0; + + hdc = GetDC(infoPtr->hwndSelf); + oldFont = SelectObject(hdc, infoPtr->hFont); + + /* Get text font height */ + DATETIME_ReturnTxt(infoPtr, 0, txt, ARRAY_SIZE(txt)); + GetTextExtentPoint32W(hdc, txt, lstrlenW(txt), &field_size); + size->cy = field_size.cy; + + /* Get text font width */ + for (i = 0; i < infoPtr->nrFields; i++) + { + size->cx += DATETIME_GetFieldWidth(infoPtr, hdc, i); + } + + SelectObject(hdc, oldFont); + ReleaseDC(infoPtr->hwndSelf, hdc); + + if (infoPtr->dwStyle & DTS_UPDOWN) + { + GetWindowRect(infoPtr->hUpdown, &rect); + size->cx += rect.right - rect.left; + } + else + { + size->cx += infoPtr->calbutton.right - infoPtr->calbutton.left; + } + + if (infoPtr->dwStyle & DTS_SHOWNONE) + { + size->cx += infoPtr->checkbox.right - infoPtr->checkbox.left; + } + + /* Add space between controls for them not to get too close */ + size->cx += 12; + size->cy += 4; + + TRACE("cx=%d cy=%d\n", size->cx, size->cy); + return TRUE; +} static LRESULT DATETIME_SetFont (DATETIME_INFO *infoPtr, HFONT font, BOOL repaint) @@ -1530,13 +1558,27 @@ DATETIME_GetText (const DATETIME_INFO *infoPtr, INT count, LPWSTR dst) for (i = 0; i < infoPtr->nrFields; i++) { DATETIME_ReturnTxt(infoPtr, i, buf, ARRAY_SIZE(buf)); - if ((strlenW(dst) + strlenW(buf)) < count) - strcatW(dst, buf); + if ((lstrlenW(dst) + lstrlenW(buf)) < count) + lstrcatW(dst, buf); else break; } - return strlenW(dst); + return lstrlenW(dst); } +static int DATETIME_GetTextLength(const DATETIME_INFO *info) +{ + int i, length = 0; + WCHAR buffer[80]; + + TRACE("%p.\n", info); + + for (i = 0; i < info->nrFields; i++) + { + DATETIME_ReturnTxt(info, i, buffer, ARRAY_SIZE(buffer)); + length += lstrlenW(buffer); + } + return length; +} static LRESULT WINAPI DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) @@ -1583,6 +1625,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case DTM_GETMCFONT: return SendMessageW (infoPtr->hMonthCal, WM_GETFONT, wParam, lParam); + case DTM_GETIDEALSIZE: + return DATETIME_GetIdealSize(infoPtr, (SIZE *)lParam); + case WM_NOTIFY: return DATETIME_Notify (infoPtr, (LPNMHDR)lParam); @@ -1650,6 +1695,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_GETTEXT: return (LRESULT) DATETIME_GetText(infoPtr, wParam, (LPWSTR)lParam); + case WM_GETTEXTLENGTH: + return (LRESULT)DATETIME_GetTextLength(infoPtr); + case WM_SETTEXT: return CB_ERR;
3 years, 6 months
1
0
0
0
[reactos] 01/01: [SHELL32] Implement PathResolveW function (#3762)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3a822e4f74ea6ea8335a8…
commit 3a822e4f74ea6ea8335a8684c5071d264fee4bed Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Mon Jun 28 07:53:26 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Mon Jun 28 07:53:26 2021 +0900 [SHELL32] Implement PathResolveW function (#3762) - Implement PathResolveW function. - Implement PathQualifyA/W functions using newly-defined PathQualifyExW function. CORE-12665 --- dll/win32/shell32/CShellLink.cpp | 125 +++---------------- dll/win32/shell32/wine/shellpath.c | 232 +++++++++++++++++++++++++++++++++--- sdk/include/reactos/shlwapi_undoc.h | 12 ++ sdk/include/reactos/undocshell.h | 7 +- 4 files changed, 249 insertions(+), 127 deletions(-) diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp index 7da9b8cf916..cd5d74e2c3f 100644 --- a/dll/win32/shell32/CShellLink.cpp +++ b/dll/win32/shell32/CShellLink.cpp @@ -2178,108 +2178,6 @@ HRESULT CShellLink::SetAdvertiseInfo(LPCWSTR str) return S_OK; } -/* - * Since the real PathResolve (from Wine) is unimplemented at the moment, - * we use this local implementation, until a better one is written (using - * code parts of the SHELL_xxx helpers in Wine's shellpath.c). - */ -static BOOL HACKISH_PathResolve( - IN OUT PWSTR pszPath, - IN PZPCWSTR dirs OPTIONAL, - IN UINT fFlags) -{ - // FIXME: This is unimplemented!!! -#if 0 - return PathResolve(pszPath, dirs, fFlags); -#else - BOOL Success = FALSE; - USHORT i; - LPWSTR fname = NULL; - WCHAR szPath[MAX_PATH]; - - /* First, search for a valid existing path */ - - // NOTE: See also: SHELL_FindExecutable() - - /* - * List of extensions searched for, by PathResolve with the flag - * PRF_TRYPROGRAMEXTENSIONS == PRF_EXECUTABLE | PRF_VERIFYEXISTS set, - * according to MSDN:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb776478(v=vs.85).…
- */ - static PCWSTR Extensions[] = {L".pif", L".com", L".bat", L".cmd", L".lnk", L".exe", NULL}; - #define LNK_EXT_INDEX 4 // ".lnk" has index 4 in the array above - - /* - * Start at the beginning of the list if PRF_EXECUTABLE is set, otherwise - * just use the last element 'NULL' (no extension checking). - */ - i = ((fFlags & PRF_EXECUTABLE) ? 0 : _countof(Extensions) - 1); - for (; i < _countof(Extensions); ++i) - { - /* Ignore shell links ".lnk" if needed */ - if ((fFlags & PRF_DONTFINDLNK) && (i == LNK_EXT_INDEX)) - continue; - - Success = (SearchPathW(NULL, pszPath, Extensions[i], - _countof(szPath), szPath, NULL) != 0); - if (!Success) - { - ERR("SearchPathW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError()); - } - else - { - ERR("SearchPathW(pszPath = '%S', szPath = '%S') succeeded\n", pszPath, szPath); - break; - } - } - - if (!Success) - { - ERR("SearchPathW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError()); - - /* We failed, try with PathFindOnPath, as explained by MSDN */ - // Success = PathFindOnPathW(pszPath, dirs); - StringCchCopyW(szPath, _countof(szPath), pszPath); - Success = PathFindOnPathW(szPath, dirs); - if (!Success) - { - ERR("PathFindOnPathW(pszPath = '%S') failed\n", pszPath); - - /* We failed again, fall back to building a possible non-existing path */ - if (!GetFullPathNameW(pszPath, _countof(szPath), szPath, &fname)) - { - ERR("GetFullPathNameW(pszPath = '%S') failed. Error code: %lu\n", pszPath, GetLastError()); - return FALSE; - } - - Success = PathFileExistsW(szPath); - if (!Success) - ERR("PathFileExistsW(szPath = '%S') failed. Error code: %lu\n", szPath, GetLastError()); - - /******************************************************/ - /* Question: Why this line is needed only for files?? */ - if (fname && (_wcsicmp(pszPath, fname) == 0)) - *szPath = L'\0'; - /******************************************************/ - } - else - { - ERR("PathFindOnPathW(pszPath = '%S' ==> '%S') succeeded\n", pszPath, szPath); - } - } - - /* Copy back the results to the caller */ - StringCchCopyW(pszPath, MAX_PATH, szPath); - - /* - * Since the called functions always checked whether the file path existed, - * we do not need to redo a final check: we can use instead the cached - * result in 'Success'. - */ - return ((fFlags & PRF_VERIFYEXISTS) ? Success : TRUE); -#endif -} - HRESULT CShellLink::SetTargetFromPIDLOrPath(LPCITEMIDLIST pidl, LPCWSTR pszFile) { HRESULT hr = S_OK; @@ -2309,14 +2207,21 @@ HRESULT CShellLink::SetTargetFromPIDLOrPath(LPCITEMIDLIST pidl, LPCWSTR pszFile) /* This failed, try to resolve the path, then create a simple PIDL */ StringCchCopyW(szPath, _countof(szPath), pszFile); - // FIXME: Because PathResolve is unimplemented, we use our hackish implementation! - HACKISH_PathResolve(szPath, NULL, PRF_TRYPROGRAMEXTENSIONS); - - pidlNew = SHSimpleIDListFromPathW(szPath); - /******************************************************/ - /* Question: Why this line is needed only for files?? */ - hr = (*szPath ? S_OK : E_INVALIDARG); // S_FALSE - /******************************************************/ + PathResolveW(szPath, NULL, PRF_TRYPROGRAMEXTENSIONS); + + if (PathIsFileSpecW(szPath)) + { + hr = E_INVALIDARG; + szPath[0] = 0; + } + else + { + hr = S_OK; + pidlNew = SHSimpleIDListFromPathW(szPath); + // NOTE: Don't make it failed here even if pidlNew was NULL. + // We don't fail on purpose even if SHSimpleIDListFromPathW returns NULL. + // This behaviour has been verified with tests. + } } } // else if (!pidl && !pszFile) { pidlNew = NULL; hr = S_OK; } diff --git a/dll/win32/shell32/wine/shellpath.c b/dll/win32/shell32/wine/shellpath.c index 892748d56b7..e4234efffcd 100644 --- a/dll/win32/shell32/wine/shellpath.c +++ b/dll/win32/shell32/wine/shellpath.c @@ -3,7 +3,7 @@ * * Copyright 1998, 1999, 2000 Juergen Schmied * Copyright 2004 Juan Lang - * Copyright 2018-2020 Katayama Hirofumi MZ + * Copyright 2018-2021 Katayama Hirofumi MZ * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -50,6 +50,9 @@ #include "shell32_main.h" #include "shresdef.h" +#undef _WIN32_WINNT +#define _WIN32_WINNT _WIN32_WINNT_WS03 + WINE_DEFAULT_DEBUG_CHANNEL(shell); static const BOOL is_win64 = sizeof(void *) > sizeof(int); @@ -106,6 +109,127 @@ DoGetProductType(PNT_PRODUCT_TYPE ProductType) ########## Combining and Constructing paths ########## */ +/* @implemented */ +static BOOL WINAPI +PathSearchOnExtensionsW(LPWSTR pszPath, LPCWSTR *ppszDirs, BOOL bDoSearch, DWORD dwWhich) +{ + if (*PathFindExtensionW(pszPath) != 0) + return FALSE; + + if (bDoSearch) + return PathFindOnPathExW(pszPath, ppszDirs, dwWhich); + else + return PathFileExistsDefExtW(pszPath, dwWhich); +} + +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) +/* @implemented */ +static BOOL WINAPI PathIsAbsoluteW(LPCWSTR path) +{ + return PathIsUNCW(path) || (PathGetDriveNumberW(path) != -1 && path[2] == L'\\'); +} + +/* @implemented */ +static BOOL WINAPI PathMakeAbsoluteW(LPWSTR path) +{ + WCHAR path1[MAX_PATH]; + DWORD cch; + + if (path == NULL) + return FALSE; + cch = GetCurrentDirectoryW(_countof(path1), path1); + if (!cch || cch > _countof(path1)) + return FALSE; + return (PathCombineW(path, path1, path) != NULL); +} +#endif + +/* NOTE: GetShortPathName fails if the pathname didn't exist. + GetShortPathNameAbsentW should set the short path name that even doesn't exist. */ +static DWORD GetShortPathNameAbsentW(LPCWSTR pszLong, LPWSTR pszShort, DWORD cchShort) +{ + FIXME("GetShortPathNameAbsentW(%ls, %p, %ld): stub\n", pszLong, pszShort, cchShort); + StringCchCopyW(pszShort, cchShort, pszLong); + return lstrlenW(pszShort); +} + +BOOL WINAPI IsLFNDriveW(LPCWSTR lpszPath); + +/* @unconfirmed */ +static VOID WINAPI PathQualifyExW(LPWSTR pszPath, LPCWSTR pszDir, DWORD dwFlags) +{ + WCHAR szRoot[MAX_PATH], szCopy[MAX_PATH], szCurDir[MAX_PATH]; + LPWSTR pch; + LONG cch; + BOOL bCheckLFN; + + if (FAILED(StringCchCopyW(szCopy, _countof(szCopy), pszPath))) + return; + + FixSlashesAndColonW(szCopy); + + if (pszDir) + { + cch = GetCurrentDirectoryW(_countof(szCurDir), szCurDir); + if (cch <= 0 || cch >= _countof(szCurDir) || !SetCurrentDirectoryW(pszDir)) + pszDir = NULL; + } + + if (!GetFullPathNameW(szCopy, _countof(szRoot), szRoot, NULL)) + goto Quit; + + if (PathIsUNCW(szRoot)) /* it begins with double backslash */ + { + pch = StrChrW(&szRoot[2], L'\\'); + if (pch) + { + pch = StrChrW(&pch[1], L'\\'); + if (pch) + *pch = 0; + if (!PathAddBackslashW(szRoot)) + goto Quit; + /* szRoot is like \\MyServer\MyShare\ */ + bCheckLFN = TRUE; + } + else + { + bCheckLFN = FALSE; + } + } + else + { + if (!PathStripToRootW(szRoot) || !PathAddBackslashW(szRoot)) + goto Quit; + /* szRoot is like X:\ */ + bCheckLFN = TRUE; + } + + if (bCheckLFN && !IsLFNDriveW(szRoot)) /* not a long filename drive */ + { + if (!GetFullPathNameW(szCopy, _countof(szRoot), szRoot, NULL)) + goto Quit; + if (!GetShortPathNameW(szRoot, szCopy, _countof(szCopy)) && + !GetShortPathNameAbsentW(szRoot, szCopy, _countof(szCopy))) + { + goto Quit; + } + } + + PathRemoveBackslashW(szCopy); + StringCchCopyW(pszPath, MAX_PATH, szCopy); + + if ((dwFlags & 1) == 0) + { + cch = lstrlenW(pszPath); + if (cch > 0 && pszPath[cch - 1] == L'.') + pszPath[cch - 1] = 0; + } + +Quit: + if (pszDir) + SetCurrentDirectoryW(szCurDir); +} + /************************************************************************* * PathAppend [SHELL32.36] */ @@ -476,40 +600,118 @@ int WINAPI PathCleanupSpec( LPCWSTR lpszPathW, LPWSTR lpszFileW ) /************************************************************************* * PathQualifyA [SHELL32] */ -static BOOL PathQualifyA(LPCSTR pszPath) +VOID WINAPI PathQualifyA(LPSTR pszPath) { - FIXME("%s\n",pszPath); - return FALSE; + WCHAR szPath[MAX_PATH]; + TRACE("%s\n",pszPath); + SHAnsiToUnicode(pszPath, szPath, _countof(szPath)); + PathQualifyW(szPath); + SHUnicodeToAnsi(szPath, pszPath, MAX_PATH); } /************************************************************************* * PathQualifyW [SHELL32] */ -static BOOL PathQualifyW(LPCWSTR pszPath) +VOID WINAPI PathQualifyW(LPWSTR pszPath) { - FIXME("%s\n",debugstr_w(pszPath)); - return FALSE; + TRACE("%s\n",debugstr_w(pszPath)); + PathQualifyExW(pszPath, NULL, 0); } /************************************************************************* * PathQualify [SHELL32.49] */ -BOOL WINAPI PathQualifyAW(LPCVOID pszPath) +VOID WINAPI PathQualifyAW(LPVOID pszPath) { - if (SHELL_OsIsUnicode()) - return PathQualifyW(pszPath); - return PathQualifyA(pszPath); + if (SHELL_OsIsUnicode()) + PathQualifyW(pszPath); + else + PathQualifyA(pszPath); } -static BOOL PathResolveA(LPSTR path, LPCSTR *paths, DWORD flags) +BOOL WINAPI PathResolveA(LPSTR path, LPCSTR *dirs, DWORD flags) { - FIXME("(%s,%p,0x%08x),stub!\n", debugstr_a(path), paths, flags); + FIXME("(%s,%p,0x%08x),stub!\n", debugstr_a(path), dirs, flags); return FALSE; } -static BOOL PathResolveW(LPWSTR path, LPCWSTR *paths, DWORD flags) +#define WHICH_DONTFINDLNK (WHICH_PIF | WHICH_COM | WHICH_EXE | WHICH_BAT) +#define WHICH_DEFAULT (WHICH_DONTFINDLNK | WHICH_LNK | WHICH_CMD) + +BOOL WINAPI PathResolveW(LPWSTR path, LPCWSTR *dirs, DWORD flags) { - FIXME("(%s,%p,0x%08x),stub!\n", debugstr_w(path), paths, flags); + DWORD dwWhich; + TRACE("PathResolveW(%s,%p,0x%08x)\n", debugstr_w(path), dirs, flags); + dwWhich = ((flags & PRF_DONTFINDLNK) ? WHICH_DONTFINDLNK : WHICH_DEFAULT); + + if (flags & PRF_VERIFYEXISTS) + SetLastError(ERROR_FILE_NOT_FOUND); + + PathUnquoteSpacesW(path); + + if (PathIsRootW(path)) + { + if ((path[0] == L'\\' && path[1] == 0) || + PathIsUNCServerW(path) || PathIsUNCServerShareW(path)) + { + if (flags & PRF_FIRSTDIRDEF) + PathQualifyExW(path, dirs[0], 0); + else + PathQualifyExW(path, NULL, 0); + } + + if (flags & PRF_VERIFYEXISTS) + return PathFileExistsAndAttributesW(path, NULL); + return TRUE; + } + else if (PathIsFileSpecW(path)) + { + if ((flags & PRF_TRYPROGRAMEXTENSIONS) && PathSearchOnExtensionsW(path, dirs, TRUE, dwWhich)) + return TRUE; + + if (PathFindOnPathW(path, dirs)) + { +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) + if (!(flags & PRF_REQUIREABSOLUTE)) + return TRUE; + + if (!PathIsAbsoluteW(path)) + return PathMakeAbsoluteW(path) && PathFileExistsAndAttributesW(path, NULL); +#else + return TRUE; +#endif + } + } + else if (!PathIsURLW(path)) + { + if (flags & PRF_FIRSTDIRDEF) + PathQualifyExW(path, *dirs, 1); + else + PathQualifyExW(path, NULL, 1); + + if (flags & PRF_VERIFYEXISTS) + { + if ((flags & PRF_TRYPROGRAMEXTENSIONS) && + PathSearchOnExtensionsW(path, dirs, FALSE, dwWhich)) + { + return TRUE; + } + else if (!PathFileExistsAndAttributesW(path, NULL)) + { + return FALSE; + } + } + +#if (_WIN32_WINNT >= _WIN32_WINNT_VISTA) + if (flags & PRF_REQUIREABSOLUTE) + { + if (!PathIsAbsoluteW(path)) + return PathMakeAbsoluteW(path) && PathFileExistsAndAttributesW(path, NULL); + } +#endif + return TRUE; + } + return FALSE; } diff --git a/sdk/include/reactos/shlwapi_undoc.h b/sdk/include/reactos/shlwapi_undoc.h index c1f92559e55..ed54a70c686 100644 --- a/sdk/include/reactos/shlwapi_undoc.h +++ b/sdk/include/reactos/shlwapi_undoc.h @@ -150,6 +150,18 @@ ShellMessageBoxWrapW( _In_ UINT fuStyle, ...); +/* dwWhich flags for PathFileExistsDefExtW and PathFindOnPathExW */ +#define WHICH_PIF (1 << 0) +#define WHICH_COM (1 << 1) +#define WHICH_EXE (1 << 2) +#define WHICH_BAT (1 << 3) +#define WHICH_LNK (1 << 4) +#define WHICH_CMD (1 << 5) + +BOOL WINAPI PathFileExistsDefExtW(LPWSTR lpszPath, DWORD dwWhich); +BOOL WINAPI PathFindOnPathExW(LPWSTR lpszFile, LPCWSTR *lppszOtherDirs, DWORD dwWhich); +VOID WINAPI FixSlashesAndColonW(LPWSTR); + #ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */ diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h index a173174cb57..0aad1cf1851 100644 --- a/sdk/include/reactos/undocshell.h +++ b/sdk/include/reactos/undocshell.h @@ -440,8 +440,9 @@ BOOL WINAPI PathYetAnotherMakeUniqueName( LPCWSTR lpszShortName, LPCWSTR lpszLongName); -BOOL WINAPI PathQualifyAW(LPCVOID path); - +VOID WINAPI PathQualifyA(LPSTR pszPath); +VOID WINAPI PathQualifyW(LPWSTR pszPath); +VOID WINAPI PathQualifyAW(LPVOID path); /* PathResolve flags */ #define PRF_CHECKEXISTANCE 0x01 @@ -449,6 +450,8 @@ BOOL WINAPI PathQualifyAW(LPCVOID path); #define PRF_QUALIFYONPATH 0x04 #define PRF_WINDOWS31 0x08 +BOOL WINAPI PathResolveA(LPSTR path, LPCSTR *dirs, DWORD flags); +BOOL WINAPI PathResolveW(LPWSTR path, LPCWSTR *dirs, DWORD flags); BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags); VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
3 years, 6 months
1
0
0
0
[reactos] 01/01: [DSOUND][WAVE] Workaround crash when recording sound in Scratch 1.4 CORE-13202
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81f8bcea8c9456124eaa4…
commit 81f8bcea8c9456124eaa422a155e6bbced4319f0 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sun Jun 27 23:04:36 2021 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sun Jun 27 23:04:36 2021 +0200 [DSOUND][WAVE] Workaround crash when recording sound in Scratch 1.4 CORE-13202 It regressed by SVN r44721 == git 356d4bab16092de335705e02b0e87698ec35c393 when #define USE_MMIXER_LIB was removed. Thanks to the patches author Doug Lyons. VBox
https://reactos.org/testman/compare.php?ids=77914,77919
LGTM KVM
https://reactos.org/testman/compare.php?ids=77913,77918
LGTM --- dll/directx/wine/dsound/capture.c | 6 ++++++ sdk/lib/drivers/sound/mmebuddy/wave/widMessage.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/dll/directx/wine/dsound/capture.c b/dll/directx/wine/dsound/capture.c index b8df4f52488..35533de0805 100644 --- a/dll/directx/wine/dsound/capture.c +++ b/dll/directx/wine/dsound/capture.c @@ -846,6 +846,12 @@ static HRESULT IDirectSoundCaptureBufferImpl_Create( wfex->nAvgBytesPerSec, wfex->nBlockAlign, wfex->wBitsPerSample, wfex->cbSize); + /* Do some sanity checks for 'recording' SamplesPerSec value */ + if (wfex->nSamplesPerSec > 100000) + wfex->nSamplesPerSec = 100000; + if (wfex->nSamplesPerSec < 5000) + wfex->nSamplesPerSec = 5000; + device->pwfx = DSOUND_CopyFormat(wfex); if ( device->pwfx == NULL ) { *ppobj = NULL; diff --git a/sdk/lib/drivers/sound/mmebuddy/wave/widMessage.c b/sdk/lib/drivers/sound/mmebuddy/wave/widMessage.c index 81fd344a413..c2e8363a237 100644 --- a/sdk/lib/drivers/sound/mmebuddy/wave/widMessage.c +++ b/sdk/lib/drivers/sound/mmebuddy/wave/widMessage.c @@ -61,6 +61,14 @@ widMessage( } case WIDM_OPEN : { + + /* Do sanity checks for 'recording' SamplesPerSec value */ + LPWAVEOPENDESC OpenParameters = (LPWAVEOPENDESC)Parameter1; + if (OpenParameters->lpFormat->nSamplesPerSec > 100000) + OpenParameters->lpFormat->nSamplesPerSec = 100000; + if (OpenParameters->lpFormat->nSamplesPerSec < 5000) + OpenParameters->lpFormat->nSamplesPerSec = 5000; + Result = MmeOpenDevice(WAVE_IN_DEVICE_TYPE, DeviceId, (LPWAVEOPENDESC) Parameter1,
3 years, 6 months
1
0
0
0
[reactos] 01/01: [TCPIP] Fix bugcheck when using fragmented datagrams
by Hervé Poussineau
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=979b7d4d8e6ca8e80ea5b…
commit 979b7d4d8e6ca8e80ea5b30c70f17a7c868b060f Author: Hervé Poussineau <hpoussin(a)reactos.org> AuthorDate: Sun Jun 27 14:44:54 2021 +0200 Commit: Hervé Poussineau <hpoussin(a)reactos.org> CommitDate: Sun Jun 27 17:45:53 2021 +0200 [TCPIP] Fix bugcheck when using fragmented datagrams Memory was allocated from paged pool, and freed at DISPATCH_LEVEL, leading to the following bugcheck: *** Fatal System Error: 0x000000c2 (0x00000009,0x00000002,0x00000001,0xB7C8A268) Entered debugger on embedded INT3 at 0x0008:0x8058324B. kdb:> bt Eip: <ntoskrnl.exe:18324c (sdk/lib/rtl/i386/debug_asm.S:56 (RtlpBreakWithStatusInstruction))> <ntoskrnl.exe:89b21 (ntoskrnl/ke/bug.c:1066 (KeBugCheckWithTf))> <ntoskrnl.exe:8a08b (ntoskrnl/ke/bug.c:1413 (KeBugCheckEx))> <ntoskrnl.exe:abb1d (ntoskrnl/mm/ARM3/expool.c:431 (ExFreePoolWithTag))> <tcpip.sys:13e42 (sdk/lib/drivers/ip/network/receive.c:114 (FreeIPDR))> <tcpip.sys:14e09 (sdk/include/ddk/wdm.h:11462 (IPDatagramReassemblyTimeout))> <tcpip.sys:11604 (sdk/lib/drivers/ip/network/ip.c:135 (IPTimeoutDpcFn))> <ntoskrnl.exe:8b7d0 (ntoskrnl/ke/dpc.c:282 (KiTimerExpiration))> <ntoskrnl.exe:8c2c8 (ntoskrnl/ke/dpc.c:592 (KiRetireDpcList))> <ntoskrnl.exe:1420b2 (ntoskrnl/ke/i386/thrdini.c:294 (KiIdleLoop))> <ntoskrnl.exe:23a54a (ntoskrnl/ke/i386/kiinit.c:687 (KiSystemStartupBootStack))> --- sdk/lib/drivers/ip/network/receive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/lib/drivers/ip/network/receive.c b/sdk/lib/drivers/ip/network/receive.c index bddef7972dd..86e7ff7475c 100644 --- a/sdk/lib/drivers/ip/network/receive.c +++ b/sdk/lib/drivers/ip/network/receive.c @@ -215,7 +215,7 @@ ReassembleDatagram( RtlCopyMemory(&IPPacket->DstAddr, &IPDR->DstAddr, sizeof(IP_ADDRESS)); /* Allocate space for full IP datagram */ - IPPacket->Header = ExAllocatePoolWithTag(PagedPool, IPPacket->TotalSize, PACKET_BUFFER_TAG); + IPPacket->Header = ExAllocatePoolWithTag(NonPagedPool, IPPacket->TotalSize, PACKET_BUFFER_TAG); if (!IPPacket->Header) { TI_DbgPrint(MIN_TRACE, ("Insufficient resources.\n")); (*IPPacket->Free)(IPPacket);
3 years, 6 months
1
0
0
0
[reactos] 01/01: [EXT2] Fix filesystem corruption regressions CORE-17572 CORE-17195
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cb408102cc3e3ed853a00…
commit cb408102cc3e3ed853a009962482251e45861699 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Sun Jun 27 16:21:32 2021 +0200 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Sun Jun 27 16:21:32 2021 +0200 [EXT2] Fix filesystem corruption regressions CORE-17572 CORE-17195 It regressed when we upgraded Ext2Fsd to version 0.69 from version 0.68 via CORE-13980 in 0.4.8-dev-117-g a1d7e9936d8e58bc07ff2cc73a937ce845c7d542 The fix is a partial revert of that. Thanks to the patches author Doug Lyons. VBox
https://reactos.org/testman/compare.php?ids=77904,77908
LGTM KVM
https://reactos.org/testman/compare.php?ids=77903,77907
LGTM --- drivers/filesystems/ext2/src/ext3/generic.c | 91 +++++++++++++---------------- 1 file changed, 42 insertions(+), 49 deletions(-) diff --git a/drivers/filesystems/ext2/src/ext3/generic.c b/drivers/filesystems/ext2/src/ext3/generic.c index d6dd8c4eb6c..0140e930860 100644 --- a/drivers/filesystems/ext2/src/ext3/generic.c +++ b/drivers/filesystems/ext2/src/ext3/generic.c @@ -858,69 +858,62 @@ Ext2ZeroBuffer( IN PEXT2_IRP_CONTEXT IrpContext, } +#define SIZE_256K 0x40000 + BOOLEAN Ext2SaveBuffer( IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, - IN LONGLONG offset, - IN ULONG size, - IN PVOID buf ) + IN LONGLONG Offset, + IN ULONG Size, + IN PVOID Buf ) { - struct buffer_head *bh = NULL; - BOOLEAN rc = 0; - - _SEH2_TRY { - - while (size) { - - sector_t block; - ULONG len = 0, delta = 0; - - block = (sector_t) (offset >> BLOCK_BITS); - delta = (ULONG)offset & (BLOCK_SIZE - 1); - len = BLOCK_SIZE - delta; - if (size < len) - len = size; + BOOLEAN rc; - if (delta == 0 && len >= BLOCK_SIZE) { - bh = sb_getblk_zero(&Vcb->sb, block); - } else { - bh = sb_getblk(&Vcb->sb, block); - } + while (Size) { - if (!bh) { - DEBUG(DL_ERR, ("Ext2SaveBuffer: can't load block %I64u\n", block)); - DbgBreak(); - _SEH2_LEAVE; - } + PBCB Bcb; + PVOID Buffer; + ULONG Length; - if (!buffer_uptodate(bh)) { - int err = bh_submit_read(bh); - if (err < 0) { - DEBUG(DL_ERR, ("Ext2SaveBuffer: bh_submit_read failed: %d\n", err)); - _SEH2_LEAVE; - } - } + Length = (ULONG)Offset & (SIZE_256K - 1); + Length = SIZE_256K - Length; + if (Size < Length) + Length = Size; - _SEH2_TRY { - RtlCopyMemory(bh->b_data + delta, buf, len); - mark_buffer_dirty(bh); - } _SEH2_FINALLY { - fini_bh(&bh); - } _SEH2_END; + if ( !CcPreparePinWrite( + Vcb->Volume, + (PLARGE_INTEGER) (&Offset), + Length, + FALSE, + PIN_WAIT | PIN_EXCLUSIVE, + &Bcb, + &Buffer )) { - buf = (PUCHAR)buf + len; - offset = offset + len; - size = size - len; + DEBUG(DL_ERR, ( "Ext2SaveBuffer: failed to PinLock offset %I64xh ...\n", Offset)); + return FALSE; } - rc = TRUE; + _SEH2_TRY { - } _SEH2_FINALLY { + RtlCopyMemory(Buffer, Buf, Length); + CcSetDirtyPinnedData(Bcb, NULL ); + SetFlag(Vcb->Volume->Flags, FO_FILE_MODIFIED); - if (bh) - fini_bh(&bh); + rc = Ext2AddVcbExtent(Vcb, Offset, (LONGLONG)Length); + if (!rc) { + DbgBreak(); + Ext2Sleep(100); + rc = Ext2AddVcbExtent(Vcb, Offset, (LONGLONG)Length); + } - } _SEH2_END; + } _SEH2_FINALLY { + CcUnpinData(Bcb); + } _SEH2_END; + + Buf = (PUCHAR)Buf + Length; + Offset = Offset + Length; + Size = Size - Length; + } return rc; }
3 years, 6 months
1
0
0
0
[reactos] 01/01: [HAL:APIC] Improve code
by Timo Kreuzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=16e988d10858ee1dd14d6…
commit 16e988d10858ee1dd14d6ea17056797a18fa0cff Author: Timo Kreuzer <timo.kreuzer(a)reactos.org> AuthorDate: Tue Jun 22 12:53:23 2021 +0200 Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org> CommitDate: Sat Jun 26 21:10:43 2021 +0200 [HAL:APIC] Improve code - Use an enum for the APIC registers - Add support routine for SMP. --- hal/halx86/apic.cmake | 1 + hal/halx86/apic/apic.c | 22 ++++----- hal/halx86/apic/apicp.h | 120 ++++++++++++++++++++++++++-------------------- hal/halx86/apic/apicsmp.c | 96 +++++++++++++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 64 deletions(-) diff --git a/hal/halx86/apic.cmake b/hal/halx86/apic.cmake index 10857eeea8f..8868f40c1a2 100644 --- a/hal/halx86/apic.cmake +++ b/hal/halx86/apic.cmake @@ -6,6 +6,7 @@ list(APPEND HAL_APIC_ASM_SOURCE list(APPEND HAL_APIC_SOURCE apic/apic.c apic/apictimer.c + apic/apicsmp.c apic/halinit.c apic/processor.c apic/rtctimer.c diff --git a/hal/halx86/apic/apic.c b/hal/halx86/apic/apic.c index eae012d61b2..9f204bded55 100644 --- a/hal/halx86/apic/apic.c +++ b/hal/halx86/apic/apic.c @@ -136,19 +136,19 @@ ApicReadIORedirectionEntry( FORCEINLINE VOID -ApicRequestInterrupt(IN UCHAR Vector, UCHAR TriggerMode) +ApicRequestSelfInterrupt(IN UCHAR Vector, UCHAR TriggerMode) { - APIC_COMMAND_REGISTER CommandRegister; + APIC_INTERRUPT_COMMAND_REGISTER Icr; /* Setup the command register */ - CommandRegister.Long0 = 0; - CommandRegister.Vector = Vector; - CommandRegister.MessageType = APIC_MT_Fixed; - CommandRegister.TriggerMode = TriggerMode; - CommandRegister.DestinationShortHand = APIC_DSH_Self; + Icr.Long0 = 0; + Icr.Vector = Vector; + Icr.MessageType = APIC_MT_Fixed; + Icr.TriggerMode = TriggerMode; + Icr.DestinationShortHand = APIC_DSH_Self; /* Write the low dword to send the interrupt */ - ApicWrite(APIC_ICR0, CommandRegister.Long0); + ApicWrite(APIC_ICR0, Icr.Long0); } FORCEINLINE @@ -615,7 +615,7 @@ FASTCALL HalRequestSoftwareInterrupt(IN KIRQL Irql) { /* Convert irql to vector and request an interrupt */ - ApicRequestInterrupt(IrqlToSoftVector(Irql), APIC_TGM_Edge); + ApicRequestSelfInterrupt(IrqlToSoftVector(Irql), APIC_TGM_Edge); } VOID @@ -745,7 +745,7 @@ HalBeginSystemInterrupt( RedirReg = ApicReadIORedirectionEntry(Index); /* Re-request the interrupt to be handled later */ - ApicRequestInterrupt(Vector, (UCHAR)RedirReg.TriggerMode); + ApicRequestSelfInterrupt(Vector, (UCHAR)RedirReg.TriggerMode); } else { @@ -753,7 +753,7 @@ HalBeginSystemInterrupt( ASSERT(Index == APIC_RESERVED_VECTOR); /* Re-request the interrupt to be handled later */ - ApicRequestInterrupt(Vector, APIC_TGM_Edge); + ApicRequestSelfInterrupt(Vector, APIC_TGM_Edge); } /* Pretend it was a spurious interrupt */ diff --git a/hal/halx86/apic/apicp.h b/hal/halx86/apic/apicp.h index bd06a3a0cf6..a532fdcad8d 100644 --- a/hal/halx86/apic/apicp.h +++ b/hal/halx86/apic/apicp.h @@ -74,46 +74,52 @@ /* APIC Register Address Map */ -#define APIC_ID 0x0020 /* Local APIC ID Register (R/W) */ -#define APIC_VER 0x0030 /* Local APIC Version Register (R) */ -#define APIC_TPR 0x0080 /* Task Priority Register (R/W) */ -#define APIC_APR 0x0090 /* Arbitration Priority Register (R) */ -#define APIC_PPR 0x00A0 /* Processor Priority Register (R) */ -#define APIC_EOI 0x00B0 /* EOI Register (W) */ -#define APIC_RRR 0x00C0 /* Remote Read Register () */ -#define APIC_LDR 0x00D0 /* Logical Destination Register (R/W) */ -#define APIC_DFR 0x00E0 /* Destination Format Register (0-27 R, 28-31 R/W) */ -#define APIC_SIVR 0x00F0 /* Spurious Interrupt Vector Register (0-3 R, 4-9 R/W) */ -#define APIC_ISR 0x0100 /* Interrupt Service Register 0-255 (R) */ -#define APIC_TMR 0x0180 /* Trigger Mode Register 0-255 (R) */ -#define APIC_IRR 0x0200 /* Interrupt Request Register 0-255 (r) */ -#define APIC_ESR 0x0280 /* Error Status Register (R) */ -#define APIC_ICR0 0x0300 /* Interrupt Command Register 0-31 (R/W) */ -#define APIC_ICR1 0x0310 /* Interrupt Command Register 32-63 (R/W) */ -#define APIC_TMRLVTR 0x0320 /* Timer Local Vector Table (R/W) */ -#define APIC_THRMLVTR 0x0330 /* Thermal Local Vector Table */ -#define APIC_PCLVTR 0x0340 /* Performance Counter Local Vector Table (R/W) */ -#define APIC_LINT0 0x0350 /* LINT0 Local Vector Table (R/W) */ -#define APIC_LINT1 0x0360 /* LINT1 Local Vector Table (R/W) */ -#define APIC_ERRLVTR 0x0370 /* Error Local Vector Table (R/W) */ -#define APIC_TICR 0x0380 /* Initial Count Register for Timer (R/W) */ -#define APIC_TCCR 0x0390 /* Current Count Register for Timer (R) */ -#define APIC_TDCR 0x03E0 /* Timer Divide Configuration Register (R/W) */ -#define APIC_EAFR 0x0400 /* extended APIC Feature register (R/W) */ -#define APIC_EACR 0x0410 /* Extended APIC Control Register (R/W) */ -#define APIC_SEOI 0x0420 /* Specific End Of Interrupt Register (W) */ -#define APIC_EXT0LVTR 0x0500 /* Extended Interrupt 0 Local Vector Table */ -#define APIC_EXT1LVTR 0x0510 /* Extended Interrupt 1 Local Vector Table */ -#define APIC_EXT2LVTR 0x0520 /* Extended Interrupt 2 Local Vector Table */ -#define APIC_EXT3LVTR 0x0530 /* Extended Interrupt 3 Local Vector Table */ +typedef enum _APIC_REGISTER +{ + APIC_ID = 0x0020, /* Local APIC ID Register (R/W) */ + APIC_VER = 0x0030, /* Local APIC Version Register (R) */ + APIC_TPR = 0x0080, /* Task Priority Register (R/W) */ + APIC_APR = 0x0090, /* Arbitration Priority Register (R) */ + APIC_PPR = 0x00A0, /* Processor Priority Register (R) */ + APIC_EOI = 0x00B0, /* EOI Register (W) */ + APIC_RRR = 0x00C0, /* Remote Read Register () */ + APIC_LDR = 0x00D0, /* Logical Destination Register (R/W) */ + APIC_DFR = 0x00E0, /* Destination Format Register (0-27 R, 28-31 R/W) */ + APIC_SIVR = 0x00F0, /* Spurious Interrupt Vector Register (0-3 R, 4-9 R/W) */ + APIC_ISR = 0x0100, /* Interrupt Service Register 0-255 (R) */ + APIC_TMR = 0x0180, /* Trigger Mode Register 0-255 (R) */ + APIC_IRR = 0x0200, /* Interrupt Request Register 0-255 (r) */ + APIC_ESR = 0x0280, /* Error Status Register (R) */ + APIC_ICR0 = 0x0300, /* Interrupt Command Register 0-31 (R/W) */ + APIC_ICR1 = 0x0310, /* Interrupt Command Register 32-63 (R/W) */ + APIC_TMRLVTR = 0x0320, /* Timer Local Vector Table (R/W) */ + APIC_THRMLVTR = 0x0330, /* Thermal Local Vector Table */ + APIC_PCLVTR = 0x0340, /* Performance Counter Local Vector Table (R/W) */ + APIC_LINT0 = 0x0350, /* LINT0 Local Vector Table (R/W) */ + APIC_LINT1 = 0x0360, /* LINT1 Local Vector Table (R/W) */ + APIC_ERRLVTR = 0x0370, /* Error Local Vector Table (R/W) */ + APIC_TICR = 0x0380, /* Initial Count Register for Timer (R/W) */ + APIC_TCCR = 0x0390, /* Current Count Register for Timer (R) */ + APIC_TDCR = 0x03E0, /* Timer Divide Configuration Register (R/W) */ + APIC_EAFR = 0x0400, /* extended APIC Feature register (R/W) */ + APIC_EACR = 0x0410, /* Extended APIC Control Register (R/W) */ + APIC_SEOI = 0x0420, /* Specific End Of Interrupt Register (W) */ + APIC_EXT0LVTR = 0x0500, /* Extended Interrupt 0 Local Vector Table */ + APIC_EXT1LVTR = 0x0510, /* Extended Interrupt 1 Local Vector Table */ + APIC_EXT2LVTR = 0x0520, /* Extended Interrupt 2 Local Vector Table */ + APIC_EXT3LVTR = 0x0530 /* Extended Interrupt 3 Local Vector Table */ +} APIC_REGISTER; #define MSR_APIC_BASE 0x0000001B #define IOAPIC_PHYS_BASE 0xFEC00000 #define APIC_CLOCK_INDEX 8 #define ApicLogicalId(Cpu) ((UCHAR)(1<< Cpu)) -/* Message Type */ -enum +/* The following definitions are based on AMD documentation. + They differ slightly in Intel documentation. */ + +/* Message Type (Intel: "Delivery Mode") */ +typedef enum _APIC_MT { APIC_MT_Fixed = 0, APIC_MT_LowestPriority = 1, @@ -123,40 +129,48 @@ enum APIC_MT_INIT = 5, APIC_MT_Startup = 6, APIC_MT_ExtInt = 7, -}; +} APIC_MT; /* Trigger Mode */ -enum +typedef enum _APIC_TGM { APIC_TGM_Edge, APIC_TGM_Level -}; +} APIC_TGM; -/* Delivery Mode */ -enum +/* Destination Mode */ +typedef enum _APIC_DM { APIC_DM_Physical, APIC_DM_Logical -}; +} APIC_DM; /* Destination Short Hand */ -enum +typedef enum _APIC_DSH { APIC_DSH_Destination, APIC_DSH_Self, APIC_DSH_AllIncludingSelf, APIC_DSH_AllExclusingSelf -}; +} APIC_DSH; /* Write Constants */ -enum +typedef enum _APIC_DF { APIC_DF_Flat = 0xFFFFFFFF, APIC_DF_Cluster = 0x0FFFFFFF -}; +} APIC_DF; + +/* Remote Read Status */ +typedef enum _APIC_RRS +{ + APIC_RRS_Invalid = 0, + APIC_RRS_Pending = 1, + APIC_RRS_Done = 2 +} APIC_RRS; /* Timer Constants */ -enum +enum _TIMER_DV { TIMER_DV_DivideBy2 = 0, TIMER_DV_DivideBy4 = 1, @@ -166,7 +180,7 @@ enum TIMER_DV_DivideBy64 = 9, TIMER_DV_DivideBy128 = 10, TIMER_DV_DivideBy1 = 11, -}; +} TIMER_DV; #include <pshpack1.h> typedef union _APIC_BASE_ADRESS_REGISTER @@ -220,7 +234,7 @@ typedef union _APIC_EXTENDED_CONTROL_REGISTER }; } APIC_EXTENDED_CONTROL_REGISTER; -typedef union _APIC_COMMAND_REGISTER +typedef union _APIC_INTERRUPT_COMMAND_REGISTER { UINT64 LongLong; struct @@ -237,12 +251,12 @@ typedef union _APIC_COMMAND_REGISTER UINT64 ReservedMBZ:1; UINT64 Level:1; UINT64 TriggerMode:1; - UINT64 RemoteReadStatus:2; + UINT64 RemoteReadStatus:2; /* Intel: Reserved */ UINT64 DestinationShortHand:2; UINT64 Reserved2MBZ:36; UINT64 Destination:8; }; -} APIC_COMMAND_REGISTER; +} APIC_INTERRUPT_COMMAND_REGISTER; typedef union _LVT_REGISTER { @@ -304,16 +318,16 @@ typedef union _IOAPIC_REDIRECTION_REGISTER FORCEINLINE ULONG -ApicRead(ULONG Offset) +ApicRead(APIC_REGISTER Register) { - return READ_REGISTER_ULONG((PULONG)(APIC_BASE + Offset)); + return READ_REGISTER_ULONG((PULONG)(APIC_BASE + Register)); } FORCEINLINE VOID -ApicWrite(ULONG Offset, ULONG Value) +ApicWrite(APIC_REGISTER Register, ULONG Value) { - WRITE_REGISTER_ULONG((PULONG)(APIC_BASE + Offset), Value); + WRITE_REGISTER_ULONG((PULONG)(APIC_BASE + Register), Value); } VOID diff --git a/hal/halx86/apic/apicsmp.c b/hal/halx86/apic/apicsmp.c new file mode 100644 index 00000000000..6379922dda9 --- /dev/null +++ b/hal/halx86/apic/apicsmp.c @@ -0,0 +1,96 @@ +/* + * PROJECT: ReactOS HAL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * FILE: hal/halx86/apic/apicsmp.c + * PURPOSE: SMP specific APIC code + * PROGRAMMERS: Copyright 2021 Timo Kreuzer (timo.kreuzer(a)reactos.org) + */ + +/* INCLUDES *******************************************************************/ + +#include <hal.h> +#include "apicp.h" +#define NDEBUG +#include <debug.h> + +/* INTERNAL FUNCTIONS *********************************************************/ + +/*! + \param Vector - Specifies the interrupt vector to be delivered. + + \param MessageType - Specifies the message type sent to the CPU core + interrupt handler. This can be one of the following values: + APIC_MT_Fixed - Delivers an interrupt to the target local APIC + specified in Destination field. + APIC_MT_LowestPriority - Delivers an interrupt to the local APIC + executing at the lowest priority of all local APICs. + APIC_MT_SMI - Delivers an SMI interrupt to target local APIC(s). + APIC_MT_RemoteRead - Delivers a read request to read an APIC register + in the target local APIC specified in Destination field. + APIC_MT_NMI - Delivers a non-maskable interrupt to the target local + APIC specified in the Destination field. Vector is ignored. + APIC_MT_INIT - Delivers an INIT request to the target local APIC(s) + specified in the Destination field. TriggerMode must be + APIC_TGM_Edge, Vector must be 0. + APIC_MT_Startup - Delivers a start-up request (SIPI) to the target + local APIC(s) specified in Destination field. Vector specifies + the startup address. + APIC_MT_ExtInt - Delivers an external interrupt to the target local + APIC specified in Destination field. + + \param TriggerMode - The trigger mode of the interrupt. Can be: + APIC_TGM_Edge - The interrupt is edge triggered. + APIC_TGM_Level - The interrupt is level triggered. + + \param DestinationShortHand - Specifies where to send the interrupt. + APIC_DSH_Destination + APIC_DSH_Self + APIC_DSH_AllIncludingSelf + APIC_DSH_AllExclusingSelf + + \see "AMD64 Architecture Programmer's Manual Volume 2 System Programming" + Chapter 16 "Advanced Programmable Interrupt Controller (APIC)" + 16.5 "Interprocessor Interrupts (IPI)" + + */ +FORCEINLINE +VOID +ApicRequestGlobalInterrupt( + _In_ UCHAR DestinationProcessor, + _In_ UCHAR Vector, + _In_ APIC_MT MessageType, + _In_ APIC_TGM TriggerMode, + _In_ APIC_DSH DestinationShortHand) +{ + APIC_INTERRUPT_COMMAND_REGISTER Icr; + + /* Setup the command register */ + Icr.LongLong = 0; + Icr.Vector = Vector; + Icr.MessageType = MessageType; + Icr.DestinationMode = APIC_DM_Physical; + Icr.DeliveryStatus = 0; + Icr.Level = 0; + Icr.TriggerMode = TriggerMode; + Icr.RemoteReadStatus = 0; + Icr.DestinationShortHand = DestinationShortHand; + Icr.Destination = DestinationProcessor; + + /* Write the low dword last to send the interrupt */ + ApicWrite(APIC_ICR1, Icr.Long1); + ApicWrite(APIC_ICR0, Icr.Long0); +} + + +/* SMP SUPPORT FUNCTIONS ******************************************************/ + +// Should be called by SMP version of HalRequestIpi +VOID +NTAPI +HalpRequestIpi(KAFFINITY TargetProcessors) +{ + UNIMPLEMENTED; + __debugbreak(); +} + +// APIC specific SMP code here
3 years, 6 months
1
0
0
0
[reactos] 01/01: [CSRSS] Fix MSVC AMD64 build
by George Bișoc
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e8277e51e2ec9c13721b6…
commit e8277e51e2ec9c13721b68cd8062b3b7d933d255 Author: George Bișoc <george.bisoc(a)reactos.org> AuthorDate: Fri Jun 25 12:42:02 2021 +0200 Commit: George Bișoc <george.bisoc(a)reactos.org> CommitDate: Fri Jun 25 12:42:02 2021 +0200 [CSRSS] Fix MSVC AMD64 build --- subsystems/win32/csrss/csrss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/subsystems/win32/csrss/csrss.c b/subsystems/win32/csrss/csrss.c index 7dd97df16c7..a4205d5f3b0 100644 --- a/subsystems/win32/csrss/csrss.c +++ b/subsystems/win32/csrss/csrss.c @@ -43,7 +43,9 @@ _main(int argc, { KPRIORITY BasePriority = (8 + 1) + 4; NTSTATUS Status; +#if defined (_X86_) ULONG Response; +#endif UNREFERENCED_PARAMETER(envp); UNREFERENCED_PARAMETER(DebugFlag);
3 years, 6 months
1
0
0
0
[reactos] 01/01: [CSRSS] Enable compilation of raise hard error function call code
by George Bișoc
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03636df1e31140ff17fee…
commit 03636df1e31140ff17fee89803941be1014e4db7 Author: George Bișoc <george.bisoc(a)reactos.org> AuthorDate: Fri Jun 25 11:55:35 2021 +0200 Commit: George Bișoc <george.bisoc(a)reactos.org> CommitDate: Fri Jun 25 11:55:35 2021 +0200 [CSRSS] Enable compilation of raise hard error function call code With introduction of 74e527b, a330b56 and subsequently 2791ecd ReactOS can now properly set IOPL (I/O privilege level) for user mode trusted processes. With that said, enable the compilation of raise hard error function call code back. --- subsystems/win32/csrss/csrss.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/subsystems/win32/csrss/csrss.c b/subsystems/win32/csrss/csrss.c index 7862d8f7a4d..7dd97df16c7 100644 --- a/subsystems/win32/csrss/csrss.c +++ b/subsystems/win32/csrss/csrss.c @@ -10,6 +10,7 @@ /* INCLUDES *******************************************************************/ #define NTOS_MODE_USER +#include <ndk/exfuncs.h> #include <ndk/psfuncs.h> #include <ndk/rtlfuncs.h> @@ -42,7 +43,7 @@ _main(int argc, { KPRIORITY BasePriority = (8 + 1) + 4; NTSTATUS Status; - //ULONG Response; // see the #if 0 + ULONG Response; UNREFERENCED_PARAMETER(envp); UNREFERENCED_PARAMETER(DebugFlag); @@ -62,14 +63,12 @@ _main(int argc, { /* Raise a hard error */ DPRINT1("CSRSS: Could not raise IOPL, Status: 0x%08lx\n", Status); -#if 0 Status = NtRaiseHardError(STATUS_IO_PRIVILEGE_FAILED, 0, 0, NULL, OptionOk, &Response); -#endif } #endif
3 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
23
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Results per page:
10
25
50
100
200