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 2019
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
24 participants
322 discussions
Start a n
N
ew thread
[reactos] 01/01: [SHELL32][BOOTDATA] Implement Command Prompt here (#2029)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90c63d12a1960b75b518a…
commit 90c63d12a1960b75b518ac8e9dad81efce5a7fac Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Nov 14 23:25:21 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Nov 14 23:25:21 2019 +0900 [SHELL32][BOOTDATA] Implement Command Prompt here (#2029) Add "Command Prompt here" menu item to the Right-click menu of normal folders and drives. Currently, this menu item doesn't work correctly because of the bug of pushd. CORE-12150 --- boot/bootdata/hivecls.inf | 16 ++++++++ dll/win32/shell32/CDefaultContextMenu.cpp | 65 ++++++++++++++++++------------- dll/win32/shell32/lang/bg-BG.rc | 1 + dll/win32/shell32/lang/ca-ES.rc | 1 + dll/win32/shell32/lang/cs-CZ.rc | 1 + dll/win32/shell32/lang/da-DK.rc | 1 + dll/win32/shell32/lang/de-DE.rc | 1 + dll/win32/shell32/lang/el-GR.rc | 1 + dll/win32/shell32/lang/en-GB.rc | 1 + dll/win32/shell32/lang/en-US.rc | 1 + dll/win32/shell32/lang/es-ES.rc | 1 + dll/win32/shell32/lang/et-EE.rc | 1 + dll/win32/shell32/lang/fi-FI.rc | 1 + dll/win32/shell32/lang/fr-FR.rc | 1 + dll/win32/shell32/lang/he-IL.rc | 1 + dll/win32/shell32/lang/hi-IN.rc | 1 + dll/win32/shell32/lang/hu-HU.rc | 1 + dll/win32/shell32/lang/id-ID.rc | 1 + dll/win32/shell32/lang/it-IT.rc | 1 + dll/win32/shell32/lang/ja-JP.rc | 1 + dll/win32/shell32/lang/ko-KR.rc | 1 + dll/win32/shell32/lang/nl-NL.rc | 1 + dll/win32/shell32/lang/no-NO.rc | 1 + dll/win32/shell32/lang/pl-PL.rc | 1 + dll/win32/shell32/lang/pt-BR.rc | 1 + dll/win32/shell32/lang/pt-PT.rc | 1 + dll/win32/shell32/lang/ro-RO.rc | 1 + dll/win32/shell32/lang/ru-RU.rc | 1 + dll/win32/shell32/lang/sk-SK.rc | 1 + dll/win32/shell32/lang/sl-SI.rc | 1 + dll/win32/shell32/lang/sq-AL.rc | 1 + dll/win32/shell32/lang/sv-SE.rc | 1 + dll/win32/shell32/lang/tr-TR.rc | 1 + dll/win32/shell32/lang/uk-UA.rc | 1 + dll/win32/shell32/lang/zh-CN.rc | 1 + dll/win32/shell32/lang/zh-TW.rc | 1 + dll/win32/shell32/shlexec.cpp | 40 ++++++++++++++++++- dll/win32/shell32/shresdef.h | 1 + 38 files changed, 129 insertions(+), 27 deletions(-) diff --git a/boot/bootdata/hivecls.inf b/boot/bootdata/hivecls.inf index d3ae861c06b..d2cd5bada57 100644 --- a/boot/bootdata/hivecls.inf +++ b/boot/bootdata/hivecls.inf @@ -26,6 +26,22 @@ HKCR,"Folder\shell\explore","BrowserFlags",0x00010001,"0x00000022" HKCR,"Folder\shell\explore","ExplorerFlags",0x00010001,"0x00000021" HKCR,"Folder\shell\explore\command","",0x00000000,"explorer.exe /e,""%1""" +; Directory +HKCR,"Directory","",0x00000000,"File Folder" +;HKCR,"Directory\DefaultIcon","",0x00000000,"%SystemRoot%\system32\shell32.dll,-4" +HKCR,"Directory","AlwaysShowExt",0x00000000,"" +HKCR,"Directory","NoRecentDocs",0x00000000,"" +HKCR,"Directory\shell\cmd","",0x00020000,"@%SystemRoot%\system32\shell32.dll,-306" +HKCR,"Directory\shell\cmd","Extended",0x00000000,"" +HKCR,"Directory\shell\cmd\command","",0x00000000,"cmd /s /k pushd ""%V""" + +; Drive +HKCR,"Drive","",0x00000000,"Drive" +;HKCR,"Drive\DefaultIcon","",0x00000000,"%SystemRoot%\system32\shell32.dll,-4" +HKCR,"Drive\shell\cmd","",0x00020000,"@%SystemRoot%\system32\shell32.dll,-306" +HKCR,"Drive\shell\cmd","Extended",0x00000000,"" +HKCR,"Drive\shell\cmd\command","",0x00000000,"cmd /s /k pushd ""%V""" + ; Clipboard Element HKCR,".clp","",0x00000000,"clpfile" HKCR,".clp","Content Type",0x00000000,"application/x-msclip" diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp b/dll/win32/shell32/CDefaultContextMenu.cpp index aa250481a08..31edee28e7d 100644 --- a/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/dll/win32/shell32/CDefaultContextMenu.cpp @@ -562,49 +562,62 @@ CDefaultContextMenu::AddStaticContextMenusToMenu( /* By default use verb for menu item name */ mii.dwTypeData = pEntry->szVerb; + WCHAR wszKey[256]; + HRESULT hr; + hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", pEntry->szVerb); + if (FAILED_UNEXPECTEDLY(hr)) + { + pEntry = pEntry->pNext; + continue; + } + + BOOL Extended = FALSE; + HKEY hkVerb; if (idResource > 0) { if (LoadStringW(shell32_hInstance, idResource, wszVerb, _countof(wszVerb))) mii.dwTypeData = wszVerb; /* use translated verb */ else ERR("Failed to load string\n"); + + LONG res = RegOpenKeyW(pEntry->hkClass, wszKey, &hkVerb); + if (res == ERROR_SUCCESS) + { + res = RegQueryValueExW(hkVerb, L"Extended", NULL, NULL, NULL, NULL); + Extended = (res == ERROR_SUCCESS); + + RegCloseKey(hkVerb); + } } else { - WCHAR wszKey[256]; - HRESULT hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", pEntry->szVerb); - - if (SUCCEEDED(hr)) + LONG res = RegOpenKeyW(pEntry->hkClass, wszKey, &hkVerb); + if (res == ERROR_SUCCESS) { - HKEY hkVerb; DWORD cbVerb = sizeof(wszVerb); - LONG res = RegOpenKeyW(pEntry->hkClass, wszKey, &hkVerb); + res = RegLoadMUIStringW(hkVerb, NULL, wszVerb, cbVerb, NULL, 0, NULL); if (res == ERROR_SUCCESS) { - res = RegLoadMUIStringW(hkVerb, - NULL, - wszVerb, - cbVerb, - NULL, - 0, - NULL); - if (res == ERROR_SUCCESS) - { - /* use description for the menu entry */ - mii.dwTypeData = wszVerb; - } - - RegCloseKey(hkVerb); + /* use description for the menu entry */ + mii.dwTypeData = wszVerb; } + + res = RegQueryValueExW(hkVerb, L"Extended", NULL, NULL, NULL, NULL); + Extended = (res == ERROR_SUCCESS); + + RegCloseKey(hkVerb); } } - mii.cch = wcslen(mii.dwTypeData); - mii.fState = fState; - mii.wID = iIdCmdFirst + cIds; - InsertMenuItemW(hMenu, *pIndexMenu, TRUE, &mii); - (*pIndexMenu)++; - cIds++; + if (!Extended || GetAsyncKeyState(VK_SHIFT) < 0) + { + mii.cch = wcslen(mii.dwTypeData); + mii.fState = fState; + mii.wID = iIdCmdFirst + cIds; + InsertMenuItemW(hMenu, *pIndexMenu, TRUE, &mii); + (*pIndexMenu)++; + cIds++; + } pEntry = pEntry->pNext; diff --git a/dll/win32/shell32/lang/bg-BG.rc b/dll/win32/shell32/lang/bg-BG.rc index e61b6c675fb..42d1fb138bf 100644 --- a/dll/win32/shell32/lang/bg-BG.rc +++ b/dll/win32/shell32/lang/bg-BG.rc @@ -911,6 +911,7 @@ BEGIN IDS_EDIT_VERB "Обработка" IDS_FIND_VERB "Търсене" IDS_PRINT_VERB "Разпечатване" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u файла, %u папки" IDS_PRINTERS "Печатачи" diff --git a/dll/win32/shell32/lang/ca-ES.rc b/dll/win32/shell32/lang/ca-ES.rc index b2e25f93076..5f01647f972 100644 --- a/dll/win32/shell32/lang/ca-ES.rc +++ b/dll/win32/shell32/lang/ca-ES.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/cs-CZ.rc b/dll/win32/shell32/lang/cs-CZ.rc index b5f4c2c2616..c668b7b14d8 100644 --- a/dll/win32/shell32/lang/cs-CZ.rc +++ b/dll/win32/shell32/lang/cs-CZ.rc @@ -916,6 +916,7 @@ BEGIN IDS_EDIT_VERB "Upravit" IDS_FIND_VERB "Najít" IDS_PRINT_VERB "Tisknout" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u souborů, %u složek" IDS_PRINTERS "Tiskárny" diff --git a/dll/win32/shell32/lang/da-DK.rc b/dll/win32/shell32/lang/da-DK.rc index 7a063778cab..30172aed75d 100644 --- a/dll/win32/shell32/lang/da-DK.rc +++ b/dll/win32/shell32/lang/da-DK.rc @@ -916,6 +916,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/de-DE.rc b/dll/win32/shell32/lang/de-DE.rc index f0145f348be..1f6b2cc673d 100644 --- a/dll/win32/shell32/lang/de-DE.rc +++ b/dll/win32/shell32/lang/de-DE.rc @@ -911,6 +911,7 @@ BEGIN IDS_EDIT_VERB "Bearbeiten" IDS_FIND_VERB "Finden" IDS_PRINT_VERB "Drucken" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Dateien, %u Ordner" IDS_PRINTERS "Drucker" diff --git a/dll/win32/shell32/lang/el-GR.rc b/dll/win32/shell32/lang/el-GR.rc index aaf9db3c3b7..5196614198a 100644 --- a/dll/win32/shell32/lang/el-GR.rc +++ b/dll/win32/shell32/lang/el-GR.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/en-GB.rc b/dll/win32/shell32/lang/en-GB.rc index 7eb8229884e..5d4cf6bc4a9 100644 --- a/dll/win32/shell32/lang/en-GB.rc +++ b/dll/win32/shell32/lang/en-GB.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/en-US.rc b/dll/win32/shell32/lang/en-US.rc index bce8bc31278..f50562a6982 100644 --- a/dll/win32/shell32/lang/en-US.rc +++ b/dll/win32/shell32/lang/en-US.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/es-ES.rc b/dll/win32/shell32/lang/es-ES.rc index 1464b4d14f0..12e5e17d7d8 100644 --- a/dll/win32/shell32/lang/es-ES.rc +++ b/dll/win32/shell32/lang/es-ES.rc @@ -918,6 +918,7 @@ BEGIN IDS_EDIT_VERB "Editar" IDS_FIND_VERB "Buscar" IDS_PRINT_VERB "Imprimir" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u archivos, %u carpetas" IDS_PRINTERS "Impresoras" diff --git a/dll/win32/shell32/lang/et-EE.rc b/dll/win32/shell32/lang/et-EE.rc index e2e8cf41e28..63b137c76df 100644 --- a/dll/win32/shell32/lang/et-EE.rc +++ b/dll/win32/shell32/lang/et-EE.rc @@ -917,6 +917,7 @@ BEGIN IDS_EDIT_VERB "Muuda" IDS_FIND_VERB "Leia" IDS_PRINT_VERB "Prindi" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Faili, %u Kausta" IDS_PRINTERS "Printerid" diff --git a/dll/win32/shell32/lang/fi-FI.rc b/dll/win32/shell32/lang/fi-FI.rc index f6cd13e6878..5fc6ddfadf4 100644 --- a/dll/win32/shell32/lang/fi-FI.rc +++ b/dll/win32/shell32/lang/fi-FI.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/fr-FR.rc b/dll/win32/shell32/lang/fr-FR.rc index 58464c856ff..e5d0e25e44f 100644 --- a/dll/win32/shell32/lang/fr-FR.rc +++ b/dll/win32/shell32/lang/fr-FR.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Éditer" IDS_FIND_VERB "Chercher" IDS_PRINT_VERB "Imprimer" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u fichiers, %u répertoires" IDS_PRINTERS "Imprimantes" diff --git a/dll/win32/shell32/lang/he-IL.rc b/dll/win32/shell32/lang/he-IL.rc index 9e63d54b428..e9e64d7eafe 100644 --- a/dll/win32/shell32/lang/he-IL.rc +++ b/dll/win32/shell32/lang/he-IL.rc @@ -912,6 +912,7 @@ BEGIN IDS_EDIT_VERB "ערוך" IDS_FIND_VERB "מצא" IDS_PRINT_VERB "הדפס" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u קבצים, %u תיקיות" IDS_PRINTERS "מדפסות" diff --git a/dll/win32/shell32/lang/hi-IN.rc b/dll/win32/shell32/lang/hi-IN.rc index 6903fe2372e..7e637bad1c5 100644 --- a/dll/win32/shell32/lang/hi-IN.rc +++ b/dll/win32/shell32/lang/hi-IN.rc @@ -905,6 +905,7 @@ BEGIN IDS_EDIT_VERB "संपादित करें" IDS_FIND_VERB "ढूंढे" IDS_PRINT_VERB "प्रिंट" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u फ़ाइलें, %u फ़ोल्डर" IDS_PRINTERS "प्रिंटर" diff --git a/dll/win32/shell32/lang/hu-HU.rc b/dll/win32/shell32/lang/hu-HU.rc index 037d7f8e4c9..1c9f001830e 100644 --- a/dll/win32/shell32/lang/hu-HU.rc +++ b/dll/win32/shell32/lang/hu-HU.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/id-ID.rc b/dll/win32/shell32/lang/id-ID.rc index 4d5abb5d14e..c9736262764 100644 --- a/dll/win32/shell32/lang/id-ID.rc +++ b/dll/win32/shell32/lang/id-ID.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Cari" IDS_PRINT_VERB "Cetak" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Berkas, %u Folder" IDS_PRINTERS "Printer" diff --git a/dll/win32/shell32/lang/it-IT.rc b/dll/win32/shell32/lang/it-IT.rc index fa5cd0d287e..7a854349b50 100644 --- a/dll/win32/shell32/lang/it-IT.rc +++ b/dll/win32/shell32/lang/it-IT.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Modifica" IDS_FIND_VERB "Cerca" IDS_PRINT_VERB "Stampa" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u File, %u Cartelle" IDS_PRINTERS "Stampanti" diff --git a/dll/win32/shell32/lang/ja-JP.rc b/dll/win32/shell32/lang/ja-JP.rc index 56a7ca99a3d..9c2732f4a09 100644 --- a/dll/win32/shell32/lang/ja-JP.rc +++ b/dll/win32/shell32/lang/ja-JP.rc @@ -907,6 +907,7 @@ BEGIN IDS_EDIT_VERB "編集" IDS_FIND_VERB "検索" IDS_PRINT_VERB "印刷" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u 個のファイル、 %u 個のフォルダ" IDS_PRINTERS "プリンタ" diff --git a/dll/win32/shell32/lang/ko-KR.rc b/dll/win32/shell32/lang/ko-KR.rc index 4239b7e3da5..3b33cefd7fe 100644 --- a/dll/win32/shell32/lang/ko-KR.rc +++ b/dll/win32/shell32/lang/ko-KR.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/nl-NL.rc b/dll/win32/shell32/lang/nl-NL.rc index cb9ec3ef3e9..e7a697f12da 100644 --- a/dll/win32/shell32/lang/nl-NL.rc +++ b/dll/win32/shell32/lang/nl-NL.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/no-NO.rc b/dll/win32/shell32/lang/no-NO.rc index 16c0a4333ea..51d999b495b 100644 --- a/dll/win32/shell32/lang/no-NO.rc +++ b/dll/win32/shell32/lang/no-NO.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Rediger" IDS_FIND_VERB "Finn" IDS_PRINT_VERB "Skriv ut" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u filer, %u mapper" IDS_PRINTERS "Skrivere" diff --git a/dll/win32/shell32/lang/pl-PL.rc b/dll/win32/shell32/lang/pl-PL.rc index 38724ea0bbd..7c0cc733c22 100644 --- a/dll/win32/shell32/lang/pl-PL.rc +++ b/dll/win32/shell32/lang/pl-PL.rc @@ -915,6 +915,7 @@ BEGIN IDS_EDIT_VERB "Edytuj" IDS_FIND_VERB "Wyszukaj" IDS_PRINT_VERB "Drukuj" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Plików, %u Katalogów" IDS_PRINTERS "Drukarki" diff --git a/dll/win32/shell32/lang/pt-BR.rc b/dll/win32/shell32/lang/pt-BR.rc index 035a4ae514a..c34ae71fc0d 100644 --- a/dll/win32/shell32/lang/pt-BR.rc +++ b/dll/win32/shell32/lang/pt-BR.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Editar" IDS_FIND_VERB "Procurar" IDS_PRINT_VERB "Imprimir" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Arquivos, %u Pastas" IDS_PRINTERS "Impressoras" diff --git a/dll/win32/shell32/lang/pt-PT.rc b/dll/win32/shell32/lang/pt-PT.rc index 685f86cf1bc..6560b089148 100644 --- a/dll/win32/shell32/lang/pt-PT.rc +++ b/dll/win32/shell32/lang/pt-PT.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Editar" IDS_FIND_VERB "Procurar" IDS_PRINT_VERB "Imprimir" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Ficheiros, %u Pastas" IDS_PRINTERS "Impressoras" diff --git a/dll/win32/shell32/lang/ro-RO.rc b/dll/win32/shell32/lang/ro-RO.rc index 5d6c56c8a7c..a3dfce4391b 100644 --- a/dll/win32/shell32/lang/ro-RO.rc +++ b/dll/win32/shell32/lang/ro-RO.rc @@ -912,6 +912,7 @@ BEGIN IDS_EDIT_VERB "Editează" IDS_FIND_VERB "Caută" IDS_PRINT_VERB "Imprimă" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u fișiere, %u dosare" IDS_PRINTERS "Imprimante" diff --git a/dll/win32/shell32/lang/ru-RU.rc b/dll/win32/shell32/lang/ru-RU.rc index 36002d87d62..46b397572aa 100644 --- a/dll/win32/shell32/lang/ru-RU.rc +++ b/dll/win32/shell32/lang/ru-RU.rc @@ -917,6 +917,7 @@ BEGIN IDS_EDIT_VERB "Изменить" IDS_FIND_VERB "Поиск" IDS_PRINT_VERB "Печать" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u файлов, %u папок" IDS_PRINTERS "Принтеры" diff --git a/dll/win32/shell32/lang/sk-SK.rc b/dll/win32/shell32/lang/sk-SK.rc index 165f210a79d..01000ca3e98 100644 --- a/dll/win32/shell32/lang/sk-SK.rc +++ b/dll/win32/shell32/lang/sk-SK.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Upraviť" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Tlačiť" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "súbory: %u, priečinky: %u" IDS_PRINTERS "Tlačiarne" diff --git a/dll/win32/shell32/lang/sl-SI.rc b/dll/win32/shell32/lang/sl-SI.rc index 678c5f5f7be..640f4cb7e5b 100644 --- a/dll/win32/shell32/lang/sl-SI.rc +++ b/dll/win32/shell32/lang/sl-SI.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Edit" IDS_FIND_VERB "Find" IDS_PRINT_VERB "Print" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Files, %u Folders" IDS_PRINTERS "Printers" diff --git a/dll/win32/shell32/lang/sq-AL.rc b/dll/win32/shell32/lang/sq-AL.rc index f65bf86b3f2..fe6992e9834 100644 --- a/dll/win32/shell32/lang/sq-AL.rc +++ b/dll/win32/shell32/lang/sq-AL.rc @@ -914,6 +914,7 @@ BEGIN IDS_EDIT_VERB "Modifiko" IDS_FIND_VERB "Gjej" IDS_PRINT_VERB "Printo" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Dokumenta, %u Dosje" IDS_PRINTERS "Printera" diff --git a/dll/win32/shell32/lang/sv-SE.rc b/dll/win32/shell32/lang/sv-SE.rc index e17328ecc79..06749268ad7 100644 --- a/dll/win32/shell32/lang/sv-SE.rc +++ b/dll/win32/shell32/lang/sv-SE.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Redigera" IDS_FIND_VERB "Hitta" IDS_PRINT_VERB "Skriv ut" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u filer, %u mappar" IDS_PRINTERS "Skrivare" diff --git a/dll/win32/shell32/lang/tr-TR.rc b/dll/win32/shell32/lang/tr-TR.rc index bc6addfed2b..88449402f00 100644 --- a/dll/win32/shell32/lang/tr-TR.rc +++ b/dll/win32/shell32/lang/tr-TR.rc @@ -912,6 +912,7 @@ BEGIN IDS_EDIT_VERB "Düzenle" IDS_FIND_VERB "Bul" IDS_PRINT_VERB "Yazdır" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u Kütük, %u Dizin" IDS_PRINTERS "Yazıcılar" diff --git a/dll/win32/shell32/lang/uk-UA.rc b/dll/win32/shell32/lang/uk-UA.rc index 97ec05510e7..faa2254e158 100644 --- a/dll/win32/shell32/lang/uk-UA.rc +++ b/dll/win32/shell32/lang/uk-UA.rc @@ -910,6 +910,7 @@ BEGIN IDS_EDIT_VERB "Змінити" IDS_FIND_VERB "Пошук" IDS_PRINT_VERB "Друк" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u файлів, %u папок" IDS_PRINTERS "Принтери" diff --git a/dll/win32/shell32/lang/zh-CN.rc b/dll/win32/shell32/lang/zh-CN.rc index f3debf50826..af8f3c41076 100644 --- a/dll/win32/shell32/lang/zh-CN.rc +++ b/dll/win32/shell32/lang/zh-CN.rc @@ -920,6 +920,7 @@ BEGIN IDS_EDIT_VERB "编辑" IDS_FIND_VERB "查找" IDS_PRINT_VERB "打印" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u 个文件,%u 个文件夹" IDS_PRINTERS "打印机" diff --git a/dll/win32/shell32/lang/zh-TW.rc b/dll/win32/shell32/lang/zh-TW.rc index 31faf69e845..a9cf8074ce1 100644 --- a/dll/win32/shell32/lang/zh-TW.rc +++ b/dll/win32/shell32/lang/zh-TW.rc @@ -921,6 +921,7 @@ BEGIN IDS_EDIT_VERB "編輯" IDS_FIND_VERB "搜索" IDS_PRINT_VERB "列印" + IDS_CMD_VERB "Command Prompt here" IDS_FILE_FOLDER "%u 個檔案, %u 個檔案夾" IDS_PRINTERS "印表機" diff --git a/dll/win32/shell32/shlexec.cpp b/dll/win32/shell32/shlexec.cpp index 5a741467cb0..049426dd7da 100644 --- a/dll/win32/shell32/shlexec.cpp +++ b/dll/win32/shell32/shlexec.cpp @@ -3,7 +3,7 @@ * * Copyright 1998 Marcus Meissner * Copyright 2002 Eric Pouech - * Copyright 2018 Katayama Hirofumi MZ + * Copyright 2018-2019 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 @@ -167,6 +167,8 @@ static void ParseTildeEffect(PWSTR &res, LPCWSTR &args, DWORD &len, DWORD &used, * %I address of a global item ID (explorer switch /idlist) * %L seems to be %1 as long filename followed by the 8+3 variation * %S ??? + * %W Working directory + * %V Use either %L or %W * %* all following parameters (see batfile) * * The way we parse the command line arguments was determined through extensive @@ -302,6 +304,42 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* found_p1 = TRUE; break; + case 'w': + case 'W': + if (lpDir) + { + used += wcslen(lpDir); + if (used < len) + { + wcscpy(res, lpDir); + res += wcslen(lpDir); + } + } + break; + + case 'v': + case 'V': + if (lpFile) + { + used += wcslen(lpFile); + if (used < len) + { + wcscpy(res, lpFile); + res += wcslen(lpFile); + } + found_p1 = TRUE; + } + else if (lpDir) + { + used += wcslen(lpDir); + if (used < len) + { + wcscpy(res, lpDir); + res += wcslen(lpDir); + } + } + break; + case 'i': case 'I': if (pidl) diff --git a/dll/win32/shell32/shresdef.h b/dll/win32/shell32/shresdef.h index 2b729d6a2ea..3e425eac704 100644 --- a/dll/win32/shell32/shresdef.h +++ b/dll/win32/shell32/shresdef.h @@ -200,6 +200,7 @@ #define IDS_EDIT_VERB 303 #define IDS_FIND_VERB 304 #define IDS_PRINT_VERB 305 +#define IDS_CMD_VERB 306 #define IDS_FILE_FOLDER 308 #define IDS_CREATELINK 309
5 years, 1 month
1
0
0
0
[reactos] 01/01: [CMD_APITEST] Add cmd_apitest testcases (#2034)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e753d5e1086e96a4978d0…
commit e753d5e1086e96a4978d061e0ca6ff1b9cf4d896 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Nov 14 22:52:31 2019 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Nov 14 22:52:31 2019 +0900 [CMD_APITEST] Add cmd_apitest testcases (#2034) Add some testcases for cmd.exe. CORE-12150 --- modules/rostests/apitests/CMakeLists.txt | 1 + modules/rostests/apitests/cmd/CMakeLists.txt | 11 + modules/rostests/apitests/cmd/cmd.c | 300 +++++++++++++++++++++++++++ modules/rostests/apitests/cmd/precomp.h | 6 + modules/rostests/apitests/cmd/testlist.c | 16 ++ 5 files changed, 334 insertions(+) diff --git a/modules/rostests/apitests/CMakeLists.txt b/modules/rostests/apitests/CMakeLists.txt index 8910f89b56a..62ca4c742bc 100644 --- a/modules/rostests/apitests/CMakeLists.txt +++ b/modules/rostests/apitests/CMakeLists.txt @@ -6,6 +6,7 @@ add_subdirectory(apphelp) add_subdirectory(appshim) add_subdirectory(atl) add_subdirectory(browseui) +add_subdirectory(cmd) add_subdirectory(com) add_subdirectory(comctl32) add_subdirectory(crt) diff --git a/modules/rostests/apitests/cmd/CMakeLists.txt b/modules/rostests/apitests/cmd/CMakeLists.txt new file mode 100644 index 00000000000..5eae6ccdee6 --- /dev/null +++ b/modules/rostests/apitests/cmd/CMakeLists.txt @@ -0,0 +1,11 @@ + +list(APPEND SOURCE + cmd.c + precomp.h) + +add_executable(cmd_apitest ${SOURCE} testlist.c) +target_link_libraries(cmd_apitest wine ${PSEH_LIB}) +set_module_type(cmd_apitest win32cui) +add_importlibs(cmd_apitest msvcrt kernel32) +add_pch(cmd_apitest precomp.h SOURCE) +add_rostests_file(TARGET cmd_apitest) diff --git a/modules/rostests/apitests/cmd/cmd.c b/modules/rostests/apitests/cmd/cmd.c new file mode 100644 index 00000000000..f4e79cc59bd --- /dev/null +++ b/modules/rostests/apitests/cmd/cmd.c @@ -0,0 +1,300 @@ +/* + * PROJECT: ReactOS API tests + * LICENSE: LGPL-2.1+ (
https://spdx.org/licenses/LGPL-2.1+
) + * PURPOSE: Test for cmd.exe + * COPYRIGHT: Copyright 2019 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#include "precomp.h" + +#define TIMEOUT 3000 + +typedef struct TEST_ENTRY +{ + INT line; + DWORD dwExitCode; + const char *cmdline; + BOOL bStdOutput; + BOOL bStdError; +} TEST_ENTRY; + +static const TEST_ENTRY s_exit_entries[] = +{ + { __LINE__, 0, "cmd /c exit" }, + { __LINE__, 0, "cmd /c exit 0" }, + { __LINE__, 0, "cmd /c exit \"\"" }, + { __LINE__, 0, "cmd /c exit ABC" }, + { __LINE__, 0, "cmd /c exit \"ABC" }, + { __LINE__, 0, "cmd /c exit \"ABC\"" }, + { __LINE__, 1234, "cmd /c exit 1234" }, +}; + +static const TEST_ENTRY s_echo_entries[] = +{ + { __LINE__, 0, "cmd /c echo", TRUE, FALSE }, + { __LINE__, 0, "cmd /c echo.", TRUE, FALSE }, +}; + +static const TEST_ENTRY s_cd_entries[] = +{ + { __LINE__, 0, "cmd /c cd \"C:\\ ", }, + { __LINE__, 0, "cmd /c cd C:/", }, + { __LINE__, 0, "cmd /c cd \"\"", TRUE, FALSE }, + { __LINE__, 0, "cmd /c cd", TRUE, FALSE }, + { __LINE__, 1234, "cmd /c cd C:\\Program Files && exit 1234" }, + { __LINE__, 1234, "cmd /c cd \"C:\\ \" && exit 1234", }, + { __LINE__, 1234, "cmd /c cd \"C:\\Program Files\" && exit 1234", }, + { __LINE__, 1234, "cmd /c cd \"\" && exit 1234", TRUE, FALSE }, + { __LINE__, 1234, "cmd /c cd \\ && exit 1234" }, +}; + +static const TEST_ENTRY s_pushd_entries[] = +{ + { __LINE__, 0, "cmd /c pushd C:\\ " }, + { __LINE__, 0, "cmd /c pushd C:\\ \"" }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\"\"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\ \" " }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\" " }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\"\" " }, + { __LINE__, 0, "cmd /c pushd C:\\ \"\"\"\" " }, + { __LINE__, 0, "cmd /c pushd C:\\" }, + { __LINE__, 0, "cmd /c pushd C:\\\"" }, + { __LINE__, 0, "cmd /c pushd C:\\\"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\\"\"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\\"\"\"\"" }, + { __LINE__, 0, "cmd /c pushd C:\\\" " }, + { __LINE__, 0, "cmd /c pushd C:\\\"\" " }, + { __LINE__, 0, "cmd /c pushd C:\\\"\"\" " }, + { __LINE__, 0, "cmd /c pushd C:\\\"\"\"\" " }, + { __LINE__, 0, "cmd /c pushd \"C:\\ " }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\"\"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \" " }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\" " }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\"\" " }, + { __LINE__, 0, "cmd /c pushd \"C:\\ \"\"\"\" " }, + { __LINE__, 0, "cmd /c pushd \"C:\\" }, + { __LINE__, 0, "cmd /c pushd \"C:\\\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\\"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\\"\"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\\"\"\"\"" }, + { __LINE__, 0, "cmd /c pushd \"C:\\\"" }, + { __LINE__, 1, "cmd /c pushd \" C:\\ ", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \" C:\\ \"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \" C:\\ \"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \" C:\\ \"\"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \" C:\\ \"\"\"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\ ", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\ \"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\ \"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\ \"\"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\ \"\"\"\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"\" C:\\\"", FALSE, TRUE }, + { __LINE__, 1, "cmd /c popd ABC" }, + { __LINE__, 1, "cmd /c popd \" " }, + { __LINE__, 1, "cmd /c popd \"\"" }, + { __LINE__, 1, "cmd /c popd" }, + { __LINE__, 1, "cmd /c pushd ABC", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd C:/Program Files && popd && exit 1234", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd C:\\ C:\\ && popd && exit 1234", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd C:\\Invalid Directory && exit 1234", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd C:\\Invalid Directory && popd && exit 1234", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \" C:\\ ", FALSE, TRUE }, + { __LINE__, 1, "cmd /c pushd \"C:\\ C:\\\" && popd && exit 1234", FALSE, TRUE }, + { __LINE__, 1234, "cmd /c pushd && exit 1234 " }, + { __LINE__, 1234, "cmd /c pushd C:\\ && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd C:\\ \"\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd C:\\Program Files && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:/Program Files/\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:/Program Files\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\ \" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\ \"\"\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\ \"\"\"\"\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\Program Files\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\Program Files\\\" && popd && exit 1234" }, + { __LINE__, 1234, "cmd /c pushd \"C:\\\" && popd && exit 1234" }, +}; + +static BOOL MyDuplicateHandle(HANDLE hFile, PHANDLE phFile, BOOL bInherit) +{ + HANDLE hProcess = GetCurrentProcess(); + return DuplicateHandle(hProcess, hFile, hProcess, phFile, 0, + bInherit, DUPLICATE_SAME_ACCESS); +} + +static BOOL PrepareForRedirect(STARTUPINFOA *psi, PHANDLE phInputWrite, + PHANDLE phOutputRead, PHANDLE phErrorRead) +{ + HANDLE hInputRead = NULL, hInputWriteTmp = NULL; + HANDLE hOutputReadTmp = NULL, hOutputWrite = NULL; + HANDLE hErrorReadTmp = NULL, hErrorWrite = NULL; + SECURITY_ATTRIBUTES sa = { sizeof(sa), NULL, TRUE }; + + psi->hStdInput = NULL; + psi->hStdOutput = NULL; + psi->hStdError = NULL; + + if (phInputWrite) + { + if (CreatePipe(&hInputRead, &hInputWriteTmp, &sa, 0)) + { + if (!MyDuplicateHandle(hInputWriteTmp, phInputWrite, FALSE)) + goto failed; + + CloseHandle(hInputWriteTmp); + } + else + goto failed; + } + + if (phOutputRead) + { + if (CreatePipe(&hOutputReadTmp, &hOutputWrite, &sa, 0)) + { + if (!MyDuplicateHandle(hOutputReadTmp, phOutputRead, FALSE)) + goto failed; + + CloseHandle(hOutputReadTmp); + } + else + goto failed; + } + + if (phOutputRead && phOutputRead == phErrorRead) + { + if (!MyDuplicateHandle(hOutputWrite, &hErrorWrite, TRUE)) + goto failed; + } + else if (phErrorRead) + { + if (CreatePipe(&hErrorReadTmp, &hErrorWrite, &sa, 0)) + { + if (!MyDuplicateHandle(hErrorReadTmp, phErrorRead, FALSE)) + goto failed; + CloseHandle(hErrorReadTmp); + } + else + goto failed; + } + + if (phInputWrite) + psi->hStdInput = hInputRead; + if (phOutputRead) + psi->hStdOutput = hOutputWrite; + if (phErrorRead) + psi->hStdError = hErrorWrite; + + return TRUE; + +failed: + CloseHandle(hInputRead); + CloseHandle(hInputWriteTmp); + CloseHandle(hOutputReadTmp); + CloseHandle(hOutputWrite); + CloseHandle(hErrorReadTmp); + CloseHandle(hErrorWrite); + return FALSE; +} + +static void DoTestEntry(const TEST_ENTRY *pEntry) +{ + STARTUPINFOA si; + PROCESS_INFORMATION pi; + DWORD dwExitCode, dwWait; + HANDLE hOutputRead = NULL; + HANDLE hErrorRead = NULL; + BYTE b; + DWORD dwRead; + BOOL bStdOutput, bStdError; + + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + si.dwFlags = STARTF_USESTDHANDLES; + + if (!PrepareForRedirect(&si, NULL, &hOutputRead, &hErrorRead)) + { + skip("PrepareForRedirect failed\n"); + return; + } + + if (CreateProcessA(NULL, (char *)pEntry->cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) + { + CloseHandle(si.hStdInput); + dwWait = WaitForSingleObject(pi.hProcess, TIMEOUT); + if (dwWait == WAIT_TIMEOUT) + { + TerminateProcess(pi.hProcess, 9999); + } + GetExitCodeProcess(pi.hProcess, &dwExitCode); + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + } + else + { + dwExitCode = 8888; + } + + PeekNamedPipe(hOutputRead, &b, 1, &dwRead, NULL, NULL); + bStdOutput = dwRead != 0; + PeekNamedPipe(hErrorRead, &b, 1, &dwRead, NULL, NULL); + bStdError = dwRead != 0; + + if (si.hStdInput) + CloseHandle(si.hStdInput); + if (si.hStdOutput) + CloseHandle(si.hStdOutput); + if (si.hStdError) + CloseHandle(si.hStdError); + + ok(pEntry->bStdOutput == bStdOutput, + "Line %u: bStdOutput %d vs %d\n", + pEntry->line, pEntry->bStdOutput, bStdOutput); + + ok(pEntry->bStdError == bStdError, + "Line %u: bStdError %d vs %d\n", + pEntry->line, pEntry->bStdError, bStdError); + + ok(pEntry->dwExitCode == dwExitCode, + "Line %u: dwExitCode %ld vs %ld\n", + pEntry->line, pEntry->dwExitCode, dwExitCode); +} + +START_TEST(exit) +{ + SIZE_T i; + for (i = 0; i < ARRAYSIZE(s_exit_entries); ++i) + { + DoTestEntry(&s_exit_entries[i]); + } +} + +START_TEST(echo) +{ + SIZE_T i; + for (i = 0; i < ARRAYSIZE(s_echo_entries); ++i) + { + DoTestEntry(&s_echo_entries[i]); + } +} + +START_TEST(cd) +{ + SIZE_T i; + for (i = 0; i < ARRAYSIZE(s_cd_entries); ++i) + { + DoTestEntry(&s_cd_entries[i]); + } +} + +START_TEST(pushd) +{ + SIZE_T i; + for (i = 0; i < ARRAYSIZE(s_pushd_entries); ++i) + { + DoTestEntry(&s_pushd_entries[i]); + } +} diff --git a/modules/rostests/apitests/cmd/precomp.h b/modules/rostests/apitests/cmd/precomp.h new file mode 100644 index 00000000000..13f2ddb0772 --- /dev/null +++ b/modules/rostests/apitests/cmd/precomp.h @@ -0,0 +1,6 @@ +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include <apitest.h> +#include <windows.h> diff --git a/modules/rostests/apitests/cmd/testlist.c b/modules/rostests/apitests/cmd/testlist.c new file mode 100644 index 00000000000..07ab34a2c97 --- /dev/null +++ b/modules/rostests/apitests/cmd/testlist.c @@ -0,0 +1,16 @@ +#define STANDALONE +#include <apitest.h> + +extern void func_cd(void); +extern void func_echo(void); +extern void func_exit(void); +extern void func_pushd(void); + +const struct test winetest_testlist[] = +{ + { "cd", func_cd }, + { "echo", func_echo }, + { "exit", func_exit }, + { "pushd", func_pushd }, + { 0, 0 } +};
5 years, 1 month
1
0
0
0
[reactos] 01/01: [FREELDR] Fix triple fault with debug on screen
by Dmitry Borisov
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=96040ecff93aa533a64e7…
commit 96040ecff93aa533a64e73ac9aeb568196082959 Author: Dmitry Borisov <di.sean(a)protonmail.com> AuthorDate: Wed Nov 13 22:03:19 2019 +0600 Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Nov 13 22:52:20 2019 +0100 [FREELDR] Fix triple fault with debug on screen Move the trace call after the MachInit() CORE-16507 --- boot/freeldr/freeldr/freeldr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/freeldr/freeldr/freeldr.c b/boot/freeldr/freeldr/freeldr.c index 11c0d462687..c31f5eab3a2 100644 --- a/boot/freeldr/freeldr/freeldr.c +++ b/boot/freeldr/freeldr/freeldr.c @@ -47,10 +47,10 @@ VOID __cdecl BootMain(IN PCCH CmdLine) /* Debugger pre-initialization */ DebugInit(0); - TRACE("BootMain() called.\n"); - MachInit(CmdLine); + TRACE("BootMain() called.\n"); + /* Check if the CPU is new enough */ FrLdrCheckCpuCompatibility(); // FIXME: Should be done inside MachInit!
5 years, 1 month
1
0
0
0
[reactos] 01/01: [SHELLBTRFS] Properly fix AppVeyor build This reverts bb6fece
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=986f6a4b24745211b49ea…
commit 986f6a4b24745211b49ea74c4317b9661473676b Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Wed Nov 13 08:22:13 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Wed Nov 13 08:22:13 2019 +0100 [SHELLBTRFS] Properly fix AppVeyor build This reverts bb6fece --- dll/shellext/shellbtrfs/devices.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/dll/shellext/shellbtrfs/devices.cpp b/dll/shellext/shellbtrfs/devices.cpp index f044151721e..dfa10647256 100755 --- a/dll/shellext/shellbtrfs/devices.cpp +++ b/dll/shellext/shellbtrfs/devices.cpp @@ -237,16 +237,22 @@ static void find_devices(HWND hwnd, const GUID* guid, const mountmgr& mm, vector free(dli); } else { try { - std::vector<mountmgr_point> v; - v = mm.query_points(L"", L"", wstring_view(path.Buffer, path.Length / sizeof(WCHAR))); + auto v = mm.query_points(L"", L"", wstring_view(path.Buffer, path.Length / sizeof(WCHAR))); - for (size_t i = 0; i < v.size(); ++i) - { - const mountmgr_point& p = v[i]; +#ifndef __REACTOS__ + for (const auto& p : v) { if (p.symlink.length() == 14 && p.symlink.substr(0, dosdevices.length()) == dosdevices && p.symlink[13] == ':') { +#else + for(auto p = v.begin(); p != v.end(); ++p) { + if ((*p).symlink.length() == 14 && (*p).symlink.substr(0, dosdevices.length()) == dosdevices && (*p).symlink[13] == ':') { +#endif WCHAR dr[3]; +#ifndef __REACTOS__ dr[0] = p.symlink[12]; +#else + dr[0] = (*p).symlink[12]; +#endif dr[1] = ':'; dr[2] = 0;
5 years, 1 month
1
0
0
0
[reactos] 01/01: [SHELLBTRFS] Fix build (don't use C++11 auto)
by Katayma Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bb6feced9fd659d7811a4…
commit bb6feced9fd659d7811a422b93ad4a07e9c6c3da Author: Katayma Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Wed Nov 13 12:30:33 2019 +0900 Commit: Katayma Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Wed Nov 13 12:30:33 2019 +0900 [SHELLBTRFS] Fix build (don't use C++11 auto) --- dll/shellext/shellbtrfs/devices.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dll/shellext/shellbtrfs/devices.cpp b/dll/shellext/shellbtrfs/devices.cpp index b17f9b25823..f044151721e 100755 --- a/dll/shellext/shellbtrfs/devices.cpp +++ b/dll/shellext/shellbtrfs/devices.cpp @@ -237,9 +237,12 @@ static void find_devices(HWND hwnd, const GUID* guid, const mountmgr& mm, vector free(dli); } else { try { - auto v = mm.query_points(L"", L"", wstring_view(path.Buffer, path.Length / sizeof(WCHAR))); + std::vector<mountmgr_point> v; + v = mm.query_points(L"", L"", wstring_view(path.Buffer, path.Length / sizeof(WCHAR))); - for (const auto& p : v) { + for (size_t i = 0; i < v.size(); ++i) + { + const mountmgr_point& p = v[i]; if (p.symlink.length() == 14 && p.symlink.substr(0, dosdevices.length()) == dosdevices && p.symlink[13] == ':') { WCHAR dr[3];
5 years, 1 month
1
0
0
0
[reactos] 01/01: [NTOS:KDBG] Rewrite the TSS handling code in the backtrace function, removing limitations (and bugs) of the original code. CORE-16448, PR #2003. Supersedes PR #1997.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d21ff0ed137d61b7881af…
commit d21ff0ed137d61b7881af96dd1d6e14387ccb89b Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Oct 28 01:01:23 2019 +0100 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Wed Nov 13 02:14:48 2019 +0100 [NTOS:KDBG] Rewrite the TSS handling code in the backtrace function, removing limitations (and bugs) of the original code. CORE-16448, PR #2003. Supersedes PR #1997. This commit supersedes commit 6c5c7809 (r54503). The original code was checking for the NMI or Double-Fault TSS by comparing the current stack-traced EIP address with their corresponding trap handler address ranges. That method was actually buggy because nothing was ensuring that the trap handlers were in the "expected" order in the kernel binary (and in memory). Instead, we now can handle completely generic nested TSSes, instead of just the NMI or the Double-Fault ones. The way we proceed is by performing the full stack backtrace of the current TSS, then once finished we check whether this TSS is nested (has a parent). If so we change the (cached) current TSS to the latter, restarting the backtrace at the parent TSS' latest EIP. Examples of stack backtraces: ============================= - General Protection fault: <snip> *** Fatal System Error: 0x0000007f (0x0000000D,0x00000000,0x00000000,0x00000000) Entered debugger on embedded INT3 at 0x0008:0x80953528. kdb:> bt Eip: <ntoskrnl.exe:153529 (sdk/lib/rtl/i386/debug_asm.S:57 (RtlpBreakWithStatusInstruction))> Frames: <ntoskrnl.exe:899b0 (ntoskrnl/ke/bug.c:1136 (KeBugCheckWithTf))> <ntoskrnl.exe:134826 (ntoskrnl/ke/i386/exp.c:1161 (KeRaiseUserException))> <ntoskrnl.exe:19ae67 (ntoskrnl/ke/i386/traphdlr.c:1282 (KiTrap0DHandler))> <ntoskrnl.exe:19a840 (:0 (KiTrap0D))> <ntoskrnl.exe:1925e6 (ntoskrnl/include/internal/i386/intrin_i.h:45 (KiInitMachineDependent))> <ntoskrnl.exe:187688 (ntoskrnl/ke/krnlinit.c:305 (KeInitSystem))> <ntoskrnl.exe:17fb2f (ntoskrnl/ex/init.c:1621 (Phase1InitializationDiscard))> <ntoskrnl.exe:3247f (ntoskrnl/ex/init.c:2019 (Phase1Initialization))> <ntoskrnl.exe:11c079 (ntoskrnl/ps/thread.c:156 (PspSystemThreadStartup))> <ntoskrnl.exe:135c8a (ntoskrnl/ke/i386/thrdini.c:78 (KiThreadStartup))> <ntoskrnl.exe:11c040 (ntoskrnl/ps/thread.c:141 (PspSystemThreadStartup))> <5d8950ec> Couldn't access memory at 0x83E58959! </snip> - Double-fault (manually triggered by removing the GP handler): Note how the backtrace explicitly specifies the crossed TSS boundaries, and the trace in the parent TSS is indeed consistent with the previous example. Note also that log2lines (used here to completely resolve the trace) failed to see KiTrap08Handler(), which has been instead mistaken for KiTrap09(). <snip> *** Fatal System Error: 0x0000007f (0x00000008,0x8009C000,0x00000000,0x00000000) Entered debugger on embedded INT3 at 0x0008:0x80953528. kdb:> bt [Active TSS 0x0050 @ 0x80A10CA0] Eip: <ntoskrnl.exe:153529 (sdk/lib/rtl/i386/debug_asm.S:57 (RtlpBreakWithStatusInstruction))> Frames: <ntoskrnl.exe:899b0 (ntoskrnl/ke/bug.c:1136 (KeBugCheckWithTf))> <ntoskrnl.exe:19a1d8 (ntoskrnl/ke/i386/traphdlr.c:917 (KiTrap09))> // <-- Here, log2lines fails to see it's actually KiTrap08Handler. <ntoskrnl.exe:19a145 (:0 (KiTrap08))> [Parent TSS 0x0028 @ 0x8009C000] <ntoskrnl.exe:1925e6 (ntoskrnl/include/internal/i386/intrin_i.h:45 (KiInitMachineDependent))> <ntoskrnl.exe:187688 (ntoskrnl/ke/krnlinit.c:305 (KeInitSystem))> <ntoskrnl.exe:17fb2f (ntoskrnl/ex/init.c:1621 (Phase1InitializationDiscard))> <ntoskrnl.exe:3247f (ntoskrnl/ex/init.c:2019 (Phase1Initialization))> <ntoskrnl.exe:11c079 (ntoskrnl/ps/thread.c:156 (PspSystemThreadStartup))> <ntoskrnl.exe:135c8a (ntoskrnl/ke/i386/thrdini.c:78 (KiThreadStartup))> <ntoskrnl.exe:11c040 (ntoskrnl/ps/thread.c:141 (PspSystemThreadStartup))> <5d8950ec> Couldn't access memory at 0x83E58959! </snip> --- ntoskrnl/kdbg/kdb_cli.c | 186 ++++++++++++++++++++++++++---------------------- 1 file changed, 102 insertions(+), 84 deletions(-) diff --git a/ntoskrnl/kdbg/kdb_cli.c b/ntoskrnl/kdbg/kdb_cli.c index fd93246afa7..abf2e6d84aa 100644 --- a/ntoskrnl/kdbg/kdb_cli.c +++ b/ntoskrnl/kdbg/kdb_cli.c @@ -1033,86 +1033,73 @@ KdbpRetrieveTss( return Tss; } -static BOOLEAN -KdbpTrapFrameFromPrevTss( - PKTRAP_FRAME TrapFrame) +FORCEINLINE BOOLEAN +KdbpIsNestedTss( + IN USHORT TssSelector, + IN PKTSS Tss) { - ULONG_PTR Eip, Ebp; - KDESCRIPTOR Gdtr; - KGDTENTRY Desc; - USHORT Sel; - PKTSS Tss; - - Ke386GetGlobalDescriptorTable(&Gdtr.Limit); - Sel = Ke386GetTr(); + USHORT Backlink; - if ((Sel & (sizeof(KGDTENTRY) - 1)) || - (Sel < sizeof(KGDTENTRY)) || - (Sel + sizeof(KGDTENTRY) - 1 > Gdtr.Limit)) + if (!Tss) return FALSE; - if (!NT_SUCCESS(KdbpSafeReadMemory(&Desc, - (PVOID)(Gdtr.Base + Sel), - sizeof(KGDTENTRY)))) + /* Retrieve the TSS Backlink */ + if (!NT_SUCCESS(KdbpSafeReadMemory(&Backlink, + (PVOID)&Tss->Backlink, + sizeof(USHORT)))) + { return FALSE; + } - if (Desc.HighWord.Bits.Type != 0xB) - return FALSE; + return (Backlink != 0 && Backlink != TssSelector); +} - Tss = (PKTSS)(ULONG_PTR)(Desc.BaseLow | - Desc.HighWord.Bytes.BaseMid << 16 | - Desc.HighWord.Bytes.BaseHi << 24); +static BOOLEAN +KdbpTrapFrameFromPrevTss( + IN OUT PKTRAP_FRAME TrapFrame, + OUT PUSHORT TssSelector, + IN OUT PKTSS* pTss, + IN PKDESCRIPTOR pGdtr) +{ + ULONG_PTR Eip, Ebp; + USHORT Backlink; + PKTSS Tss = *pTss; - if (!NT_SUCCESS(KdbpSafeReadMemory(&Sel, + /* Retrieve the TSS Backlink */ + if (!NT_SUCCESS(KdbpSafeReadMemory(&Backlink, (PVOID)&Tss->Backlink, sizeof(USHORT)))) + { return FALSE; + } - if ((Sel & (sizeof(KGDTENTRY) - 1)) || - (Sel < sizeof(KGDTENTRY)) || - (Sel + sizeof(KGDTENTRY) - 1 > Gdtr.Limit)) - return FALSE; - - if (!NT_SUCCESS(KdbpSafeReadMemory(&Desc, - (PVOID)(Gdtr.Base + Sel), - sizeof(KGDTENTRY)))) - return FALSE; - - if (Desc.HighWord.Bits.Type != 0xB) + /* Retrieve the parent TSS */ + Tss = KdbpRetrieveTss(Backlink, NULL, pGdtr); + if (!Tss) return FALSE; - Tss = (PKTSS)(ULONG_PTR)(Desc.BaseLow | - Desc.HighWord.Bytes.BaseMid << 16 | - Desc.HighWord.Bytes.BaseHi << 24); - if (!NT_SUCCESS(KdbpSafeReadMemory(&Eip, (PVOID)&Tss->Eip, sizeof(ULONG_PTR)))) + { return FALSE; + } if (!NT_SUCCESS(KdbpSafeReadMemory(&Ebp, (PVOID)&Tss->Ebp, sizeof(ULONG_PTR)))) + { return FALSE; + } + /* Return the parent TSS and its trap frame */ + *TssSelector = Backlink; + *pTss = Tss; TrapFrame->Eip = Eip; TrapFrame->Ebp = Ebp; return TRUE; } -VOID __cdecl KiTrap02(VOID); -VOID FASTCALL KiTrap03Handler(IN PKTRAP_FRAME); -VOID __cdecl KiTrap08(VOID); -VOID __cdecl KiTrap09(VOID); - -static BOOLEAN -KdbpInNmiOrDoubleFaultHandler( - ULONG_PTR Address) -{ - return (Address > (ULONG_PTR)KiTrap02 && Address < (ULONG_PTR)KiTrap03Handler) || - (Address > (ULONG_PTR)KiTrap08 && Address < (ULONG_PTR)KiTrap09); -} - /*!\brief Displays a backtrace. */ static BOOLEAN @@ -1122,15 +1109,17 @@ KdbpCmdBackTrace( { ULONG ul; ULONGLONG Result = 0; - ULONG_PTR Frame = KdbCurrentTrapFrame->Tf.Ebp; + KTRAP_FRAME TrapFrame = KdbCurrentTrapFrame->Tf; + ULONG_PTR Frame = TrapFrame.Ebp; ULONG_PTR Address; - KTRAP_FRAME TrapFrame; + KDESCRIPTOR Gdtr; + USHORT TssSelector; + PKTSS Tss; if (Argc >= 2) { /* Check for [L count] part */ ul = 0; - if (strcmp(Argv[Argc-2], "L") == 0) { ul = strtoul(Argv[Argc-1], NULL, 0); @@ -1157,7 +1146,7 @@ KdbpCmdBackTrace( Argc++; } - /* Check if frame addr or thread id is given. */ + /* Check if a Frame Address or Thread ID is given */ if (Argc > 1) { if (Argv[1][0] == '*') @@ -1169,7 +1158,7 @@ KdbpCmdBackTrace( return TRUE; if (Result > (ULONGLONG)(~((ULONG_PTR)0))) - KdbpPrint("Warning: Address %I64x is beeing truncated\n",Result); + KdbpPrint("Warning: Address %I64x is beeing truncated\n", Result); Frame = (ULONG_PTR)Result; } @@ -1179,66 +1168,95 @@ KdbpCmdBackTrace( return TRUE; } } - else + + /* Retrieve the Global Descriptor Table */ + Ke386GetGlobalDescriptorTable(&Gdtr.Limit); + + /* Retrieve the current (active) TSS */ + TssSelector = Ke386GetTr(); + Tss = KdbpRetrieveTss(TssSelector, NULL, &Gdtr); + if (KdbpIsNestedTss(TssSelector, Tss)) { - KdbpPrint("Eip:\n"); + /* Display the active TSS if it is nested */ + KdbpPrint("[Active TSS 0x%04x @ 0x%p]\n", TssSelector, Tss); + } - /* Try printing the function at EIP */ - if (!KdbSymPrintAddress((PVOID)KdbCurrentTrapFrame->Tf.Eip, &KdbCurrentTrapFrame->Tf)) - KdbpPrint("<%08x>\n", KdbCurrentTrapFrame->Tf.Eip); + /* If no Frame Address or Thread ID was given, try printing the function at EIP */ + if (Argc <= 1) + { + KdbpPrint("Eip:\n"); + if (!KdbSymPrintAddress((PVOID)TrapFrame.Eip, &TrapFrame)) + KdbpPrint("<%08x>\n", TrapFrame.Eip); else KdbpPrint("\n"); } - TrapFrame = KdbCurrentTrapFrame->Tf; + /* Walk through the frames */ KdbpPrint("Frames:\n"); - for (;;) { BOOLEAN GotNextFrame; if (Frame == 0) - break; + goto CheckForParentTSS; - if (!NT_SUCCESS(KdbpSafeReadMemory(&Address, (PVOID)(Frame + sizeof(ULONG_PTR)), sizeof (ULONG_PTR)))) + Address = 0; + if (!NT_SUCCESS(KdbpSafeReadMemory(&Address, (PVOID)(Frame + sizeof(ULONG_PTR)), sizeof(ULONG_PTR)))) { KdbpPrint("Couldn't access memory at 0x%p!\n", Frame + sizeof(ULONG_PTR)); - break; + goto CheckForParentTSS; } - if ((GotNextFrame = NT_SUCCESS(KdbpSafeReadMemory(&Frame, (PVOID)Frame, sizeof (ULONG_PTR))))) + if (Address == 0) + goto CheckForParentTSS; + + GotNextFrame = NT_SUCCESS(KdbpSafeReadMemory(&Frame, (PVOID)Frame, sizeof(ULONG_PTR))); + if (GotNextFrame) TrapFrame.Ebp = Frame; + // else + // Frame = 0; - /* Print the location of the call instruction */ + /* Print the location of the call instruction (assumed 5 bytes length) */ if (!KdbSymPrintAddress((PVOID)(Address - 5), &TrapFrame)) KdbpPrint("<%08x>\n", Address); else KdbpPrint("\n"); - if (KdbOutputAborted) break; - - if (Address == 0) + if (KdbOutputAborted) break; - if (KdbpInNmiOrDoubleFaultHandler(Address)) + if (!GotNextFrame) { - if ((GotNextFrame = KdbpTrapFrameFromPrevTss(&TrapFrame))) - { - Address = TrapFrame.Eip; - Frame = TrapFrame.Ebp; - - if (!KdbSymPrintAddress((PVOID)Address, &TrapFrame)) - KdbpPrint("<%08x>\n", Address); - else - KdbpPrint("\n"); - } + KdbpPrint("Couldn't access memory at 0x%p!\n", Frame); + goto CheckForParentTSS; // break; } + continue; + +CheckForParentTSS: + /* + * We have ended the stack walking for the current (active) TSS. + * Check whether this TSS was nested, and if so switch to its parent + * and walk its stack. + */ + if (!KdbpIsNestedTss(TssSelector, Tss)) + break; // The TSS is not nested, we stop there. + + GotNextFrame = KdbpTrapFrameFromPrevTss(&TrapFrame, &TssSelector, &Tss, &Gdtr); if (!GotNextFrame) { - KdbpPrint("Couldn't access memory at 0x%p!\n", Frame); - break; + KdbpPrint("Couldn't access parent TSS 0x%04x\n", Tss->Backlink); + break; // Cannot retrieve the parent TSS, we stop there. } + Address = TrapFrame.Eip; + Frame = TrapFrame.Ebp; + + KdbpPrint("[Parent TSS 0x%04x @ 0x%p]\n", TssSelector, Tss); + + if (!KdbSymPrintAddress((PVOID)Address, &TrapFrame)) + KdbpPrint("<%08x>\n", Address); + else + KdbpPrint("\n"); } return TRUE;
5 years, 1 month
1
0
0
0
[reactos] 01/01: [COMCTL32] Beautification addendum CORE-16466
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f9e4d810569becc76ddef…
commit f9e4d810569becc76ddefbcda22864e3cbc861c6 Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Wed Nov 13 01:22:00 2019 +0100 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Wed Nov 13 01:22:00 2019 +0100 [COMCTL32] Beautification addendum CORE-16466 I overlooked those missing white-spaces in 0.4.14-dev-312-g b931f643e35e6a23dbef99e785804039ea579b6a No functional change. --- dll/win32/comctl32/listview.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index 79012f8a1f1..7aa9c4c611c 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -2127,12 +2127,12 @@ static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr) { vertInfo.nMax = infoPtr->nItemCount; - /* scroll by at least one page */ - if (vertInfo.nPage < infoPtr->nItemHeight) - vertInfo.nPage = infoPtr->nItemHeight; + /* scroll by at least one page */ + if (vertInfo.nPage < infoPtr->nItemHeight) + vertInfo.nPage = infoPtr->nItemHeight; - if (infoPtr->nItemHeight > 0) - vertInfo.nPage /= infoPtr->nItemHeight; + if (infoPtr->nItemHeight > 0) + vertInfo.nPage /= infoPtr->nItemHeight; } #else vertInfo.nMax = infoPtr->nItemCount;
5 years, 1 month
1
0
0
0
[reactos] 01/01: [COMCTL32] Fix listview scrollbars flashing CORE-16466
by Joachim Henze
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b931f643e35e6a23dbef9…
commit b931f643e35e6a23dbef99e785804039ea579b6a Author: Joachim Henze <Joachim.Henze(a)reactos.org> AuthorDate: Wed Nov 13 00:30:00 2019 +0100 Commit: Joachim Henze <Joachim.Henze(a)reactos.org> CommitDate: Wed Nov 13 00:30:00 2019 +0100 [COMCTL32] Fix listview scrollbars flashing CORE-16466 Many Thanks to patches author JIRA user 'I_Kill_Bugs', but also to Doug Lyons and Fabian Maurer. Unhidden by SVN r75735 == git 0.4.7-dev-168-g 6af37fd54e53658bb4d832d01e4ee2546af98835 I will merge that back into 0.4.13-RC as well. --- dll/win32/comctl32/listview.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index 764a127f78b..79012f8a1f1 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -2088,6 +2088,9 @@ static INT LISTVIEW_UpdateHScroll(LISTVIEW_INFO *infoPtr) horzInfo.fMask = SIF_RANGE | SIF_PAGE; horzInfo.nMax = max(horzInfo.nMax - 1, 0); +#ifdef __REACTOS__ /* CORE-16466 part 1 of 4 */ + horzInfo.nMax = (horzInfo.nPage == 0 ? 0 : horzInfo.nMax); +#endif dx = GetScrollPos(infoPtr->hwndSelf, SB_HORZ); dx -= SetScrollInfo(infoPtr->hwndSelf, SB_HORZ, &horzInfo, TRUE); TRACE("horzInfo=%s\n", debugscrollinfo(&horzInfo)); @@ -2111,10 +2114,27 @@ static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr) ZeroMemory(&vertInfo, sizeof(SCROLLINFO)); vertInfo.cbSize = sizeof(SCROLLINFO); +#ifdef __REACTOS__ /* CORE-16466 part 2 of 4 */ + vertInfo.nPage = max((infoPtr->rcList.bottom - infoPtr->rcList.top), 0); +#else vertInfo.nPage = infoPtr->rcList.bottom - infoPtr->rcList.top; +#endif if (infoPtr->uView == LV_VIEW_DETAILS) { +#ifdef __REACTOS__ /* CORE-16466 part 3 of 4 */ + if (vertInfo.nPage != 0) + { + vertInfo.nMax = infoPtr->nItemCount; + + /* scroll by at least one page */ + if (vertInfo.nPage < infoPtr->nItemHeight) + vertInfo.nPage = infoPtr->nItemHeight; + + if (infoPtr->nItemHeight > 0) + vertInfo.nPage /= infoPtr->nItemHeight; + } +#else vertInfo.nMax = infoPtr->nItemCount; /* scroll by at least one page */ @@ -2123,6 +2143,7 @@ static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr) if (infoPtr->nItemHeight > 0) vertInfo.nPage /= infoPtr->nItemHeight; +#endif } else if (infoPtr->uView != LV_VIEW_LIST) /* LV_VIEW_ICON, or LV_VIEW_SMALLICON */ { @@ -2133,6 +2154,9 @@ static INT LISTVIEW_UpdateVScroll(LISTVIEW_INFO *infoPtr) vertInfo.fMask = SIF_RANGE | SIF_PAGE; vertInfo.nMax = max(vertInfo.nMax - 1, 0); +#ifdef __REACTOS__ /* CORE-16466 part 4 of 4 */ + vertInfo.nMax = (vertInfo.nPage == 0 ? 0 : vertInfo.nMax); +#endif dy = GetScrollPos(infoPtr->hwndSelf, SB_VERT); dy -= SetScrollInfo(infoPtr->hwndSelf, SB_VERT, &vertInfo, TRUE); TRACE("vertInfo=%s\n", debugscrollinfo(&vertInfo));
5 years, 1 month
1
0
0
0
[reactos] 01/01: [BTRFS] Fix MSVC build
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=cc5c307b8ed889289febb…
commit cc5c307b8ed889289febb8d190b003005259b4f5 Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Wed Nov 13 00:03:22 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Wed Nov 13 00:03:22 2019 +0100 [BTRFS] Fix MSVC build --- drivers/filesystems/btrfs/btrfs_drv.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/filesystems/btrfs/btrfs_drv.h b/drivers/filesystems/btrfs/btrfs_drv.h index e24e4980244..24307d93810 100644 --- a/drivers/filesystems/btrfs/btrfs_drv.h +++ b/drivers/filesystems/btrfs/btrfs_drv.h @@ -1588,6 +1588,7 @@ void __stdcall check_system_root(PDRIVER_OBJECT DriverObject, PVOID Context, ULO // based on function in sys/sysmacros.h #define makedev(major, minor) (((minor) & 0xFF) | (((major) & 0xFFF) << 8) | (((uint64_t)((minor) & ~0xFF)) << 12) | (((uint64_t)((major) & ~0xFFF)) << 32)) +#ifndef __REACTOS__ // not in mingw yet #ifndef _MSC_VER typedef struct { @@ -1608,6 +1609,22 @@ typedef struct { #else #define FSRTL_ADVANCED_FCB_HEADER_NEW FSRTL_ADVANCED_FCB_HEADER #endif +#else +typedef struct { + FSRTL_COMMON_FCB_HEADER DUMMYSTRUCTNAME; + PFAST_MUTEX FastMutex; + LIST_ENTRY FilterContexts; + EX_PUSH_LOCK PushLock; + PVOID* FileContextSupportPointer; + union { + OPLOCK Oplock; + PVOID ReservedForRemote; + }; + PVOID ReservedContext; +} FSRTL_ADVANCED_FCB_HEADER_NEW; + +#define FSRTL_FCB_HEADER_V2 2 +#endif static __inline POPLOCK fcb_oplock(fcb* fcb) { if (fcb->Header.Version >= FSRTL_FCB_HEADER_V2)
5 years, 1 month
1
0
0
0
[reactos] 01/01: [SHELLBTRFS] Addendum to 1725ddf
by Pierre Schweitzer
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=45a643a136eedf8b39d22…
commit 45a643a136eedf8b39d22f5add94fd372320fdee Author: Pierre Schweitzer <pierre(a)reactos.org> AuthorDate: Tue Nov 12 23:46:53 2019 +0100 Commit: Pierre Schweitzer <pierre(a)reactos.org> CommitDate: Tue Nov 12 23:46:53 2019 +0100 [SHELLBTRFS] Addendum to 1725ddf --- dll/shellext/shellbtrfs/contextmenu.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/dll/shellext/shellbtrfs/contextmenu.cpp b/dll/shellext/shellbtrfs/contextmenu.cpp index 3fbca1cb7c2..bf4b5e92c09 100755 --- a/dll/shellext/shellbtrfs/contextmenu.cpp +++ b/dll/shellext/shellbtrfs/contextmenu.cpp @@ -833,15 +833,25 @@ void BtrfsContextMenu::reflink_copy(HWND hwnd, const WCHAR* fn, const WCHAR* dir streambufsize += 0x1000; streambuf.resize(streambufsize); +#ifndef __REACTOS__ memset(streambuf.data(), 0, streambufsize); Status = NtQueryInformationFile(source, &iosb, streambuf.data(), streambufsize, FileStreamInformation); +#else + memset(&streambuf[0], 0, streambufsize); + + Status = NtQueryInformationFile(source, &iosb, &streambuf[0], streambufsize, FileStreamInformation); +#endif } while (Status == STATUS_BUFFER_OVERFLOW); if (!NT_SUCCESS(Status)) throw ntstatus_error(Status); +#ifndef __REACTOS__ auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(streambuf.data()); +#else + auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(&streambuf[0]); +#endif while (true) { if (fsi->StreamNameLength > 0) { @@ -1525,15 +1535,25 @@ static void reflink_copy2(const wstring& srcfn, const wstring& destdir, const ws streambufsize += 0x1000; streambuf.resize(streambufsize); +#ifndef __REACTOS__ memset(streambuf.data(), 0, streambufsize); Status = NtQueryInformationFile(source, &iosb, streambuf.data(), streambufsize, FileStreamInformation); +#else + memset(&streambuf[0], 0, streambufsize); + + Status = NtQueryInformationFile(source, &iosb, &streambuf[0], streambufsize, FileStreamInformation); +#endif } while (Status == STATUS_BUFFER_OVERFLOW); if (!NT_SUCCESS(Status)) throw ntstatus_error(Status); +#ifndef __REACTOS__ auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(streambuf.data()); +#else + auto fsi = reinterpret_cast<FILE_STREAM_INFORMATION*>(&streambuf[0]); +#endif while (true) { if (fsi->StreamNameLength > 0) {
5 years, 1 month
1
0
0
0
← Newer
1
...
17
18
19
20
21
22
23
...
33
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
24
25
26
27
28
29
30
31
32
33
Results per page:
10
25
50
100
200