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
November 2017
----- 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
22 participants
186 discussions
Start a n
N
ew thread
[reactos] 01/01: [BROWSEUI] CISFBand: Add "Open Folder" feature
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e12763d5bc45a0a0fcf20…
commit e12763d5bc45a0a0fcf20c2898c1850e83516f85 Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Sat Nov 11 18:16:22 2017 +0300 [BROWSEUI] CISFBand: Add "Open Folder" feature CORE-13996 #resolve --- dll/win32/browseui/lang/bg-BG.rc | 1 + dll/win32/browseui/lang/de-DE.rc | 1 + dll/win32/browseui/lang/en-US.rc | 1 + dll/win32/browseui/lang/es-ES.rc | 1 + dll/win32/browseui/lang/fr-FR.rc | 1 + dll/win32/browseui/lang/he-IL.rc | 1 + dll/win32/browseui/lang/it-IT.rc | 1 + dll/win32/browseui/lang/ja-JP.rc | 1 + dll/win32/browseui/lang/pl-PL.rc | 1 + dll/win32/browseui/lang/pt-BR.rc | 1 + dll/win32/browseui/lang/ro-RO.rc | 1 + dll/win32/browseui/lang/ru-RU.rc | 1 + dll/win32/browseui/lang/sq-AL.rc | 1 + dll/win32/browseui/lang/tr-TR.rc | 1 + dll/win32/browseui/lang/uk-UA.rc | 1 + dll/win32/browseui/lang/zh-CN.rc | 1 + dll/win32/browseui/lang/zh-TW.rc | 1 + dll/win32/browseui/resource.h | 1 + dll/win32/browseui/shellbars/CISFBand.cpp | 20 ++++++++++++++++++++ 19 files changed, 38 insertions(+) diff --git a/dll/win32/browseui/lang/bg-BG.rc b/dll/win32/browseui/lang/bg-BG.rc index 3c926e1d70..8a269d8d6d 100644 --- a/dll/win32/browseui/lang/bg-BG.rc +++ b/dll/win32/browseui/lang/bg-BG.rc @@ -102,6 +102,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/de-DE.rc b/dll/win32/browseui/lang/de-DE.rc index ae7f85d518..eeb812102a 100644 --- a/dll/win32/browseui/lang/de-DE.rc +++ b/dll/win32/browseui/lang/de-DE.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/en-US.rc b/dll/win32/browseui/lang/en-US.rc index be6f51ae8c..29aabb6f56 100644 --- a/dll/win32/browseui/lang/en-US.rc +++ b/dll/win32/browseui/lang/en-US.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/es-ES.rc b/dll/win32/browseui/lang/es-ES.rc index 7003b588e6..420f350f3e 100644 --- a/dll/win32/browseui/lang/es-ES.rc +++ b/dll/win32/browseui/lang/es-ES.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/fr-FR.rc b/dll/win32/browseui/lang/fr-FR.rc index da07016e3f..90c89bab9c 100644 --- a/dll/win32/browseui/lang/fr-FR.rc +++ b/dll/win32/browseui/lang/fr-FR.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/he-IL.rc b/dll/win32/browseui/lang/he-IL.rc index dfb3dd7100..28a1d629f2 100644 --- a/dll/win32/browseui/lang/he-IL.rc +++ b/dll/win32/browseui/lang/he-IL.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/it-IT.rc b/dll/win32/browseui/lang/it-IT.rc index 7fa4e6f7a0..b8beedf2ca 100644 --- a/dll/win32/browseui/lang/it-IT.rc +++ b/dll/win32/browseui/lang/it-IT.rc @@ -102,6 +102,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ja-JP.rc b/dll/win32/browseui/lang/ja-JP.rc index def88114c6..2d73353080 100644 --- a/dll/win32/browseui/lang/ja-JP.rc +++ b/dll/win32/browseui/lang/ja-JP.rc @@ -120,6 +120,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/pl-PL.rc b/dll/win32/browseui/lang/pl-PL.rc index 8d5f6a6f5d..f1799d0d33 100644 --- a/dll/win32/browseui/lang/pl-PL.rc +++ b/dll/win32/browseui/lang/pl-PL.rc @@ -110,6 +110,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/pt-BR.rc b/dll/win32/browseui/lang/pt-BR.rc index 2915c1e8cf..a1147b38a6 100644 --- a/dll/win32/browseui/lang/pt-BR.rc +++ b/dll/win32/browseui/lang/pt-BR.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ro-RO.rc b/dll/win32/browseui/lang/ro-RO.rc index bbe6b76943..f026a96094 100644 --- a/dll/win32/browseui/lang/ro-RO.rc +++ b/dll/win32/browseui/lang/ro-RO.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/ru-RU.rc b/dll/win32/browseui/lang/ru-RU.rc index 593d685b83..2fa74fc922 100644 --- a/dll/win32/browseui/lang/ru-RU.rc +++ b/dll/win32/browseui/lang/ru-RU.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/sq-AL.rc b/dll/win32/browseui/lang/sq-AL.rc index 31d615019a..0decaa6937 100644 --- a/dll/win32/browseui/lang/sq-AL.rc +++ b/dll/win32/browseui/lang/sq-AL.rc @@ -121,6 +121,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/tr-TR.rc b/dll/win32/browseui/lang/tr-TR.rc index 86e6ed6d6a..1fe3b6fee6 100644 --- a/dll/win32/browseui/lang/tr-TR.rc +++ b/dll/win32/browseui/lang/tr-TR.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/uk-UA.rc b/dll/win32/browseui/lang/uk-UA.rc index 0cebd38376..ff49e59e97 100644 --- a/dll/win32/browseui/lang/uk-UA.rc +++ b/dll/win32/browseui/lang/uk-UA.rc @@ -104,6 +104,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/zh-CN.rc b/dll/win32/browseui/lang/zh-CN.rc index ca887e9670..7ab4cf42ff 100644 --- a/dll/win32/browseui/lang/zh-CN.rc +++ b/dll/win32/browseui/lang/zh-CN.rc @@ -122,6 +122,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/lang/zh-TW.rc b/dll/win32/browseui/lang/zh-TW.rc index 3889152c0c..cd9b4ef5fd 100644 --- a/dll/win32/browseui/lang/zh-TW.rc +++ b/dll/win32/browseui/lang/zh-TW.rc @@ -122,6 +122,7 @@ BEGIN MENUITEM "&Large Icons", IDM_LARGE_ICONS MENUITEM "&Small Icons", IDM_SMALL_ICONS END + MENUITEM "&Open Folder", IDM_OPEN_FOLDER MENUITEM "&Show Text", IDM_SHOW_TEXT END END diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index fbad0083f7..24303de229 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -69,6 +69,7 @@ #define IDM_SMALL_ICONS 2003 #define IDM_SHOW_TEXT 2004 #define IDM_VIEW_MENU 2005 +#define IDM_OPEN_FOLDER 2006 /* Random id for band close button, feel free to change it */ #define IDM_BASEBAR_CLOSE 0xA200 diff --git a/dll/win32/browseui/shellbars/CISFBand.cpp b/dll/win32/browseui/shellbars/CISFBand.cpp index 2ea32eb63a..042a10640e 100644 --- a/dll/win32/browseui/shellbars/CISFBand.cpp +++ b/dll/win32/browseui/shellbars/CISFBand.cpp @@ -600,6 +600,23 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent) if (FAILED_UNEXPECTEDLY(hr)) return hr; break; } + case IDM_OPEN_FOLDER: + { + SHELLEXECUTEINFO shexinfo; + + memset(&shexinfo, 0x0, sizeof(shexinfo)); + + shexinfo.cbSize = sizeof(shexinfo); + shexinfo.fMask = SEE_MASK_IDLIST; + shexinfo.lpVerb = _T("open"); + shexinfo.lpIDList = m_pidl; + shexinfo.nShow = SW_SHOW; + + if (!ShellExecuteEx(&shexinfo)) + return E_FAIL; + + break; + } case IDM_SHOW_TEXT: { if (m_textFlag) @@ -646,6 +663,9 @@ HRESULT CISFBand::CreateSimpleToolbar(HWND hWndParent) CheckMenuItem(qMenu, IDM_SMALL_ICONS, MF_UNCHECKED); } + if (_ILIsDesktop(m_pidl)) + DeleteMenu(qMenu, IDM_OPEN_FOLDER, MF_BYCOMMAND); + UINT idMax = Shell_MergeMenus(hmenu, GetSubMenu(qMenu, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); DestroyMenu(qMenu); return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1));
7 years, 1 month
1
0
0
0
[reactos] 01/01: [BROWSEUI] CBandSiteMenu: Show Toolbar error on failure
by Stanislav Motylkov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f01e6ed6c5fc7cfcf4801…
commit f01e6ed6c5fc7cfcf4801818431b43f4f3adbf1a Author: Stanislav Motylkov <x86corez(a)gmail.com> AuthorDate: Mon Nov 6 19:50:49 2017 +0300 [BROWSEUI] CBandSiteMenu: Show Toolbar error on failure --- dll/win32/browseui/lang/bg-BG.rc | 2 ++ dll/win32/browseui/lang/de-DE.rc | 2 ++ dll/win32/browseui/lang/en-US.rc | 2 ++ dll/win32/browseui/lang/es-ES.rc | 2 ++ dll/win32/browseui/lang/fr-FR.rc | 2 ++ dll/win32/browseui/lang/he-IL.rc | 2 ++ dll/win32/browseui/lang/it-IT.rc | 2 ++ dll/win32/browseui/lang/ja-JP.rc | 2 ++ dll/win32/browseui/lang/pl-PL.rc | 2 ++ dll/win32/browseui/lang/pt-BR.rc | 2 ++ dll/win32/browseui/lang/ro-RO.rc | 2 ++ dll/win32/browseui/lang/ru-RU.rc | 2 ++ dll/win32/browseui/lang/sq-AL.rc | 2 ++ dll/win32/browseui/lang/tr-TR.rc | 2 ++ dll/win32/browseui/lang/uk-UA.rc | 2 ++ dll/win32/browseui/lang/zh-CN.rc | 2 ++ dll/win32/browseui/lang/zh-TW.rc | 2 ++ dll/win32/browseui/resource.h | 2 ++ dll/win32/browseui/shellbars/CBandSiteMenu.cpp | 19 +++++++++++++++++-- dll/win32/browseui/shellbars/CBandSiteMenu.h | 1 + 20 files changed, 54 insertions(+), 2 deletions(-) diff --git a/dll/win32/browseui/lang/bg-BG.rc b/dll/win32/browseui/lang/bg-BG.rc index c76e5d3282..3c926e1d70 100644 --- a/dll/win32/browseui/lang/bg-BG.rc +++ b/dll/win32/browseui/lang/bg-BG.rc @@ -295,4 +295,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/de-DE.rc b/dll/win32/browseui/lang/de-DE.rc index d54f315047..ae7f85d518 100644 --- a/dll/win32/browseui/lang/de-DE.rc +++ b/dll/win32/browseui/lang/de-DE.rc @@ -314,4 +314,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/en-US.rc b/dll/win32/browseui/lang/en-US.rc index 98d6277a43..be6f51ae8c 100644 --- a/dll/win32/browseui/lang/en-US.rc +++ b/dll/win32/browseui/lang/en-US.rc @@ -313,4 +313,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/es-ES.rc b/dll/win32/browseui/lang/es-ES.rc index 3506c67d5f..7003b588e6 100644 --- a/dll/win32/browseui/lang/es-ES.rc +++ b/dll/win32/browseui/lang/es-ES.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/fr-FR.rc b/dll/win32/browseui/lang/fr-FR.rc index 8ceaf484eb..da07016e3f 100644 --- a/dll/win32/browseui/lang/fr-FR.rc +++ b/dll/win32/browseui/lang/fr-FR.rc @@ -313,4 +313,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/he-IL.rc b/dll/win32/browseui/lang/he-IL.rc index d324f74b16..dfb3dd7100 100644 --- a/dll/win32/browseui/lang/he-IL.rc +++ b/dll/win32/browseui/lang/he-IL.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/it-IT.rc b/dll/win32/browseui/lang/it-IT.rc index f780f846fd..7fa4e6f7a0 100644 --- a/dll/win32/browseui/lang/it-IT.rc +++ b/dll/win32/browseui/lang/it-IT.rc @@ -295,4 +295,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/ja-JP.rc b/dll/win32/browseui/lang/ja-JP.rc index 65e9003564..def88114c6 100644 --- a/dll/win32/browseui/lang/ja-JP.rc +++ b/dll/win32/browseui/lang/ja-JP.rc @@ -313,4 +313,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/pl-PL.rc b/dll/win32/browseui/lang/pl-PL.rc index 3e5f74be0d..8d5f6a6f5d 100644 --- a/dll/win32/browseui/lang/pl-PL.rc +++ b/dll/win32/browseui/lang/pl-PL.rc @@ -303,4 +303,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/pt-BR.rc b/dll/win32/browseui/lang/pt-BR.rc index 7fcd59962e..2915c1e8cf 100644 --- a/dll/win32/browseui/lang/pt-BR.rc +++ b/dll/win32/browseui/lang/pt-BR.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/ro-RO.rc b/dll/win32/browseui/lang/ro-RO.rc index b763155b41..bbe6b76943 100644 --- a/dll/win32/browseui/lang/ro-RO.rc +++ b/dll/win32/browseui/lang/ro-RO.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/ru-RU.rc b/dll/win32/browseui/lang/ru-RU.rc index 568cad6e01..593d685b83 100644 --- a/dll/win32/browseui/lang/ru-RU.rc +++ b/dll/win32/browseui/lang/ru-RU.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/sq-AL.rc b/dll/win32/browseui/lang/sq-AL.rc index 9296f7ee92..31d615019a 100644 --- a/dll/win32/browseui/lang/sq-AL.rc +++ b/dll/win32/browseui/lang/sq-AL.rc @@ -314,4 +314,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/tr-TR.rc b/dll/win32/browseui/lang/tr-TR.rc index f04cba1ddd..86e6ed6d6a 100644 --- a/dll/win32/browseui/lang/tr-TR.rc +++ b/dll/win32/browseui/lang/tr-TR.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/uk-UA.rc b/dll/win32/browseui/lang/uk-UA.rc index 80e832bf82..0cebd38376 100644 --- a/dll/win32/browseui/lang/uk-UA.rc +++ b/dll/win32/browseui/lang/uk-UA.rc @@ -297,4 +297,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/zh-CN.rc b/dll/win32/browseui/lang/zh-CN.rc index 5e7e970990..ca887e9670 100644 --- a/dll/win32/browseui/lang/zh-CN.rc +++ b/dll/win32/browseui/lang/zh-CN.rc @@ -315,4 +315,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/lang/zh-TW.rc b/dll/win32/browseui/lang/zh-TW.rc index c53ee3c1dd..3889152c0c 100644 --- a/dll/win32/browseui/lang/zh-TW.rc +++ b/dll/win32/browseui/lang/zh-TW.rc @@ -315,4 +315,6 @@ END STRINGTABLE BEGIN IDS_BROWSEFORNEWTOOLAR "Choose a folder" + IDS_TOOLBAR_ERR_TITLE "Toolbar" + IDS_TOOLBAR_ERR_TEXT "Cannot create toolbar." END diff --git a/dll/win32/browseui/resource.h b/dll/win32/browseui/resource.h index 0d376dac9d..fbad0083f7 100644 --- a/dll/win32/browseui/resource.h +++ b/dll/win32/browseui/resource.h @@ -109,6 +109,8 @@ #define IDS_NOTEXTLABELS 12304 #define IDS_SELECTIVETEXTONRIGHT 12305 #define IDS_BROWSEFORNEWTOOLAR 12387 +#define IDS_TOOLBAR_ERR_TITLE 12388 +#define IDS_TOOLBAR_ERR_TEXT 12389 #define IDS_GOBUTTONLABEL 12656 #define IDS_GOBUTTONTIPTEMPLATE 12657 #define IDS_SEARCHLABEL 12897 diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp index 0c56af463c..d94038987f 100644 --- a/dll/win32/browseui/shellbars/CBandSiteMenu.cpp +++ b/dll/win32/browseui/shellbars/CBandSiteMenu.cpp @@ -386,6 +386,21 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu( return MAKE_HRESULT(SEVERITY_SUCCESS, 0, USHORT(idMax - idCmdFirst +1)); } +HRESULT CBandSiteMenu::_ShowToolbarError(HRESULT hRet) +{ + WCHAR szText[260]; + WCHAR szTitle[256]; + + if (!LoadStringW(GetModuleHandleW(L"browseui.dll"), IDS_TOOLBAR_ERR_TEXT, szText, _countof(szText))) + StringCchCopyW(szText, _countof(szText), L"Cannot create toolbar."); + + if (!LoadStringW(GetModuleHandleW(L"browseui.dll"), IDS_TOOLBAR_ERR_TITLE, szTitle, _countof(szTitle))) + StringCchCopyW(szTitle, _countof(szTitle), L"Toolbar"); + + MessageBoxW(NULL, szText, szTitle, MB_OK | MB_ICONSTOP | MB_SETFOREGROUND); + return hRet; +} + HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici) { HRESULT hRet; @@ -429,11 +444,11 @@ HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpi CComPtr<IDeskBand> pDeskBand; hRet = _CreateBuiltInISFBand(uID, IID_PPV_ARG(IDeskBand, &pDeskBand)); if (FAILED_UNEXPECTEDLY(hRet)) - return hRet; + return _ShowToolbarError(hRet); hRet = m_BandSite->AddBand(pDeskBand); if (FAILED_UNEXPECTEDLY(hRet)) - return hRet; + return _ShowToolbarError(hRet); } return S_OK; } diff --git a/dll/win32/browseui/shellbars/CBandSiteMenu.h b/dll/win32/browseui/shellbars/CBandSiteMenu.h index 4e56fa998f..89d4e537fd 100644 --- a/dll/win32/browseui/shellbars/CBandSiteMenu.h +++ b/dll/win32/browseui/shellbars/CBandSiteMenu.h @@ -43,6 +43,7 @@ class CBandSiteMenu : UINT _GetMenuIdFromBand(CLSID *BandCLSID); UINT _GetBandIdFromClsid(CLSID* pclsid); UINT _GetBandIdForBuiltinISFBand(UINT uID); + HRESULT _ShowToolbarError(HRESULT hRet); public: CBandSiteMenu();
7 years, 1 month
1
0
0
0
[reactos] 01/01: [CDFS_NEW] _SEH2_FINALLY implement SEH support for real instead of its current stub. This notably fixes BSOD on media change
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f723d230a0bc4b7b78ca1…
commit f723d230a0bc4b7b78ca125abecce137bb96bed6 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Fri Nov 17 22:18:53 2017 +0100 [CDFS_NEW] _SEH2_FINALLY implement SEH support for real instead of its current stub. This notably fixes BSOD on media change --- drivers/filesystems/cdfs_new/allocsup.c | 6 ++-- drivers/filesystems/cdfs_new/cachesup.c | 6 ++-- drivers/filesystems/cdfs_new/cddata.c | 16 +++++----- drivers/filesystems/cdfs_new/cdprocs.h | 15 +++++----- drivers/filesystems/cdfs_new/cleanup.c | 12 ++++---- drivers/filesystems/cdfs_new/create.c | 26 ++++++++-------- drivers/filesystems/cdfs_new/deviosup.c | 20 ++++++------- drivers/filesystems/cdfs_new/dirctrl.c | 20 ++++++------- drivers/filesystems/cdfs_new/fileinfo.c | 36 +++++++++++------------ drivers/filesystems/cdfs_new/fsctrl.c | 34 ++++++++++----------- drivers/filesystems/cdfs_new/fspdisp.c | 8 ++--- drivers/filesystems/cdfs_new/lockctrl.c | 24 +++++++-------- drivers/filesystems/cdfs_new/read.c | 12 ++++---- drivers/filesystems/cdfs_new/strucsup.c | 26 ++++++++-------- drivers/filesystems/cdfs_new/verfysup.c | 8 ++--- drivers/filesystems/cdfs_new/volinfo.c | 6 ++-- drivers/filesystems/cdfs_new/wdk_wnet_to_ros.diff | 31 ------------------- 17 files changed, 138 insertions(+), 168 deletions(-) diff --git a/drivers/filesystems/cdfs_new/allocsup.c b/drivers/filesystems/cdfs_new/allocsup.c index b875eca143..93b35bcfda 100755 --- a/drivers/filesystems/cdfs_new/allocsup.c +++ b/drivers/filesystems/cdfs_new/allocsup.c @@ -149,7 +149,7 @@ Return Value: // Use a try finally to facilitate cleanup. // - try { + _SEH2_TRY { // // We use a loop to perform the lookup. If we don't find the mapping in the @@ -296,7 +296,7 @@ Return Value: FirstPass = FALSE; } - } finally { + } _SEH2_FINALLY { if (CleanupParent) { @@ -311,7 +311,7 @@ Return Value: } if (UnlockFcb) { CdUnlockFcb( IrpContext, Fcb ); } - } + } _SEH2_END; return; } diff --git a/drivers/filesystems/cdfs_new/cachesup.c b/drivers/filesystems/cdfs_new/cachesup.c index 87b75bbc51..600262f84a 100755 --- a/drivers/filesystems/cdfs_new/cachesup.c +++ b/drivers/filesystems/cdfs_new/cachesup.c @@ -94,7 +94,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Create the internal stream. The Vpb should be pointing at our volume @@ -272,7 +272,7 @@ Return Value: } } - } finally { + } _SEH2_FINALLY { // // Cleanup any dirent structures we may have used. @@ -306,7 +306,7 @@ Return Value: } CdUnlockFcb( IrpContext, Fcb ); - } + } _SEH2_END; return; } diff --git a/drivers/filesystems/cdfs_new/cddata.c b/drivers/filesystems/cdfs_new/cddata.c index dbd572a797..c8367233ab 100755 --- a/drivers/filesystems/cdfs_new/cddata.c +++ b/drivers/filesystems/cdfs_new/cddata.c @@ -259,7 +259,7 @@ Return Value: // Use a try-except to handle the exception cases. // - try { + _SEH2_TRY { // // If the IrpContext is NULL then this is the first pass through @@ -398,10 +398,10 @@ Return Value: CdCompleteRequest( IrpContext, Irp, Status ); } - } except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) { + } _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) { - Status = CdProcessException( IrpContext, Irp, GetExceptionCode() ); - } + Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() ); + } _SEH2_END; } while (Status == STATUS_CANT_WAIT); @@ -653,7 +653,7 @@ Return Value: // Note that (children of) CdFsdPostRequest can raise (Mdl allocation). // - try { + _SEH2_TRY { if (ExceptionCode == STATUS_CANT_WAIT) { @@ -670,10 +670,10 @@ Return Value: } } } - except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) { + _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) { - ExceptionCode = GetExceptionCode(); - } + ExceptionCode = _SEH2_GetExceptionCode(); + } _SEH2_END; // // If we posted the request or our caller will retry then just return here. diff --git a/drivers/filesystems/cdfs_new/cdprocs.h b/drivers/filesystems/cdfs_new/cdprocs.h index 921f523720..2b066e7192 100755 --- a/drivers/filesystems/cdfs_new/cdprocs.h +++ b/drivers/filesystems/cdfs_new/cdprocs.h @@ -22,6 +22,9 @@ Abstract: #include <ntddcdrm.h> #include <ntdddisk.h> #include <ntddscsi.h> +#ifdef __REACTOS__ +#include <pseh/pseh2.h> +#endif #ifndef INLINE #define INLINE __inline @@ -1881,16 +1884,14 @@ CdCommonPnp ( // Implemented in Pnp.c // // #define try_return(S) { S; goto try_exit; } // -/* ReactOS Change: Remove SEH */ -#define try -#define leave goto exitLabel; -#define finally if (0) goto exitLabel; exitLabel: -#define except(x) while (0) -#define GetExceptionCode() 0 -#define AbnormalTermination() 0 +#ifndef __REACTOS__ #define try_return(S) { S; goto try_exit; } #define try_leave(S) { S; leave; } +#else +#define try_return(S) { S; goto try_exit; } +#define try_leave(S) { S; _SEH2_LEAVE; } +#endif // diff --git a/drivers/filesystems/cdfs_new/cleanup.c b/drivers/filesystems/cdfs_new/cleanup.c index 4c621e5c2f..a89be2ffef 100755 --- a/drivers/filesystems/cdfs_new/cleanup.c +++ b/drivers/filesystems/cdfs_new/cleanup.c @@ -159,7 +159,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - //try { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ + _SEH2_TRY { // // Case on the type of open that we are trying to cleanup. @@ -279,7 +279,7 @@ Return Value: IoRemoveShareAccess( FileObject, &Fcb->ShareAccess ); - //} finally { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ + } _SEH2_FINALLY { CdReleaseFcb( IrpContext, Fcb ); @@ -287,7 +287,7 @@ Return Value: FsRtlNotifyVolumeEvent( FileObject, FSRTL_VOLUME_UNLOCK ); } - //} /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ + } _SEH2_END; // // If appropriate, try to spark teardown by purging the volume. Should @@ -305,19 +305,19 @@ Return Value: CdAcquireCdData( IrpContext); - try { + _SEH2_TRY { CdAcquireVcbExclusive( IrpContext, Vcb, FALSE ); VcbAcquired = TRUE; CdPurgeVolume( IrpContext, Vcb, FALSE ); - } finally { + } _SEH2_FINALLY { if (VcbAcquired) { CdReleaseVcb( IrpContext, Vcb ); } CdReleaseCdData( IrpContext); - } + } _SEH2_END; } // diff --git a/drivers/filesystems/cdfs_new/create.c b/drivers/filesystems/cdfs_new/create.c index bb072da107..3cab9b9ff9 100755 --- a/drivers/filesystems/cdfs_new/create.c +++ b/drivers/filesystems/cdfs_new/create.c @@ -357,7 +357,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Verify that the Vcb is not in an unusable condition. This routine @@ -901,7 +901,7 @@ Return Value: RelatedCcb )); try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { // // Cleanup the PathEntry if initialized. @@ -926,7 +926,7 @@ Return Value: // condition. // - if (AbnormalTermination()) { + if (_SEH2_AbnormalTermination()) { // @@ -985,7 +985,7 @@ Return Value: // CdCompleteRequest( IrpContext, Irp, Status ); - } + } _SEH2_END; return Status; } @@ -1512,7 +1512,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Go ahead and figure out the TypeOfOpen and NodeType. We can @@ -1905,7 +1905,7 @@ Return Value: } try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { if (UnlockVcb) { @@ -1921,7 +1921,7 @@ Return Value: CdCleanupCompoundPathEntry( IrpContext, &CompoundPathEntry ); } - } + } _SEH2_END; return Status; } @@ -2126,7 +2126,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Check the related Ccb to see if this was an OpenByFileId. @@ -2281,7 +2281,7 @@ Return Value: IrpSp->Parameters.Create.SecurityContext->DesiredAccess ); } - } finally { + } _SEH2_FINALLY { // // Unlock the Vcb if held. @@ -2300,7 +2300,7 @@ Return Value: CdReleaseFcb( IrpContext, ParentFcb ); } - } + } _SEH2_END; return Status; } @@ -2399,7 +2399,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Check if a version number was used to open this file. @@ -2569,7 +2569,7 @@ Return Value: CcbFlags, IrpSp->Parameters.Create.SecurityContext->DesiredAccess ); - } finally { + } _SEH2_FINALLY { // // Unlock the Vcb if held. @@ -2588,7 +2588,7 @@ Return Value: CdReleaseFcb( IrpContext, ParentFcb ); } - } + } _SEH2_END; return Status; } diff --git a/drivers/filesystems/cdfs_new/deviosup.c b/drivers/filesystems/cdfs_new/deviosup.c index 0c5c9d2bff..c12f1aa521 100755 --- a/drivers/filesystems/cdfs_new/deviosup.c +++ b/drivers/filesystems/cdfs_new/deviosup.c @@ -355,7 +355,7 @@ Return Value: // Use a try-finally to perform the final cleanup. // - try { + _SEH2_TRY { // // Loop while there are more bytes to transfer. @@ -518,7 +518,7 @@ Return Value: } try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { // // Perform final cleanup on the IoRuns if necessary. @@ -528,7 +528,7 @@ Return Value: CdFinishBuffers( IrpContext, IoRuns, CleanupRunCount, TRUE, FALSE ); } - } + } _SEH2_END; return Status; } @@ -624,7 +624,7 @@ Return Value: // Use a try-finally to perform the final cleanup. // - try { + _SEH2_TRY { // // If the initial offset lies within the RIFF header then copy the @@ -960,7 +960,7 @@ Return Value: KeFlushIoBuffers( IrpContext->Irp->MdlAddress, TRUE, FALSE ); try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { // // Perform final cleanup on the IoRuns if necessary. @@ -970,7 +970,7 @@ Return Value: CdFinishBuffers( IrpContext, IoRuns, CleanupRunCount, TRUE, FALSE ); } - } + } _SEH2_END; return Status; } @@ -1176,15 +1176,15 @@ Return Value: // deallocate the Mdl and return the appropriate "expected" status. // - try { + _SEH2_TRY { MmProbeAndLockPages( Mdl, IrpContext->Irp->RequestorMode, IoWriteAccess ); Status = STATUS_SUCCESS; - } except(EXCEPTION_EXECUTE_HANDLER) { + } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) { - Status = GetExceptionCode(); + Status = _SEH2_GetExceptionCode(); IoFreeMdl( Mdl ); IrpContext->Irp->MdlAddress = NULL; @@ -1193,7 +1193,7 @@ Return Value: Status = STATUS_INVALID_USER_BUFFER; } - } + } _SEH2_END; } // diff --git a/drivers/filesystems/cdfs_new/dirctrl.c b/drivers/filesystems/cdfs_new/dirctrl.c index 29265a844a..28cf0d51ea 100755 --- a/drivers/filesystems/cdfs_new/dirctrl.c +++ b/drivers/filesystems/cdfs_new/dirctrl.c @@ -287,7 +287,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Verify the Fcb is still good. @@ -499,7 +499,7 @@ Return Value: // such trickery. // - try { + _SEH2_TRY { // // Zero and initialize the base part of the current entry. @@ -715,7 +715,7 @@ Return Value: LastEntry = NextEntry; NextEntry = QuadAlign( Information ); - } except (EXCEPTION_EXECUTE_HANDLER) { + } _SEH2_EXCEPT (EXCEPTION_EXECUTE_HANDLER) { // // We had a problem filling in the user's buffer, so stop and @@ -724,13 +724,13 @@ Return Value: // Information = 0; - try_leave( Status = GetExceptionCode()); - } + try_leave( Status = _SEH2_GetExceptionCode()); + } _SEH2_END; } DoCcbUpdate = TRUE; - } finally { + } _SEH2_FINALLY { // // Cleanup our search context - *before* acquiring the FCB mutex exclusive, @@ -769,7 +769,7 @@ Return Value: // CdReleaseFile( IrpContext, Fcb ); - } + } _SEH2_END; // // Complete the request here. @@ -837,7 +837,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Verify the Vcb. @@ -862,14 +862,14 @@ Return Value: NULL, NULL ); - } finally { + } _SEH2_FINALLY { // // Release the Vcb. // CdReleaseVcb( IrpContext, IrpContext->Vcb ); - } + } _SEH2_END; // // Cleanup the IrpContext. diff --git a/drivers/filesystems/cdfs_new/fileinfo.c b/drivers/filesystems/cdfs_new/fileinfo.c index b4a185a98a..ca2205869d 100755 --- a/drivers/filesystems/cdfs_new/fileinfo.c +++ b/drivers/filesystems/cdfs_new/fileinfo.c @@ -165,7 +165,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // We only support query on file and directory handles. @@ -325,7 +325,7 @@ Return Value: Irp->IoStatus.Information = IrpSp->Parameters.QueryFile.Length - Length; - } finally { + } _SEH2_FINALLY { // // Release the file. @@ -335,7 +335,7 @@ Return Value: CdReleaseFile( IrpContext, Fcb ); } - } + } _SEH2_END; // // Complete the request if we didn't raise. @@ -406,7 +406,7 @@ Return Value: CdAcquireFileShared( IrpContext, Fcb ); - try { + _SEH2_TRY { // // Make sure the Fcb is in a usable condition. This @@ -445,10 +445,10 @@ Return Value: Status = STATUS_SUCCESS; try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { CdReleaseFile( IrpContext, Fcb ); - } + } _SEH2_END; // // Complete the request if there was no raise. @@ -536,7 +536,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Only deal with 'good' Fcb's. @@ -566,12 +566,12 @@ Return Value: Result = TRUE; } - } finally { + } _SEH2_FINALLY { ExReleaseResourceLite( Fcb->Resource ); FsRtlExitFileSystem(); - } + } _SEH2_END; return Result; } @@ -654,7 +654,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Only deal with 'good' Fcb's. @@ -694,12 +694,12 @@ Return Value: Result = TRUE; } - } finally { + } _SEH2_FINALLY { ExReleaseResourceLite( Fcb->Resource ); FsRtlExitFileSystem(); - } + } _SEH2_END; return Result; } @@ -782,7 +782,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Only deal with 'good' Fcb's. @@ -827,12 +827,12 @@ Return Value: Result = TRUE; } - } finally { + } _SEH2_FINALLY { ExReleaseResourceLite( Fcb->Resource ); FsRtlExitFileSystem(); - } + } _SEH2_END; return Result; } @@ -1278,7 +1278,7 @@ Return Value: // Use a try-finally to cleanup the structures. // - try { + _SEH2_TRY { ParentFcb = Fcb->ParentFcb; CdAcquireFileShared( IrpContext, ParentFcb ); @@ -1396,7 +1396,7 @@ Return Value: RtlCopyMemory( Buffer->FileName, ShortNameBuffer, Buffer->FileNameLength ); try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { if (CleanupFileLookup) { @@ -1413,7 +1413,7 @@ Return Value: CdReleaseFile( IrpContext, ParentFcb ); } - } + } _SEH2_END; // // Reduce the available bytes by the amount stored into this buffer. diff --git a/drivers/filesystems/cdfs_new/fsctrl.c b/drivers/filesystems/cdfs_new/fsctrl.c index 74b6c63839..cfa3e8b8ac 100755 --- a/drivers/filesystems/cdfs_new/fsctrl.c +++ b/drivers/filesystems/cdfs_new/fsctrl.c @@ -723,7 +723,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Allocate a buffer to query the TOC. @@ -1058,7 +1058,7 @@ Return Value: Status = STATUS_SUCCESS; - } finally { + } _SEH2_FINALLY { // // Free the TOC buffer if not in the Vcb. @@ -1082,7 +1082,7 @@ Return Value: // If we are not mounting the device, then set the verify bit again. // - if ((AbnormalTermination() || (Status != STATUS_SUCCESS)) && + if ((_SEH2_AbnormalTermination() || (Status != STATUS_SUCCESS)) && SetDoVerifyOnFail) { CdMarkRealDevForVerify( IrpContext->RealDevice); @@ -1119,7 +1119,7 @@ Return Value: // CdReleaseCdData( IrpContext ); - } + } _SEH2_END; // // Now send mount notification. @@ -1221,7 +1221,7 @@ Return Value: CdAcquireCdData( IrpContext ); - try { + _SEH2_TRY { CdAcquireVcbExclusive( IrpContext, Vcb, FALSE ); ReleaseVcb = TRUE; @@ -1545,7 +1545,7 @@ Return Value: } } - } finally { + } _SEH2_FINALLY { // // Free the TOC buffer if allocated. @@ -1567,7 +1567,7 @@ Return Value: } CdReleaseCdData( IrpContext ); - } + } _SEH2_END; // // Now send mount notification. @@ -1692,7 +1692,7 @@ Return Value: // Use a try finally to free the Fcb. // - try { + _SEH2_TRY { // // Verify the Fcb. @@ -1722,14 +1722,14 @@ Return Value: Irp = NULL; - } finally { + } _SEH2_FINALLY { // // Release all of our resources // CdReleaseFcb( IrpContext, Fcb ); - } + } _SEH2_END; // // Complete the request if there was no exception. @@ -1804,7 +1804,7 @@ Return Value: Vcb = Fcb->Vcb; CdAcquireVcbExclusive( IrpContext, Vcb, FALSE ); - try { + _SEH2_TRY { // // Verify the Vcb. @@ -1814,7 +1814,7 @@ Return Value: Status = CdLockVolumeInternal( IrpContext, Vcb, IrpSp->FileObject ); - } finally { + } _SEH2_FINALLY { // // Release the Vcb. @@ -1822,11 +1822,11 @@ Return Value: CdReleaseVcb( IrpContext, Vcb ); - if (AbnormalTermination() || !NT_SUCCESS( Status )) { + if (_SEH2_AbnormalTermination() || !NT_SUCCESS( Status )) { FsRtlNotifyVolumeEvent( IrpSp->FileObject, FSRTL_VOLUME_LOCK_FAILED ); } - } + } _SEH2_END; // // Complete the request if there haven't been any exceptions. @@ -2635,7 +2635,7 @@ Return Value: // Check for whether this device supports XA and multi-session. // - try { + _SEH2_TRY { // // Allocate a buffer for the last session information. @@ -2713,10 +2713,10 @@ Return Value: ThisPass += 1; } - } finally { + } _SEH2_FINALLY { if (CdromToc != NULL) { CdFreePool( &CdromToc ); } - } + } _SEH2_END; } // diff --git a/drivers/filesystems/cdfs_new/fspdisp.c b/drivers/filesystems/cdfs_new/fspdisp.c index a3b89b96cf..da685e2203 100755 --- a/drivers/filesystems/cdfs_new/fspdisp.c +++ b/drivers/filesystems/cdfs_new/fspdisp.c @@ -94,7 +94,7 @@ Return Value: while (TRUE) { - try { + _SEH2_TRY { // // Reinitialize for the next try at completing this @@ -184,10 +184,10 @@ Return Value: CdCompleteRequest( IrpContext, Irp, Status ); } - } except( CdExceptionFilter( IrpContext, GetExceptionInformation() )) { + } _SEH2_EXCEPT( CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) { - Status = CdProcessException( IrpContext, Irp, GetExceptionCode() ); - } + Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() ); + } _SEH2_END; // // Break out of the loop if we didn't get CANT_WAIT. diff --git a/drivers/filesystems/cdfs_new/lockctrl.c b/drivers/filesystems/cdfs_new/lockctrl.c index 149d4ecb5c..961c3be6e9 100755 --- a/drivers/filesystems/cdfs_new/lockctrl.c +++ b/drivers/filesystems/cdfs_new/lockctrl.c @@ -224,7 +224,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // We check whether we can proceed based on the state of the file oplocks. @@ -275,10 +275,10 @@ Return Value: } try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { FsRtlExitFileSystem(); - } + } _SEH2_END; return Results; } @@ -366,7 +366,7 @@ Return Value: FsRtlEnterFileSystem(); - try { + _SEH2_TRY { // // We check whether we can proceed based on the state of the file oplocks. @@ -416,10 +416,10 @@ Return Value: } try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { FsRtlExitFileSystem(); - } + } _SEH2_END; return Results; } @@ -498,7 +498,7 @@ Return Value: FsRtlEnterFileSystem(); - try { + _SEH2_TRY { // // We check whether we can proceed based on the state of the file oplocks. @@ -539,10 +539,10 @@ Return Value: CdUnlockFcb( IrpContext, Fcb ); try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { FsRtlExitFileSystem(); - } + } _SEH2_END; return Results; } @@ -624,7 +624,7 @@ Return Value: FsRtlEnterFileSystem(); - try { + _SEH2_TRY { // // We check whether we can proceed based on the state of the file oplocks. @@ -666,10 +666,10 @@ Return Value: CdUnlockFcb( IrpContext, Fcb ); try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { FsRtlExitFileSystem(); - } + } _SEH2_END; return Results; } diff --git a/drivers/filesystems/cdfs_new/read.c b/drivers/filesystems/cdfs_new/read.c index cadf3c464f..b32b13b824 100755 --- a/drivers/filesystems/cdfs_new/read.c +++ b/drivers/filesystems/cdfs_new/read.c @@ -35,11 +35,11 @@ Abstract: // #define SafeZeroMemory(IC,AT,BYTE_COUNT) { \ - try { \ + _SEH2_TRY { \ RtlZeroMemory( (AT), (BYTE_COUNT) ); \ - } except( EXCEPTION_EXECUTE_HANDLER ) { \ + } _SEH2_EXCEPT( EXCEPTION_EXECUTE_HANDLER ) { \ CdRaiseStatus( IC, STATUS_INVALID_USER_BUFFER ); \ - } \ + } _SEH2_END; \ } // @@ -180,7 +180,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Verify the Fcb. Allow reads if this is a DASD handle that is @@ -515,7 +515,7 @@ Return Value: } try_exit: NOTHING; - } finally { + } _SEH2_FINALLY { // // Release the Fcb. @@ -525,7 +525,7 @@ Return Value: CdReleaseFile( IrpContext, Fcb ); } - } + } _SEH2_END; // // Post the request if we got CANT_WAIT. diff --git a/drivers/filesystems/cdfs_new/strucsup.c b/drivers/filesystems/cdfs_new/strucsup.c index 3439b73000..7ab3b2a0e7 100755 --- a/drivers/filesystems/cdfs_new/strucsup.c +++ b/drivers/filesystems/cdfs_new/strucsup.c @@ -298,19 +298,19 @@ Return Value: // uninitialize the notify structures before returning. // - try { + _SEH2_TRY { Vcb->SwapVpb = FsRtlAllocatePoolWithTag( NonPagedPool, sizeof( VPB ), TAG_VPB ); } - finally { + _SEH2_FINALLY { - if (AbnormalTermination()) { + if (_SEH2_AbnormalTermination()) { FsRtlNotifyUninitializeSync( &Vcb->NotifySync ); } - } + } _SEH2_END; // // Nothing beyond this point should raise. @@ -456,7 +456,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Copy the block size and compute the various block masks. @@ -843,10 +843,10 @@ Return Value: SetFlag( Vcb->VcbState, VCB_STATE_ISO ); } - } finally { + } _SEH2_FINALLY { if (UnlockVcb) { CdUnlockVcb( IrpContext, Vcb ); } - } + } _SEH2_END; } @@ -1238,7 +1238,7 @@ Return Value: CdLockFcb( IrpContext, Fcb ); - try { + _SEH2_TRY { // // Initialize the common header in the Fcb. The node type is already @@ -1361,10 +1361,10 @@ Return Value: CdInsertFcbTable( IrpContext, Fcb ); SetFlag( Fcb->FcbState, FCB_STATE_IN_FCB_TABLE ); - } finally { + } _SEH2_FINALLY { CdUnlockFcb( IrpContext, Fcb ); - } + } _SEH2_END; return; } @@ -1937,7 +1937,7 @@ Return Value: // Use a try-finally to safely clear the top-level field. // - try { + _SEH2_TRY { // // Loop until we find an Fcb we can't remove. @@ -2041,7 +2041,7 @@ Return Value: } while (CurrentFcb != NULL); - } finally { + } _SEH2_FINALLY { // // Release the current Fcb if we have acquired it. @@ -2057,7 +2057,7 @@ Return Value: // ClearFlag( IrpContext->TopLevel->Flags, IRP_CONTEXT_FLAG_IN_TEARDOWN ); - } + } _SEH2_END; *RemovedStartingFcb = (CurrentFcb != StartingFcb); return; diff --git a/drivers/filesystems/cdfs_new/verfysup.c b/drivers/filesystems/cdfs_new/verfysup.c index 24c671afc2..fc130d872b 100755 --- a/drivers/filesystems/cdfs_new/verfysup.c +++ b/drivers/filesystems/cdfs_new/verfysup.c @@ -92,7 +92,7 @@ Return Value: Vcb = &CONTAINING_RECORD( IrpSp->DeviceObject, VOLUME_DEVICE_OBJECT, DeviceObject )->Vcb; - try { + _SEH2_TRY { // // Send down the verify FSCTL. Note that this is sent to the @@ -206,7 +206,7 @@ Return Value: Status = CdFsdPostRequest( IrpContext, Irp ); } - } except(CdExceptionFilter( IrpContext, GetExceptionInformation() )) { + } _SEH2_EXCEPT(CdExceptionFilter( IrpContext, _SEH2_GetExceptionInformation() )) { // // We had some trouble trying to perform the verify or raised @@ -214,8 +214,8 @@ Return Value: // the error status that we get back from the exception code. // - Status = CdProcessException( IrpContext, Irp, GetExceptionCode() ); - } + Status = CdProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() ); + } _SEH2_END; return Status; } diff --git a/drivers/filesystems/cdfs_new/volinfo.c b/drivers/filesystems/cdfs_new/volinfo.c index d0962fb4b8..b215fe081b 100755 --- a/drivers/filesystems/cdfs_new/volinfo.c +++ b/drivers/filesystems/cdfs_new/volinfo.c @@ -130,7 +130,7 @@ Return Value: // Use a try-finally to facilitate cleanup. // - try { + _SEH2_TRY { // // Verify the Vcb. @@ -177,14 +177,14 @@ Return Value: Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length; - } finally { + } _SEH2_FINALLY { // // Release the Vcb. // CdReleaseVcb( IrpContext, Fcb->Vcb ); - } + } _SEH2_END; // // Complete the request if we didn't raise. diff --git a/drivers/filesystems/cdfs_new/wdk_wnet_to_ros.diff b/drivers/filesystems/cdfs_new/wdk_wnet_to_ros.diff index cc84eb55c2..f6144dd1d9 100644 --- a/drivers/filesystems/cdfs_new/wdk_wnet_to_ros.diff +++ b/drivers/filesystems/cdfs_new/wdk_wnet_to_ros.diff @@ -805,37 +805,6 @@ Index: drivers/filesystems/cdfs_new/lockctrl.c CdFastUnlockAllByKey ( IN PFILE_OBJECT FileObject, PVOID ProcessId, -Index: drivers/filesystems/cdfs_new/cleanup.c -=================================================================== ---- drivers/filesystems/cdfs_new/cleanup.c (revision 34615) -+++ drivers/filesystems/cdfs_new/cleanup.c (working copy) -@@ -159,7 +159,7 @@ - // Use a try-finally to facilitate cleanup. - // - -- try { -+ //try { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ - - // - // Case on the type of open that we are trying to cleanup. -@@ -279,7 +279,7 @@ - - IoRemoveShareAccess( FileObject, &Fcb->ShareAccess ); - -- } finally { -+ //} finally { /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ - - CdReleaseFcb( IrpContext, Fcb ); - -@@ -287,7 +287,7 @@ - - FsRtlNotifyVolumeEvent( FileObject, FSRTL_VOLUME_UNLOCK ); - } -- } -+ //} /* ReactOS Change: Manual removal of SEH since macros to hack around it don't allow multiple SEH usage within one function */ - - // - // If appropriate, try to spark teardown by purging the volume. Should Index: drivers/filesystems/cdfs_new/strucsup.c =================================================================== --- drivers/filesystems/cdfs_new/strucsup.c (revision 34615)
7 years, 1 month
1
0
0
0
[reactos] 01/01: README.md: Add "Tweet" button
by Alexander Shaposhnikov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=519620ce6167121751240…
commit 519620ce6167121751240e885a1156165f1f7b7d Author: Alexander Shaposhnikov <sanchaez(a)reactos.org> AuthorDate: Fri Nov 17 22:15:46 2017 +0200 README.md: Add "Tweet" button --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a16f2699ac..6e0cce2fd1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# ReactOS Project [![release.badge]][release.link] [![sfstats.badge]][sfstats.link] [![travis.badge]][travis.link] [![appveyor.badge]][appveyor.link] +# ReactOS Project [![tweetme.badge]][tweetme.link] [![release.badge]][release.link] [![sfstats.badge]][sfstats.link] [![travis.badge]][travis.link] [![appveyor.badge]][appveyor.link] <p align=center> -<img src="
https://reactos.org/wiki/images/0/02/ReactOS_logo.png
"> + <img src="
https://reactos.org/wiki/images/0/02/ReactOS_logo.png
"> </p> [![license.badge]][license.link] [![ghcontrib.badge]][ghcontrib.link] [![ghstats.badge]][ghstats.link] [![commits.badge]][commits.link] [![coverity.badge]][coverity.link] -## Quick Links +## Quick Links - [Website](https://reactos.org) - [
Wiki](https://reactos.org/wiki)
@@ -98,6 +98,7 @@ There is also an obsolete [SVN archive
repository](https://svn.reactos.org/svn/r
[ghcontrib.badge]:
https://img.shields.io/github/contributors/reactos/reactos.svg
[rosbewin.badge]:
https://img.shields.io/badge/RosBE_Windows-2.1.5-blue.svg
[rosbeunix.badge]:
https://img.shields.io/badge/RosBE_Unix-2.1.2-blue.svg
+[tweetme.badge]:
https://img.shields.io/twitter/url/http/shields.io.svg?style=social
[travis.link]:
https://travis-ci.org/reactos/reactos
[appveyor.link]:
https://ci.appveyor.com/project/AmineKhaldi/reactos
@@ -110,3 +111,4 @@ There is also an obsolete [SVN archive
repository](https://svn.reactos.org/svn/r
[ghcontrib.link]:
https://github.com/reactos/reactos/graphs/contributors
[rosbewin.link]:
https://sourceforge.net/projects/reactos/files/RosBE-Windows/i386/2.1.5/
[rosbeunix.link]:
https://sourceforge.net/projects/reactos/files/RosBE-Unix/2.1.2/
+[tweetme.link]:
https://twitter.com/intent/tweet?text=Check%20out%20ReactOS%20-%20Free%20an…
7 years, 1 month
1
0
0
0
[reactos] 02/02: [OPENGL32] Allocate thread data in IntMakeCurrent if it is not allocated yet. CORE-12232
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=64d10228ee1fea0f11873…
commit 64d10228ee1fea0f118735d812cf6bed7fbac1c0 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Nov 5 21:24:31 2017 +0100 [OPENGL32] Allocate thread data in IntMakeCurrent if it is not allocated yet. CORE-12232 --- dll/opengl/opengl32/dllmain.c | 24 +++++++++++++++++------- dll/opengl/opengl32/opengl32.h | 11 +++++++++++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/dll/opengl/opengl32/dllmain.c b/dll/opengl/opengl32/dllmain.c index 9d4ced2114..dae16d28c9 100644 --- a/dll/opengl/opengl32/dllmain.c +++ b/dll/opengl/opengl32/dllmain.c @@ -9,6 +9,22 @@ #ifdef OPENGL32_USE_TLS DWORD OglTlsIndex = 0xFFFFFFFF; + +BOOL init_tls_data(void) +{ + struct Opengl32_ThreadData* ThreadData; + + ThreadData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ThreadData)); + if(!ThreadData) + return FALSE; + TlsSetValue(OglTlsIndex, ThreadData); + ThreadData->glDispatchTable = &StubTable.glDispatchTable; + ThreadData->hglrc = NULL; + ThreadData->hdc = NULL; + ThreadData->dc_data = NULL; + return TRUE; +} + #endif BOOL WINAPI @@ -30,14 +46,8 @@ DllMain(HINSTANCE hInstance, DWORD Reason, LPVOID Reserved) /* no break */ case DLL_THREAD_ATTACH: #ifdef OPENGL32_USE_TLS - ThreadData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*ThreadData)); - if(!ThreadData) + if (!init_tls_data()) return FALSE; - TlsSetValue(OglTlsIndex, ThreadData); - ThreadData->glDispatchTable = &StubTable.glDispatchTable; - ThreadData->hglrc = NULL; - ThreadData->hdc = NULL; - ThreadData->dc_data = NULL; #else NtCurrentTeb()->glTable = &StubTable.glDispatchTable; #endif // defined(OPENGL32_USE_TLS) diff --git a/dll/opengl/opengl32/opengl32.h b/dll/opengl/opengl32/opengl32.h index 68e5a86672..0aadd6782a 100644 --- a/dll/opengl/opengl32/opengl32.h +++ b/dll/opengl/opengl32/opengl32.h @@ -121,11 +121,22 @@ struct Opengl32_ThreadData }; C_ASSERT(FIELD_OFFSET(struct Opengl32_ThreadData, glDispatchTable) == 0); +/* dllmain.c */ +BOOL init_tls_data(void); + static inline void IntMakeCurrent(HGLRC hglrc, HDC hdc, struct wgl_dc_data* dc_data) { struct Opengl32_ThreadData* thread_data = TlsGetValue(OglTlsIndex); + if (!thread_data) + { + OutputDebugStringA("Calling init_tls_data from IntMakeCurrent\n"); + if (!init_tls_data()) + OutputDebugStringA("init_tls_data failed, brace for impact...\n"); + + thread_data = TlsGetValue(OglTlsIndex); + } thread_data->hglrc = hglrc; thread_data->hdc = hdc;
7 years, 1 month
1
0
0
0
[reactos] 01/02: [OPENGL32] Do not crash in IntGetCurrentDC if thread data was not allocated. CORE-12232
by Mark Jansen
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa9ce98d8e19526200e8c…
commit fa9ce98d8e19526200e8c38dd5e418ddee14b692 Author: Mark Jansen <mark.jansen(a)reactos.org> AuthorDate: Sun Nov 5 21:23:55 2017 +0100 [OPENGL32] Do not crash in IntGetCurrentDC if thread data was not allocated. CORE-12232 --- dll/opengl/opengl32/opengl32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dll/opengl/opengl32/opengl32.h b/dll/opengl/opengl32/opengl32.h index b3e0bd08f8..68e5a86672 100644 --- a/dll/opengl/opengl32/opengl32.h +++ b/dll/opengl/opengl32/opengl32.h @@ -154,7 +154,7 @@ HDC IntGetCurrentDC(void) { struct Opengl32_ThreadData* data = TlsGetValue(OglTlsIndex); - return data->hdc; + return data ? data->hdc : NULL; } static inline
7 years, 1 month
1
0
0
0
[reactos] 01/01: [COMCTL32] Implement using different image list images depending on the button state
by Giannis Adamopoulos
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=a4ea17218f3062e7089d5…
commit a4ea17218f3062e7089d5913985473f78f284cbf Author: Giannis Adamopoulos <gadamopoulos(a)reactos.org> AuthorDate: Fri Nov 17 14:00:30 2017 +0200 [COMCTL32] Implement using different image list images depending on the button state --- dll/win32/comctl32/button.c | 21 +++-- dll/win32/comctl32/theme_button.c | 179 +++++--------------------------------- 2 files changed, 39 insertions(+), 161 deletions(-) diff --git a/dll/win32/comctl32/button.c b/dll/win32/comctl32/button.c index eb627145f3..bdc91840d5 100644 --- a/dll/win32/comctl32/button.c +++ b/dll/win32/comctl32/button.c @@ -395,10 +395,10 @@ cleanup: return ret; } -BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc) +BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc, int index) { SIZE ImageSize; - int left, top; + int left, top, count; if (!pimlData->himl) return FALSE; @@ -436,8 +436,17 @@ BOOL BUTTON_DrawIml(HDC hDC, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCa top = prc->top + (prc->bottom - prc->top - ImageSize.cy) / 2; } - if (!bOnlyCalc) - ImageList_Draw(pimlData->himl, 0, hDC, left, top, 0); + if (bOnlyCalc) + return TRUE; + + count = ImageList_GetImageCount(pimlData->himl); + + if (count == 1) + index = 0; + else if (index >= count) + return TRUE; + + ImageList_Draw(pimlData->himl, index, hDC, left, top, 0); return TRUE; } @@ -1220,7 +1229,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) #endif #ifndef _USER32_ - BOOL bHasIml = BUTTON_DrawIml(hdc, &pdata->imlData, &r, TRUE); + BOOL bHasIml = BUTTON_DrawIml(hdc, &pdata->imlData, &r, TRUE, 0); #endif /* Calculate label rectangle according to label type */ @@ -1378,7 +1387,7 @@ static void BUTTON_DrawLabel(HWND hwnd, HDC hdc, UINT dtFlags, RECT *rc) #ifndef _USER32_ PBUTTON_DATA pdata = _GetButtonData(hwnd); - BUTTON_DrawIml(hdc, &pdata->imlData, rc, FALSE); + BUTTON_DrawIml(hdc, &pdata->imlData, rc, FALSE, 0); #endif if ((style & BS_PUSHLIKE) && (state & BST_INDETERMINATE)) diff --git a/dll/win32/comctl32/theme_button.c b/dll/win32/comctl32/theme_button.c index 9b85183799..755f4a7f06 100644 --- a/dll/win32/comctl32/theme_button.c +++ b/dll/win32/comctl32/theme_button.c @@ -28,9 +28,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(theme_button); typedef enum { STATE_NORMAL, - STATE_DISABLED, STATE_HOT, STATE_PRESSED, + STATE_DISABLED, STATE_DEFAULTED } ButtonState; @@ -56,7 +56,7 @@ static inline LONG_PTR get_button_image(HWND hwnd) return _GetButtonData(hwnd)->image; } -BOOL BUTTON_DrawIml(HDC hdc, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc); +BOOL BUTTON_DrawIml(HDC hdc, BUTTON_IMAGELIST *pimlData, RECT *prc, BOOL bOnlyCalc, int index); DWORD BUTTON_SendCustomDraw(HWND hwnd, HDC hDC, DWORD dwDrawStage, RECT* prc); #endif @@ -113,7 +113,7 @@ static inline WCHAR *get_button_text(HWND hwnd) static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag) { - static const int states[] = { PBS_NORMAL, PBS_DISABLED, PBS_HOT, PBS_PRESSED, PBS_DEFAULTED }; + static const int states[] = { PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED, PBS_DEFAULTED }; RECT bgRect, textRect; HFONT font = get_button_font(hwnd); @@ -150,7 +150,7 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN if (cdrf == CDRF_SKIPDEFAULT) goto cleanup; - BUTTON_DrawIml(hDC, &pdata->imlData, &textRect, FALSE); + BUTTON_DrawIml(hDC, &pdata->imlData, &textRect, FALSE, drawState); text = get_button_text(hwnd); if (text) @@ -185,15 +185,15 @@ static void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN { static const int cb_states[3][5] = { - { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDNORMAL }, - { CBS_CHECKEDNORMAL, CBS_CHECKEDDISABLED, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDNORMAL }, - { CBS_MIXEDNORMAL, CBS_MIXEDDISABLED, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDNORMAL } + { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDNORMAL }, + { CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED, CBS_CHECKEDNORMAL }, + { CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED, CBS_MIXEDNORMAL } }; static const int rb_states[2][5] = { - { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDNORMAL }, - { RBS_CHECKEDNORMAL, RBS_CHECKEDDISABLED, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDNORMAL } + { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDNORMAL }, + { RBS_CHECKEDNORMAL, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDDISABLED, RBS_CHECKEDNORMAL } }; SIZE sz; @@ -307,7 +307,7 @@ static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN static void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused) #endif { - static const int states[] = { GBS_NORMAL, GBS_DISABLED, GBS_NORMAL, GBS_NORMAL, GBS_NORMAL }; + static const int states[] = { GBS_NORMAL, GBS_NORMAL, GBS_NORMAL, GBS_DISABLED, GBS_NORMAL }; RECT bgRect, textRect, contentRect; int state = states[ drawState ]; @@ -415,30 +415,20 @@ static const pfThemedPaint btnThemedPaintFunc[BUTTON_TYPE + 1] = NULL, /* Not defined */ }; -#ifdef __REACTOS__ /* r73873 */ BOOL BUTTON_PaintWithTheme(HTHEME theme, HWND hwnd, HDC hParamDC, LPARAM prfFlag) -#else -static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC) -#endif { -#ifdef __REACTOS__ /* r73873, r73897 and r74120 */ DWORD dwStyle; DWORD dwStyleEx; DWORD type; UINT dtFlags; int state; -#else - PAINTSTRUCT ps; - HDC hDC; - DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE); - DWORD dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); - UINT dtFlags = get_drawtext_flags(dwStyle, dwStyleEx); - int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); -#endif ButtonState drawState; -#ifdef __REACTOS__ /* r73873, r73897, r73907 and r74120 */ pfThemedPaint paint; + /* Don't draw with themes on a button with BS_ICON or BS_BITMAP */ + if (get_button_image(hwnd) != 0) + return FALSE; + dwStyle = GetWindowLongW(hwnd, GWL_STYLE); type = dwStyle & BUTTON_TYPE; @@ -449,144 +439,23 @@ static BOOL BUTTON_Paint(HTHEME theme, HWND hwnd, HDC hParamDC) if (!paint) return FALSE; - if (get_button_image(hwnd) != 0) - return FALSE; - dwStyleEx = GetWindowLongW(hwnd, GWL_EXSTYLE); dtFlags = get_drawtext_flags(dwStyle, dwStyleEx); state = get_button_state(hwnd); -#else - pfThemedPaint paint = btnThemedPaintFunc[ dwStyle & BUTTON_TYPE ]; -#endif - if(IsWindowEnabled(hwnd)) - { - if(state & BST_PUSHED) - drawState = STATE_PRESSED; - else if ((dwStyle & BS_PUSHLIKE) && (state & (BST_CHECKED|BST_INDETERMINATE))) - drawState = STATE_PRESSED; - else if(state & BST_HOT) - drawState = STATE_HOT; - else if(state & BST_FOCUS) - drawState = STATE_DEFAULTED; - else - drawState = STATE_NORMAL; - } - else + if(dwStyle & WS_DISABLED) drawState = STATE_DISABLED; - -#ifndef __REACTOS__ /* r73873 */ - hDC = hParamDC ? hParamDC : BeginPaint(hwnd, &ps); - if (paint) paint(theme, hwnd, hDC, drawState, dtFlags, state & BST_FOCUS); - if (!hParamDC) EndPaint(hwnd, &ps); -#endif - -#ifdef __REACTOS__ /* r74074 & r74120 */ - if (drawState == STATE_NORMAL && type == BS_DEFPUSHBUTTON) - { + else if(state & BST_PUSHED) + drawState = STATE_PRESSED; + else if ((dwStyle & BS_PUSHLIKE) && (state & (BST_CHECKED|BST_INDETERMINATE))) + drawState = STATE_PRESSED; + else if(state & BST_HOT) + drawState = STATE_HOT; + else if((state & BST_FOCUS) || (dwStyle & BS_DEFPUSHBUTTON)) drawState = STATE_DEFAULTED; - } -#endif + else + drawState = STATE_NORMAL; paint(theme, hwnd, hParamDC, drawState, dtFlags, state & BST_FOCUS, prfFlag); return TRUE; } - -#ifndef __REACTOS__ /* r73873 */ -/********************************************************************** - * The button control subclass window proc. - */ -LRESULT CALLBACK THEMING_ButtonSubclassProc(HWND hwnd, UINT msg, - WPARAM wParam, LPARAM lParam, - ULONG_PTR dwRefData) -{ - const WCHAR* themeClass = WC_BUTTONW; - HTHEME theme; - LRESULT result; - - switch (msg) - { - case WM_CREATE: - result = THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - OpenThemeData(hwnd, themeClass); - return result; - - case WM_DESTROY: - theme = GetWindowTheme(hwnd); - CloseThemeData (theme); - return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - - case WM_THEMECHANGED: - theme = GetWindowTheme(hwnd); - CloseThemeData (theme); - OpenThemeData(hwnd, themeClass); - break; - - case WM_SYSCOLORCHANGE: - theme = GetWindowTheme(hwnd); - if (!theme) return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - /* Do nothing. When themed, a WM_THEMECHANGED will be received, too, - * which will do the repaint. */ - break; - - case WM_PAINT: - theme = GetWindowTheme(hwnd); - if (theme && BUTTON_Paint(theme, hwnd, (HDC)wParam)) - return 0; - else - return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - - case WM_ENABLE: - theme = GetWindowTheme(hwnd); - if (theme) { - RedrawWindow(hwnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW); - return 0; - } else - return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - - case WM_MOUSEMOVE: - { - TRACKMOUSEEVENT mouse_event; - mouse_event.cbSize = sizeof(TRACKMOUSEEVENT); - mouse_event.dwFlags = TME_QUERY; - if(!TrackMouseEvent(&mouse_event) || !(mouse_event.dwFlags&(TME_HOVER|TME_LEAVE))) - { - mouse_event.dwFlags = TME_HOVER|TME_LEAVE; - mouse_event.hwndTrack = hwnd; - mouse_event.dwHoverTime = 1; - TrackMouseEvent(&mouse_event); - } - break; - } - - case WM_MOUSEHOVER: - { - int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); - SetWindowLongW(hwnd, 0, state|BST_HOT); - InvalidateRect(hwnd, NULL, FALSE); - break; - } - - case WM_MOUSELEAVE: - { - int state = (int)SendMessageW(hwnd, BM_GETSTATE, 0, 0); - SetWindowLongW(hwnd, 0, state&(~BST_HOT)); - InvalidateRect(hwnd, NULL, FALSE); - break; - } - - case BM_SETCHECK: - case BM_SETSTATE: - theme = GetWindowTheme(hwnd); - if (theme) { - InvalidateRect(hwnd, NULL, FALSE); - } - return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - - default: - /* Call old proc */ - return THEMING_CallOriginalClass(hwnd, msg, wParam, lParam); - } - return 0; -} -#endif /* !__REACTOS__ */
7 years, 1 month
1
0
0
0
[reactos] 01/01: [REACTOS] Add reactos/bin/suppl/ to the list of "known" (hardcoded) directories to make build configuration happy.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3356f87b9e29999ed181d…
commit 3356f87b9e29999ed181dedbecd4a8c9cd306d12 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Nov 17 01:48:18 2017 +0100 [REACTOS] Add reactos/bin/suppl/ to the list of "known" (hardcoded) directories to make build configuration happy. I use a (not yet used) dir-id value of "80" for this purpose (the value "8" being already used for /bin/testdata/ and of course values from 9 up to 50+ are also already used... >_>). --- boot/bootdata/packages/reactos.dff.in | 1 + sdk/cmake/CMakeMacros.cmake | 2 ++ 2 files changed, 3 insertions(+) diff --git a/boot/bootdata/packages/reactos.dff.in b/boot/bootdata/packages/reactos.dff.in index 4382637101..283f32dad5 100644 --- a/boot/bootdata/packages/reactos.dff.in +++ b/boot/bootdata/packages/reactos.dff.in @@ -25,6 +25,7 @@ Signature = "$ReactOS$" 6 = inf 7 = bin 8 = bin\testdata +80 = bin\suppl 9 = media 10 =
Microsoft.NET
11 = Microsoft.NET\Framework diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake index 850bb7f52a..95f99f3af7 100644 --- a/sdk/cmake/CMakeMacros.cmake +++ b/sdk/cmake/CMakeMacros.cmake @@ -179,6 +179,8 @@ macro(dir_to_num dir var) set(${var} 7) elseif(${dir} STREQUAL reactos/bin/testdata) set(${var} 8) + elseif(${dir} STREQUAL reactos/bin/suppl) + set(${var} 80) elseif(${dir} STREQUAL reactos/media) set(${var} 9) elseif(${dir} STREQUAL
reactos/Microsoft.NET
)
7 years, 1 month
1
0
0
0
[reactos] 01/01: [ROSTESTS] Move the tests unsupported by rosautotest under a "suppl" (supplementary) sub-directory of "reactos/bin".
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=aa04c84f624ebda4d2c7e…
commit aa04c84f624ebda4d2c7ec0d76d1a3c92aadaa8e Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Nov 17 01:26:02 2017 +0100 [ROSTESTS] Move the tests unsupported by rosautotest under a "suppl" (supplementary) sub-directory of "reactos/bin". Indeed, rosautotest has an annoying tendency to fail with: Invalid test file name: <testname>.exe SYSREG_ROSAUTOTEST_FAILURE when <testname>.exe is a test that do not comply with the rosautotest interface. This is indeed the case for all the tests under /rostests/win32/, with the exception of cmd_rostest. Addendum to 8dd89c7. --- modules/rostests/win32/advapi32/eventlog/CMakeLists.txt | 4 ++-- modules/rostests/win32/fs/tunneltest/CMakeLists.txt | 2 +- modules/rostests/win32/kernel32/notificationtest/CMakeLists.txt | 2 +- modules/rostests/win32/user32/paintdesktop/CMakeLists.txt | 2 +- modules/rostests/win32/user32/sysicon/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/rostests/win32/advapi32/eventlog/CMakeLists.txt b/modules/rostests/win32/advapi32/eventlog/CMakeLists.txt index 2220b95198..ff617c646a 100644 --- a/modules/rostests/win32/advapi32/eventlog/CMakeLists.txt +++ b/modules/rostests/win32/advapi32/eventlog/CMakeLists.txt @@ -8,10 +8,10 @@ add_library(MyEventProvider_dll SHARED ${CMAKE_CURRENT_BINARY_DIR}/MyEventProvid add_dependencies(MyEventProvider_dll MyEventProvider) set_module_type(MyEventProvider_dll module UNICODE) set_target_properties(MyEventProvider_dll PROPERTIES OUTPUT_NAME "MyEventProvider") -add_rostests_file(TARGET MyEventProvider_dll) +add_rostests_file(TARGET MyEventProvider_dll SUBDIR suppl) add_executable(evtlogtest EvtLogTest.c) set_module_type(evtlogtest win32cui UNICODE) add_dependencies(evtlogtest MyEventProvider MyEventProvider_dll) add_importlibs(evtlogtest advapi32 msvcrt kernel32) -add_rostests_file(TARGET evtlogtest) +add_rostests_file(TARGET evtlogtest SUBDIR suppl) diff --git a/modules/rostests/win32/fs/tunneltest/CMakeLists.txt b/modules/rostests/win32/fs/tunneltest/CMakeLists.txt index 8ab41f953d..812932cfb2 100644 --- a/modules/rostests/win32/fs/tunneltest/CMakeLists.txt +++ b/modules/rostests/win32/fs/tunneltest/CMakeLists.txt @@ -5,4 +5,4 @@ list(APPEND SOURCE add_executable(tunneltest ${SOURCE}) set_module_type(tunneltest win32cui UNICODE) add_importlibs(tunneltest msvcrt kernel32 ntdll) -add_rostests_file(TARGET tunneltest) +add_rostests_file(TARGET tunneltest SUBDIR suppl) diff --git a/modules/rostests/win32/kernel32/notificationtest/CMakeLists.txt b/modules/rostests/win32/kernel32/notificationtest/CMakeLists.txt index da79cdfc32..00853fa3e7 100644 --- a/modules/rostests/win32/kernel32/notificationtest/CMakeLists.txt +++ b/modules/rostests/win32/kernel32/notificationtest/CMakeLists.txt @@ -6,4 +6,4 @@ add_executable(notificationtest ${SOURCE}) target_link_libraries(notificationtest wine ${PSEH_LIB}) set_module_type(notificationtest win32cui) add_importlibs(notificationtest gdi32 user32 shlwapi msvcrt kernel32 ntdll) -add_rostests_file(TARGET notificationtest) +add_rostests_file(TARGET notificationtest SUBDIR suppl) diff --git a/modules/rostests/win32/user32/paintdesktop/CMakeLists.txt b/modules/rostests/win32/user32/paintdesktop/CMakeLists.txt index 3c5172571e..bf3ac1922d 100644 --- a/modules/rostests/win32/user32/paintdesktop/CMakeLists.txt +++ b/modules/rostests/win32/user32/paintdesktop/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(paintdesktop PaintDesktop.c) set_module_type(paintdesktop win32gui UNICODE) add_importlibs(paintdesktop user32 msvcrt kernel32) -add_rostests_file(TARGET paintdesktop) +add_rostests_file(TARGET paintdesktop SUBDIR suppl) diff --git a/modules/rostests/win32/user32/sysicon/CMakeLists.txt b/modules/rostests/win32/user32/sysicon/CMakeLists.txt index 054734c373..55d70ab239 100644 --- a/modules/rostests/win32/user32/sysicon/CMakeLists.txt +++ b/modules/rostests/win32/user32/sysicon/CMakeLists.txt @@ -7,4 +7,4 @@ add_executable(sysicon ${SOURCE}) target_link_libraries(sysicon ${PSEH_LIB}) set_module_type(sysicon win32gui UNICODE) add_importlibs(sysicon gdi32 user32 msvcrt kernel32) -add_rostests_file(TARGET sysicon) +add_rostests_file(TARGET sysicon SUBDIR suppl)
7 years, 1 month
1
0
0
0
[reactos] 02/02: [CMD] Fix support for newlines in the emulated parenthesed set block of the "for" command. CORE-7998
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8340574fe3f4883dc6c38…
commit 8340574fe3f4883dc6c389fadda2b61052f78d35 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Fri Nov 17 00:56:35 2017 +0100 [CMD] Fix support for newlines in the emulated parenthesed set block of the "for" command. CORE-7998 --- base/shell/cmd/parser.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/base/shell/cmd/parser.c b/base/shell/cmd/parser.c index 426c1ab11a..821ef78d71 100644 --- a/base/shell/cmd/parser.c +++ b/base/shell/cmd/parser.c @@ -55,7 +55,7 @@ static TCHAR CurrentToken[CMDLINE_LENGTH]; static int CurrentTokenType; static int InsideBlock; -static TCHAR ParseChar() +static TCHAR ParseChar(void) { TCHAR Char; @@ -69,7 +69,9 @@ restart: * even separate tokens. */ do + { Char = *ParsePos++; + } while (Char == _T('\r')); if (!Char) @@ -91,7 +93,7 @@ restart: return CurChar = Char; } -static void ParseError() +static void ParseError(void) { error_syntax(CurrentTokenType != TOK_END ? CurrentToken : NULL); bParseError = TRUE; @@ -317,6 +319,7 @@ static PARSED_COMMAND *ParseBlock(REDIRECTION *RedirList) if (CurrentTokenType == TOK_END_BLOCK) break; + /* Skip past the \n */ ParseChar(); } @@ -502,6 +505,13 @@ static PARSED_COMMAND *ParseFor(void) if (Type == TOK_END_BLOCK) break; + if (Type == TOK_END) + { + /* Skip past the \n */ + ParseChar(); + continue; + } + if (Type != TOK_NORMAL) goto error;
7 years, 1 month
1
0
0
0
← Newer
1
...
6
7
8
9
10
11
12
...
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200