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
December 2021
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
33 participants
155 discussions
Start a n
N
ew thread
[reactos] 01/01: [MSPAINT] Delete filename extension .png from IDS_DEFAULTFILENAME
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=50cb4b3cb76da023bb836…
commit 50cb4b3cb76da023bb83676fd4dc4e6b2f116aaa Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Dec 25 22:52:56 2021 +0900 Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> CommitDate: Sat Dec 25 22:52:56 2021 +0900 [MSPAINT] Delete filename extension .png from IDS_DEFAULTFILENAME --- base/applications/mspaint/lang/bg-BG.rc | 2 +- base/applications/mspaint/lang/cs-CZ.rc | 2 +- base/applications/mspaint/lang/de-DE.rc | 2 +- base/applications/mspaint/lang/en-GB.rc | 2 +- base/applications/mspaint/lang/en-US.rc | 2 +- base/applications/mspaint/lang/es-ES.rc | 2 +- base/applications/mspaint/lang/et-EE.rc | 2 +- base/applications/mspaint/lang/eu-ES.rc | 2 +- base/applications/mspaint/lang/fr-FR.rc | 2 +- base/applications/mspaint/lang/he-IL.rc | 2 +- base/applications/mspaint/lang/hu-HU.rc | 2 +- base/applications/mspaint/lang/id-ID.rc | 2 +- base/applications/mspaint/lang/it-IT.rc | 2 +- base/applications/mspaint/lang/ja-JP.rc | 2 +- base/applications/mspaint/lang/nl-NL.rc | 2 +- base/applications/mspaint/lang/no-NO.rc | 2 +- base/applications/mspaint/lang/pl-PL.rc | 2 +- base/applications/mspaint/lang/pt-BR.rc | 2 +- base/applications/mspaint/lang/pt-PT.rc | 2 +- base/applications/mspaint/lang/ro-RO.rc | 2 +- base/applications/mspaint/lang/ru-RU.rc | 2 +- base/applications/mspaint/lang/sk-SK.rc | 2 +- base/applications/mspaint/lang/sq-AL.rc | 2 +- base/applications/mspaint/lang/sv-SE.rc | 2 +- base/applications/mspaint/lang/tr-TR.rc | 2 +- base/applications/mspaint/lang/uk-UA.rc | 2 +- base/applications/mspaint/lang/vi-VN.rc | 2 +- base/applications/mspaint/lang/zh-CN.rc | 2 +- base/applications/mspaint/lang/zh-TW.rc | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/base/applications/mspaint/lang/bg-BG.rc b/base/applications/mspaint/lang/bg-BG.rc index dc910abb2a2..92c323ac436 100644 --- a/base/applications/mspaint/lang/bg-BG.rc +++ b/base/applications/mspaint/lang/bg-BG.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Рисувач (Paint) за РеактОС" IDS_INFOTEXT "Достъпен под GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Искате ли да запишете промените в %s?" - IDS_DEFAULTFILENAME "Без име.png" + IDS_DEFAULTFILENAME "Без име" IDS_MINIATURETITLE "Изображенийце" IDS_TOOLTIP1 "Свободно избиране" IDS_TOOLTIP2 "Избор" diff --git a/base/applications/mspaint/lang/cs-CZ.rc b/base/applications/mspaint/lang/cs-CZ.rc index 9d10d56cfad..edec2e6e387 100644 --- a/base/applications/mspaint/lang/cs-CZ.rc +++ b/base/applications/mspaint/lang/cs-CZ.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS Malování" IDS_INFOTEXT "Dostupné pod licencí GNU Lesser General Public License (LGPL, viz.
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Chcete uložit provedené změny v %s?" - IDS_DEFAULTFILENAME "Bez názvu.png" + IDS_DEFAULTFILENAME "Bez názvu" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Volný výběr" IDS_TOOLTIP2 "Výběr" diff --git a/base/applications/mspaint/lang/de-DE.rc b/base/applications/mspaint/lang/de-DE.rc index 3deddc804a5..e04703b521f 100644 --- a/base/applications/mspaint/lang/de-DE.rc +++ b/base/applications/mspaint/lang/de-DE.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint für ReactOS" IDS_INFOTEXT "Unter der GNU Lesser General Public License stehen (LGPL, siehe
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Möchten Sie die Änderungen an %s speichern?" - IDS_DEFAULTFILENAME "Unbenannt.png" + IDS_DEFAULTFILENAME "Unbenannt" IDS_MINIATURETITLE "Miniaturansicht" IDS_TOOLTIP1 "Freie Auswahl" IDS_TOOLTIP2 "Auswahl" diff --git a/base/applications/mspaint/lang/en-GB.rc b/base/applications/mspaint/lang/en-GB.rc index f693c30c324..dfd26d3fa3e 100644 --- a/base/applications/mspaint/lang/en-GB.rc +++ b/base/applications/mspaint/lang/en-GB.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Do you want to save the changes to %s?" - IDS_DEFAULTFILENAME "Unnamed.png" + IDS_DEFAULTFILENAME "Unnamed" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Free selection" IDS_TOOLTIP2 "Selection" diff --git a/base/applications/mspaint/lang/en-US.rc b/base/applications/mspaint/lang/en-US.rc index 997aeb272b1..28e99c10520 100644 --- a/base/applications/mspaint/lang/en-US.rc +++ b/base/applications/mspaint/lang/en-US.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Do you want to save the changes to %s?" - IDS_DEFAULTFILENAME "Unnamed.png" + IDS_DEFAULTFILENAME "Unnamed" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Free selection" IDS_TOOLTIP2 "Selection" diff --git a/base/applications/mspaint/lang/es-ES.rc b/base/applications/mspaint/lang/es-ES.rc index c01966069da..1c625d8720e 100644 --- a/base/applications/mspaint/lang/es-ES.rc +++ b/base/applications/mspaint/lang/es-ES.rc @@ -200,7 +200,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponible bajo los términos de la GNU Lesser General Public License (LGPL, ver
www.gnu.org
)" IDS_SAVEPROMPTTEXT "¿Guardar cambios a %s?" - IDS_DEFAULTFILENAME "Sin título.png" + IDS_DEFAULTFILENAME "Sin título" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Selección de forma libre" IDS_TOOLTIP2 "Selección" diff --git a/base/applications/mspaint/lang/et-EE.rc b/base/applications/mspaint/lang/et-EE.rc index 7d9bb78cff2..8c9a13f8a99 100644 --- a/base/applications/mspaint/lang/et-EE.rc +++ b/base/applications/mspaint/lang/et-EE.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint ReactOS'ile" IDS_INFOTEXT "On saadaval ""GNU Lesser General Public License"" litsentsi all (LGPL, vaata
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Kas soovid salvesta muudatusi failis %s?" - IDS_DEFAULTFILENAME "Nimetu.png" + IDS_DEFAULTFILENAME "Nimetu" IDS_MINIATURETITLE "Miniatuur" IDS_TOOLTIP1 "Vaba valik" IDS_TOOLTIP2 "Valik" diff --git a/base/applications/mspaint/lang/eu-ES.rc b/base/applications/mspaint/lang/eu-ES.rc index ee3420337a0..1229441af00 100644 --- a/base/applications/mspaint/lang/eu-ES.rc +++ b/base/applications/mspaint/lang/eu-ES.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "ReactOS-ko Paint" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, ver
www.gnu.org
)" IDS_SAVEPROMPTTEXT "%s aldaketak gorde nahi duzu?" - IDS_DEFAULTFILENAME "Izegabea.png" + IDS_DEFAULTFILENAME "Izegabea" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Hautatu forma librea" IDS_TOOLTIP2 "Hautatu" diff --git a/base/applications/mspaint/lang/fr-FR.rc b/base/applications/mspaint/lang/fr-FR.rc index 817d56c68d7..2be2fa59f89 100644 --- a/base/applications/mspaint/lang/fr-FR.rc +++ b/base/applications/mspaint/lang/fr-FR.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint pour ReactOS" IDS_INFOTEXT "Mis à disposition sous la Licence publique générale limitée GNU (LGPL, voir
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Voulez-vous enregistrer les modifications de %s?" - IDS_DEFAULTFILENAME "Sans titre.png" + IDS_DEFAULTFILENAME "Sans titre" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Sélection libre" IDS_TOOLTIP2 "Sélection" diff --git a/base/applications/mspaint/lang/he-IL.rc b/base/applications/mspaint/lang/he-IL.rc index 69be3cc28e7..1e16cb261cb 100644 --- a/base/applications/mspaint/lang/he-IL.rc +++ b/base/applications/mspaint/lang/he-IL.rc @@ -193,7 +193,7 @@ BEGIN IDS_INFOTITLE "צייר עבור ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "האם ברצונך לשמור את השינויים של %s?" - IDS_DEFAULTFILENAME "ללא שם.png" + IDS_DEFAULTFILENAME "ללא שם" IDS_MINIATURETITLE "ממוזער" IDS_TOOLTIP1 "בחירה חופשית" IDS_TOOLTIP2 "בחירה" diff --git a/base/applications/mspaint/lang/hu-HU.rc b/base/applications/mspaint/lang/hu-HU.rc index eeaf93d4e4f..dcdce5c35c2 100644 --- a/base/applications/mspaint/lang/hu-HU.rc +++ b/base/applications/mspaint/lang/hu-HU.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "ReactOS Paint" IDS_INFOTEXT "A GNU Lesser General Public License (LGPL) alatt érhető el (lásd
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Kívánja menteni %s változásait?" - IDS_DEFAULTFILENAME "Névtelen.png" + IDS_DEFAULTFILENAME "Névtelen" IDS_MINIATURETITLE "Miniatúra" IDS_TOOLTIP1 "Szabadkézi kijelölés" IDS_TOOLTIP2 "Kijelölés" diff --git a/base/applications/mspaint/lang/id-ID.rc b/base/applications/mspaint/lang/id-ID.rc index 47626c79a07..771ff0d1753 100644 --- a/base/applications/mspaint/lang/id-ID.rc +++ b/base/applications/mspaint/lang/id-ID.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint untuk ReactOS" IDS_INFOTEXT "Tersedia di bawah GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Ingin menyimpan perubahan untuk %s?" - IDS_DEFAULTFILENAME "Tanpa Nama.png" + IDS_DEFAULTFILENAME "Tanpa Nama" IDS_MINIATURETITLE "Miniatur" IDS_TOOLTIP1 "Pilihan Bebas" IDS_TOOLTIP2 "Pilihan" diff --git a/base/applications/mspaint/lang/it-IT.rc b/base/applications/mspaint/lang/it-IT.rc index e07ee23a48b..d69c4253f4a 100644 --- a/base/applications/mspaint/lang/it-IT.rc +++ b/base/applications/mspaint/lang/it-IT.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint per ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Volete salvare le modifiche a %s?" - IDS_DEFAULTFILENAME "SenzaNome.png" + IDS_DEFAULTFILENAME "SenzaNome" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Selezione libera" IDS_TOOLTIP2 "Selezione" diff --git a/base/applications/mspaint/lang/ja-JP.rc b/base/applications/mspaint/lang/ja-JP.rc index 72269792c6e..bd41821e3fb 100644 --- a/base/applications/mspaint/lang/ja-JP.rc +++ b/base/applications/mspaint/lang/ja-JP.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS ペイント" IDS_INFOTEXT "GNU Lesser General Public License (LGPL, 詳細は
www.gnu.org
) の下で利用可能です。" IDS_SAVEPROMPTTEXT "%s の変更内容を保存しますか?" - IDS_DEFAULTFILENAME "無題.png" + IDS_DEFAULTFILENAME "無題" IDS_MINIATURETITLE "縮小図" IDS_TOOLTIP1 "自由選択" IDS_TOOLTIP2 "選択" diff --git a/base/applications/mspaint/lang/nl-NL.rc b/base/applications/mspaint/lang/nl-NL.rc index 40068652119..d6ad4ed0279 100644 --- a/base/applications/mspaint/lang/nl-NL.rc +++ b/base/applications/mspaint/lang/nl-NL.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Wilt u de wijzigingen die zijn aangebracht in %s opslaan?" - IDS_DEFAULTFILENAME "Naamloos.png" + IDS_DEFAULTFILENAME "Naamloos" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Vrij selecteren" IDS_TOOLTIP2 "Selecteren" diff --git a/base/applications/mspaint/lang/no-NO.rc b/base/applications/mspaint/lang/no-NO.rc index de234ed221c..2864a8c7099 100644 --- a/base/applications/mspaint/lang/no-NO.rc +++ b/base/applications/mspaint/lang/no-NO.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Tilgjengelig under GNU Lesser General Public License (LGPL, se
http://www.gnu.org/home.nb.html
)" IDS_SAVEPROMPTTEXT "Vil du lagre endringene til %s?" - IDS_DEFAULTFILENAME "Utennavn.png" + IDS_DEFAULTFILENAME "Utennavn" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Frihåndmerking" IDS_TOOLTIP2 "Merk" diff --git a/base/applications/mspaint/lang/pl-PL.rc b/base/applications/mspaint/lang/pl-PL.rc index 451cb9f3945..f0ed2ece509 100644 --- a/base/applications/mspaint/lang/pl-PL.rc +++ b/base/applications/mspaint/lang/pl-PL.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Paint dla ReactOS" IDS_INFOTEXT "Dostępny na licencji GNU Lesser General Public License (LGPL,
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Czy chcesz zapisać zmiany do %s?" - IDS_DEFAULTFILENAME "bez tytułu.png" + IDS_DEFAULTFILENAME "bez tytułu" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Zaznaczenie dowolne" IDS_TOOLTIP2 "Zaznaczenie" diff --git a/base/applications/mspaint/lang/pt-BR.rc b/base/applications/mspaint/lang/pt-BR.rc index bf705b32809..1a6dd890930 100644 --- a/base/applications/mspaint/lang/pt-BR.rc +++ b/base/applications/mspaint/lang/pt-BR.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponível sob a licença GNU Lesser General Public License (LGPL, visite
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Salvar as alterações em %s?" - IDS_DEFAULTFILENAME "Imagem.png" + IDS_DEFAULTFILENAME "Imagem" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Selecionar forma livre" IDS_TOOLTIP2 "Selecionar" diff --git a/base/applications/mspaint/lang/pt-PT.rc b/base/applications/mspaint/lang/pt-PT.rc index ca1fd97733b..9395d3deaba 100644 --- a/base/applications/mspaint/lang/pt-PT.rc +++ b/base/applications/mspaint/lang/pt-PT.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponível sob a licença GNU Lesser General Public License (LGPL, visite
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Pretende guardar as alterações a %s?" - IDS_DEFAULTFILENAME "Imagem.png" + IDS_DEFAULTFILENAME "Imagem" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Selecionar forma livre" IDS_TOOLTIP2 "Selecionar" diff --git a/base/applications/mspaint/lang/ro-RO.rc b/base/applications/mspaint/lang/ro-RO.rc index 51211054951..2bd8bf0efe9 100644 --- a/base/applications/mspaint/lang/ro-RO.rc +++ b/base/applications/mspaint/lang/ro-RO.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Pictare pentru ReactOS" IDS_INFOTEXT "Disponibilă sub licența GNU Lesser General Public (vedeți
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Doriți păstrarea modificărilor din %s?" - IDS_DEFAULTFILENAME "FărăNume.png" + IDS_DEFAULTFILENAME "FărăNume" IDS_MINIATURETITLE "Miniatură" IDS_TOOLTIP1 "Golire selecție" IDS_TOOLTIP2 "Selecție" diff --git a/base/applications/mspaint/lang/ru-RU.rc b/base/applications/mspaint/lang/ru-RU.rc index ad5787f95f6..10910b337ed 100644 --- a/base/applications/mspaint/lang/ru-RU.rc +++ b/base/applications/mspaint/lang/ru-RU.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint для ReactOS" IDS_INFOTEXT "Распространяется под лицензией GNU Lesser General Public License (LGPL, см.
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Сохранить изменения в %s?" - IDS_DEFAULTFILENAME "Безымянный.png" + IDS_DEFAULTFILENAME "Безымянный" IDS_MINIATURETITLE "Эскиз" IDS_TOOLTIP1 "Выделение произвольной области" IDS_TOOLTIP2 "Выделение" diff --git a/base/applications/mspaint/lang/sk-SK.rc b/base/applications/mspaint/lang/sk-SK.rc index 94e70e76a2b..4eadabc96c3 100644 --- a/base/applications/mspaint/lang/sk-SK.rc +++ b/base/applications/mspaint/lang/sk-SK.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Skicár systému ReactOS" IDS_INFOTEXT "Dostupný za podmienok GNU Lesser General Public License (LGPL, viď
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Chcete uložiť vykonané zmeny do %s?" - IDS_DEFAULTFILENAME "Bez názvu.png" + IDS_DEFAULTFILENAME "Bez názvu" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Voľný výber" IDS_TOOLTIP2 "Výber" diff --git a/base/applications/mspaint/lang/sq-AL.rc b/base/applications/mspaint/lang/sq-AL.rc index 9c7cbcc8462..25446b39bbc 100644 --- a/base/applications/mspaint/lang/sq-AL.rc +++ b/base/applications/mspaint/lang/sq-AL.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint për ReactOS" IDS_INFOTEXT "Ësht i disponueshme nën GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "A doni të ruani ndryshimet tek %s?" - IDS_DEFAULTFILENAME "Unnamed.png" + IDS_DEFAULTFILENAME "Unnamed" IDS_MINIATURETITLE "Miniaturë" IDS_TOOLTIP1 "Zgjedhje e lire" IDS_TOOLTIP2 "Zgjedhje" diff --git a/base/applications/mspaint/lang/sv-SE.rc b/base/applications/mspaint/lang/sv-SE.rc index 3323e87c56c..f883a7d9177 100644 --- a/base/applications/mspaint/lang/sv-SE.rc +++ b/base/applications/mspaint/lang/sv-SE.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint för ReactOS" IDS_INFOTEXT "Tillgänglig under GNU Lesser General Public License (LGPL, se
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Vill du spara ändringarna till %s?" - IDS_DEFAULTFILENAME "Namnlös.png" + IDS_DEFAULTFILENAME "Namnlös" IDS_MINIATURETITLE "Miniatyr" IDS_TOOLTIP1 "Lasso" IDS_TOOLTIP2 "Markering" diff --git a/base/applications/mspaint/lang/tr-TR.rc b/base/applications/mspaint/lang/tr-TR.rc index 346e8ba5e49..735894e6de8 100644 --- a/base/applications/mspaint/lang/tr-TR.rc +++ b/base/applications/mspaint/lang/tr-TR.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS için Paint" IDS_INFOTEXT "GNU Kısıtlı Genel Kamu Lisansı (LGPL, bakınız:
www.gnu.org
) altındadır." IDS_SAVEPROMPTTEXT "%s için yapılan değişiklikleri kaydetmek ister misiniz?" - IDS_DEFAULTFILENAME "Adsız.png" + IDS_DEFAULTFILENAME "Adsız" IDS_MINIATURETITLE "Küçük Resim" IDS_TOOLTIP1 "Serbest seçim" IDS_TOOLTIP2 "Seçim" diff --git a/base/applications/mspaint/lang/uk-UA.rc b/base/applications/mspaint/lang/uk-UA.rc index 5e5c0dd1dac..08660706f12 100644 --- a/base/applications/mspaint/lang/uk-UA.rc +++ b/base/applications/mspaint/lang/uk-UA.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint для ReactOS" IDS_INFOTEXT "Доступний згідно з GNU Lesser General Public License (LGPL, дивіться
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Зберегти зміни до %s?" - IDS_DEFAULTFILENAME "Без_імені.png" + IDS_DEFAULTFILENAME "Без_імені" IDS_MINIATURETITLE "Мініатюра" IDS_TOOLTIP1 "Виділення довільної області" IDS_TOOLTIP2 "Виділення" diff --git a/base/applications/mspaint/lang/vi-VN.rc b/base/applications/mspaint/lang/vi-VN.rc index 08cc40b5b97..9a0d7d03290 100644 --- a/base/applications/mspaint/lang/vi-VN.rc +++ b/base/applications/mspaint/lang/vi-VN.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Trình Vẽ cho ReactOS" IDS_INFOTEXT "Được cung cấp theo điều lệ trong GNU Lesser General Public License (LGPL, xem
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Bạn có muốn lưu lại những thay đổi trong %s?" - IDS_DEFAULTFILENAME "Khongten.png" + IDS_DEFAULTFILENAME "Khongten" IDS_MINIATURETITLE "Ảnh nhỏ" IDS_TOOLTIP1 "Chọn tự do" IDS_TOOLTIP2 "Chọn" diff --git a/base/applications/mspaint/lang/zh-CN.rc b/base/applications/mspaint/lang/zh-CN.rc index ca12cbb1199..c991b85b5cf 100644 --- a/base/applications/mspaint/lang/zh-CN.rc +++ b/base/applications/mspaint/lang/zh-CN.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "ReactOS 画图" IDS_INFOTEXT "GNU LGPL 许可证下发布的 (详见
www.gnu.org
)" IDS_SAVEPROMPTTEXT "您想把改变保存到 %s 吗?" - IDS_DEFAULTFILENAME "未命名.png" + IDS_DEFAULTFILENAME "未命名" IDS_MINIATURETITLE "缩略图" IDS_TOOLTIP1 "自由选择" IDS_TOOLTIP2 "选择" diff --git a/base/applications/mspaint/lang/zh-TW.rc b/base/applications/mspaint/lang/zh-TW.rc index 3e642fad5dc..8bc305e3159 100644 --- a/base/applications/mspaint/lang/zh-TW.rc +++ b/base/applications/mspaint/lang/zh-TW.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "ReactOS 畫圖" IDS_INFOTEXT "GNU LGPL 下發佈的 (詳見
www.gnu.org
)" IDS_SAVEPROMPTTEXT "您想把變更儲存到 %s 嗎?" - IDS_DEFAULTFILENAME "未命名.png" + IDS_DEFAULTFILENAME "未命名" IDS_MINIATURETITLE "縮圖" IDS_TOOLTIP1 "自由選擇" IDS_TOOLTIP2 "選擇"
3 years
1
0
0
0
[reactos] 01/01: [MSPAINT] Make PNG default instead of BMP (#4182)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=4e6e22e63858c5ed92d16…
commit 4e6e22e63858c5ed92d165991226864773c0d799 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Dec 25 22:23:25 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Dec 25 22:23:25 2021 +0900 [MSPAINT] Make PNG default instead of BMP (#4182) --- base/applications/mspaint/lang/bg-BG.rc | 2 +- base/applications/mspaint/lang/cs-CZ.rc | 2 +- base/applications/mspaint/lang/de-DE.rc | 2 +- base/applications/mspaint/lang/en-GB.rc | 2 +- base/applications/mspaint/lang/en-US.rc | 2 +- base/applications/mspaint/lang/es-ES.rc | 2 +- base/applications/mspaint/lang/et-EE.rc | 2 +- base/applications/mspaint/lang/eu-ES.rc | 2 +- base/applications/mspaint/lang/fr-FR.rc | 2 +- base/applications/mspaint/lang/he-IL.rc | 2 +- base/applications/mspaint/lang/hu-HU.rc | 2 +- base/applications/mspaint/lang/id-ID.rc | 2 +- base/applications/mspaint/lang/it-IT.rc | 2 +- base/applications/mspaint/lang/ja-JP.rc | 2 +- base/applications/mspaint/lang/nl-NL.rc | 2 +- base/applications/mspaint/lang/no-NO.rc | 2 +- base/applications/mspaint/lang/pl-PL.rc | 2 +- base/applications/mspaint/lang/pt-BR.rc | 2 +- base/applications/mspaint/lang/pt-PT.rc | 2 +- base/applications/mspaint/lang/ro-RO.rc | 2 +- base/applications/mspaint/lang/ru-RU.rc | 2 +- base/applications/mspaint/lang/sk-SK.rc | 2 +- base/applications/mspaint/lang/sq-AL.rc | 2 +- base/applications/mspaint/lang/sv-SE.rc | 2 +- base/applications/mspaint/lang/tr-TR.rc | 2 +- base/applications/mspaint/lang/uk-UA.rc | 2 +- base/applications/mspaint/lang/vi-VN.rc | 2 +- base/applications/mspaint/lang/zh-CN.rc | 2 +- base/applications/mspaint/lang/zh-TW.rc | 2 +- base/applications/mspaint/main.cpp | 15 ++++++++++++--- 30 files changed, 41 insertions(+), 32 deletions(-) diff --git a/base/applications/mspaint/lang/bg-BG.rc b/base/applications/mspaint/lang/bg-BG.rc index de891b5254f..dc910abb2a2 100644 --- a/base/applications/mspaint/lang/bg-BG.rc +++ b/base/applications/mspaint/lang/bg-BG.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Рисувач (Paint) за РеактОС" IDS_INFOTEXT "Достъпен под GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Искате ли да запишете промените в %s?" - IDS_DEFAULTFILENAME "Без име.bmp" + IDS_DEFAULTFILENAME "Без име.png" IDS_MINIATURETITLE "Изображенийце" IDS_TOOLTIP1 "Свободно избиране" IDS_TOOLTIP2 "Избор" diff --git a/base/applications/mspaint/lang/cs-CZ.rc b/base/applications/mspaint/lang/cs-CZ.rc index 06f9a1a2604..9d10d56cfad 100644 --- a/base/applications/mspaint/lang/cs-CZ.rc +++ b/base/applications/mspaint/lang/cs-CZ.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS Malování" IDS_INFOTEXT "Dostupné pod licencí GNU Lesser General Public License (LGPL, viz.
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Chcete uložit provedené změny v %s?" - IDS_DEFAULTFILENAME "Bez názvu.bmp" + IDS_DEFAULTFILENAME "Bez názvu.png" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Volný výběr" IDS_TOOLTIP2 "Výběr" diff --git a/base/applications/mspaint/lang/de-DE.rc b/base/applications/mspaint/lang/de-DE.rc index 029f5f632b7..3deddc804a5 100644 --- a/base/applications/mspaint/lang/de-DE.rc +++ b/base/applications/mspaint/lang/de-DE.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint für ReactOS" IDS_INFOTEXT "Unter der GNU Lesser General Public License stehen (LGPL, siehe
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Möchten Sie die Änderungen an %s speichern?" - IDS_DEFAULTFILENAME "Unbenannt.bmp" + IDS_DEFAULTFILENAME "Unbenannt.png" IDS_MINIATURETITLE "Miniaturansicht" IDS_TOOLTIP1 "Freie Auswahl" IDS_TOOLTIP2 "Auswahl" diff --git a/base/applications/mspaint/lang/en-GB.rc b/base/applications/mspaint/lang/en-GB.rc index f77bc942d2b..f693c30c324 100644 --- a/base/applications/mspaint/lang/en-GB.rc +++ b/base/applications/mspaint/lang/en-GB.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Do you want to save the changes to %s?" - IDS_DEFAULTFILENAME "Unnamed.bmp" + IDS_DEFAULTFILENAME "Unnamed.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Free selection" IDS_TOOLTIP2 "Selection" diff --git a/base/applications/mspaint/lang/en-US.rc b/base/applications/mspaint/lang/en-US.rc index a48eed9516f..997aeb272b1 100644 --- a/base/applications/mspaint/lang/en-US.rc +++ b/base/applications/mspaint/lang/en-US.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Do you want to save the changes to %s?" - IDS_DEFAULTFILENAME "Unnamed.bmp" + IDS_DEFAULTFILENAME "Unnamed.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Free selection" IDS_TOOLTIP2 "Selection" diff --git a/base/applications/mspaint/lang/es-ES.rc b/base/applications/mspaint/lang/es-ES.rc index 7c4d1f7f1c1..c01966069da 100644 --- a/base/applications/mspaint/lang/es-ES.rc +++ b/base/applications/mspaint/lang/es-ES.rc @@ -200,7 +200,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponible bajo los términos de la GNU Lesser General Public License (LGPL, ver
www.gnu.org
)" IDS_SAVEPROMPTTEXT "¿Guardar cambios a %s?" - IDS_DEFAULTFILENAME "Sin título.bmp" + IDS_DEFAULTFILENAME "Sin título.png" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Selección de forma libre" IDS_TOOLTIP2 "Selección" diff --git a/base/applications/mspaint/lang/et-EE.rc b/base/applications/mspaint/lang/et-EE.rc index 336c54d225b..7d9bb78cff2 100644 --- a/base/applications/mspaint/lang/et-EE.rc +++ b/base/applications/mspaint/lang/et-EE.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint ReactOS'ile" IDS_INFOTEXT "On saadaval ""GNU Lesser General Public License"" litsentsi all (LGPL, vaata
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Kas soovid salvesta muudatusi failis %s?" - IDS_DEFAULTFILENAME "Nimetu.bmp" + IDS_DEFAULTFILENAME "Nimetu.png" IDS_MINIATURETITLE "Miniatuur" IDS_TOOLTIP1 "Vaba valik" IDS_TOOLTIP2 "Valik" diff --git a/base/applications/mspaint/lang/eu-ES.rc b/base/applications/mspaint/lang/eu-ES.rc index 23591b4d793..ee3420337a0 100644 --- a/base/applications/mspaint/lang/eu-ES.rc +++ b/base/applications/mspaint/lang/eu-ES.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "ReactOS-ko Paint" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, ver
www.gnu.org
)" IDS_SAVEPROMPTTEXT "%s aldaketak gorde nahi duzu?" - IDS_DEFAULTFILENAME "Izegabea.bmp" + IDS_DEFAULTFILENAME "Izegabea.png" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Hautatu forma librea" IDS_TOOLTIP2 "Hautatu" diff --git a/base/applications/mspaint/lang/fr-FR.rc b/base/applications/mspaint/lang/fr-FR.rc index c6cfc2b8b38..817d56c68d7 100644 --- a/base/applications/mspaint/lang/fr-FR.rc +++ b/base/applications/mspaint/lang/fr-FR.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint pour ReactOS" IDS_INFOTEXT "Mis à disposition sous la Licence publique générale limitée GNU (LGPL, voir
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Voulez-vous enregistrer les modifications de %s?" - IDS_DEFAULTFILENAME "Sans titre.bmp" + IDS_DEFAULTFILENAME "Sans titre.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Sélection libre" IDS_TOOLTIP2 "Sélection" diff --git a/base/applications/mspaint/lang/he-IL.rc b/base/applications/mspaint/lang/he-IL.rc index c30e98586f0..69be3cc28e7 100644 --- a/base/applications/mspaint/lang/he-IL.rc +++ b/base/applications/mspaint/lang/he-IL.rc @@ -193,7 +193,7 @@ BEGIN IDS_INFOTITLE "צייר עבור ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "האם ברצונך לשמור את השינויים של %s?" - IDS_DEFAULTFILENAME "ללא שם.bmp" + IDS_DEFAULTFILENAME "ללא שם.png" IDS_MINIATURETITLE "ממוזער" IDS_TOOLTIP1 "בחירה חופשית" IDS_TOOLTIP2 "בחירה" diff --git a/base/applications/mspaint/lang/hu-HU.rc b/base/applications/mspaint/lang/hu-HU.rc index c2b9d4ff32c..eeaf93d4e4f 100644 --- a/base/applications/mspaint/lang/hu-HU.rc +++ b/base/applications/mspaint/lang/hu-HU.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "ReactOS Paint" IDS_INFOTEXT "A GNU Lesser General Public License (LGPL) alatt érhető el (lásd
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Kívánja menteni %s változásait?" - IDS_DEFAULTFILENAME "Névtelen.bmp" + IDS_DEFAULTFILENAME "Névtelen.png" IDS_MINIATURETITLE "Miniatúra" IDS_TOOLTIP1 "Szabadkézi kijelölés" IDS_TOOLTIP2 "Kijelölés" diff --git a/base/applications/mspaint/lang/id-ID.rc b/base/applications/mspaint/lang/id-ID.rc index 794ecce0431..47626c79a07 100644 --- a/base/applications/mspaint/lang/id-ID.rc +++ b/base/applications/mspaint/lang/id-ID.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint untuk ReactOS" IDS_INFOTEXT "Tersedia di bawah GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Ingin menyimpan perubahan untuk %s?" - IDS_DEFAULTFILENAME "Tanpa Nama.bmp" + IDS_DEFAULTFILENAME "Tanpa Nama.png" IDS_MINIATURETITLE "Miniatur" IDS_TOOLTIP1 "Pilihan Bebas" IDS_TOOLTIP2 "Pilihan" diff --git a/base/applications/mspaint/lang/it-IT.rc b/base/applications/mspaint/lang/it-IT.rc index 7179b1696df..e07ee23a48b 100644 --- a/base/applications/mspaint/lang/it-IT.rc +++ b/base/applications/mspaint/lang/it-IT.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint per ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Volete salvare le modifiche a %s?" - IDS_DEFAULTFILENAME "SenzaNome.bmp" + IDS_DEFAULTFILENAME "SenzaNome.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Selezione libera" IDS_TOOLTIP2 "Selezione" diff --git a/base/applications/mspaint/lang/ja-JP.rc b/base/applications/mspaint/lang/ja-JP.rc index 1d86c2bb915..72269792c6e 100644 --- a/base/applications/mspaint/lang/ja-JP.rc +++ b/base/applications/mspaint/lang/ja-JP.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS ペイント" IDS_INFOTEXT "GNU Lesser General Public License (LGPL, 詳細は
www.gnu.org
) の下で利用可能です。" IDS_SAVEPROMPTTEXT "%s の変更内容を保存しますか?" - IDS_DEFAULTFILENAME "無題.bmp" + IDS_DEFAULTFILENAME "無題.png" IDS_MINIATURETITLE "縮小図" IDS_TOOLTIP1 "自由選択" IDS_TOOLTIP2 "選択" diff --git a/base/applications/mspaint/lang/nl-NL.rc b/base/applications/mspaint/lang/nl-NL.rc index c87ffa6c91e..40068652119 100644 --- a/base/applications/mspaint/lang/nl-NL.rc +++ b/base/applications/mspaint/lang/nl-NL.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Available under the GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Wilt u de wijzigingen die zijn aangebracht in %s opslaan?" - IDS_DEFAULTFILENAME "Naamloos.bmp" + IDS_DEFAULTFILENAME "Naamloos.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Vrij selecteren" IDS_TOOLTIP2 "Selecteren" diff --git a/base/applications/mspaint/lang/no-NO.rc b/base/applications/mspaint/lang/no-NO.rc index 8c5ee64c77a..de234ed221c 100644 --- a/base/applications/mspaint/lang/no-NO.rc +++ b/base/applications/mspaint/lang/no-NO.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint for ReactOS" IDS_INFOTEXT "Tilgjengelig under GNU Lesser General Public License (LGPL, se
http://www.gnu.org/home.nb.html
)" IDS_SAVEPROMPTTEXT "Vil du lagre endringene til %s?" - IDS_DEFAULTFILENAME "Utennavn.bmp" + IDS_DEFAULTFILENAME "Utennavn.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Frihåndmerking" IDS_TOOLTIP2 "Merk" diff --git a/base/applications/mspaint/lang/pl-PL.rc b/base/applications/mspaint/lang/pl-PL.rc index 47293bd2bbf..451cb9f3945 100644 --- a/base/applications/mspaint/lang/pl-PL.rc +++ b/base/applications/mspaint/lang/pl-PL.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Paint dla ReactOS" IDS_INFOTEXT "Dostępny na licencji GNU Lesser General Public License (LGPL,
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Czy chcesz zapisać zmiany do %s?" - IDS_DEFAULTFILENAME "bez tytułu.bmp" + IDS_DEFAULTFILENAME "bez tytułu.png" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Zaznaczenie dowolne" IDS_TOOLTIP2 "Zaznaczenie" diff --git a/base/applications/mspaint/lang/pt-BR.rc b/base/applications/mspaint/lang/pt-BR.rc index 135a82ec3bd..bf705b32809 100644 --- a/base/applications/mspaint/lang/pt-BR.rc +++ b/base/applications/mspaint/lang/pt-BR.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponível sob a licença GNU Lesser General Public License (LGPL, visite
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Salvar as alterações em %s?" - IDS_DEFAULTFILENAME "Imagem.bmp" + IDS_DEFAULTFILENAME "Imagem.png" IDS_MINIATURETITLE "Miniatura" IDS_TOOLTIP1 "Selecionar forma livre" IDS_TOOLTIP2 "Selecionar" diff --git a/base/applications/mspaint/lang/pt-PT.rc b/base/applications/mspaint/lang/pt-PT.rc index 69ff9a2de61..ca1fd97733b 100644 --- a/base/applications/mspaint/lang/pt-PT.rc +++ b/base/applications/mspaint/lang/pt-PT.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint para ReactOS" IDS_INFOTEXT "Disponível sob a licença GNU Lesser General Public License (LGPL, visite
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Pretende guardar as alterações a %s?" - IDS_DEFAULTFILENAME "Imagem.bmp" + IDS_DEFAULTFILENAME "Imagem.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Selecionar forma livre" IDS_TOOLTIP2 "Selecionar" diff --git a/base/applications/mspaint/lang/ro-RO.rc b/base/applications/mspaint/lang/ro-RO.rc index 68cb073bc0a..51211054951 100644 --- a/base/applications/mspaint/lang/ro-RO.rc +++ b/base/applications/mspaint/lang/ro-RO.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Pictare pentru ReactOS" IDS_INFOTEXT "Disponibilă sub licența GNU Lesser General Public (vedeți
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Doriți păstrarea modificărilor din %s?" - IDS_DEFAULTFILENAME "FărăNume.bmp" + IDS_DEFAULTFILENAME "FărăNume.png" IDS_MINIATURETITLE "Miniatură" IDS_TOOLTIP1 "Golire selecție" IDS_TOOLTIP2 "Selecție" diff --git a/base/applications/mspaint/lang/ru-RU.rc b/base/applications/mspaint/lang/ru-RU.rc index 0740f4bf693..ad5787f95f6 100644 --- a/base/applications/mspaint/lang/ru-RU.rc +++ b/base/applications/mspaint/lang/ru-RU.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint для ReactOS" IDS_INFOTEXT "Распространяется под лицензией GNU Lesser General Public License (LGPL, см.
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Сохранить изменения в %s?" - IDS_DEFAULTFILENAME "Безымянный.bmp" + IDS_DEFAULTFILENAME "Безымянный.png" IDS_MINIATURETITLE "Эскиз" IDS_TOOLTIP1 "Выделение произвольной области" IDS_TOOLTIP2 "Выделение" diff --git a/base/applications/mspaint/lang/sk-SK.rc b/base/applications/mspaint/lang/sk-SK.rc index 18b9a78f357..94e70e76a2b 100644 --- a/base/applications/mspaint/lang/sk-SK.rc +++ b/base/applications/mspaint/lang/sk-SK.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "Skicár systému ReactOS" IDS_INFOTEXT "Dostupný za podmienok GNU Lesser General Public License (LGPL, viď
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Chcete uložiť vykonané zmeny do %s?" - IDS_DEFAULTFILENAME "Bez názvu.bmp" + IDS_DEFAULTFILENAME "Bez názvu.png" IDS_MINIATURETITLE "Miniature" IDS_TOOLTIP1 "Voľný výber" IDS_TOOLTIP2 "Výber" diff --git a/base/applications/mspaint/lang/sq-AL.rc b/base/applications/mspaint/lang/sq-AL.rc index 812dbf2d457..9c7cbcc8462 100644 --- a/base/applications/mspaint/lang/sq-AL.rc +++ b/base/applications/mspaint/lang/sq-AL.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint për ReactOS" IDS_INFOTEXT "Ësht i disponueshme nën GNU Lesser General Public License (LGPL, see
www.gnu.org
)" IDS_SAVEPROMPTTEXT "A doni të ruani ndryshimet tek %s?" - IDS_DEFAULTFILENAME "Unnamed.bmp" + IDS_DEFAULTFILENAME "Unnamed.png" IDS_MINIATURETITLE "Miniaturë" IDS_TOOLTIP1 "Zgjedhje e lire" IDS_TOOLTIP2 "Zgjedhje" diff --git a/base/applications/mspaint/lang/sv-SE.rc b/base/applications/mspaint/lang/sv-SE.rc index fecb9d1c175..3323e87c56c 100644 --- a/base/applications/mspaint/lang/sv-SE.rc +++ b/base/applications/mspaint/lang/sv-SE.rc @@ -190,7 +190,7 @@ BEGIN IDS_INFOTITLE "Paint för ReactOS" IDS_INFOTEXT "Tillgänglig under GNU Lesser General Public License (LGPL, se
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Vill du spara ändringarna till %s?" - IDS_DEFAULTFILENAME "Namnlös.bmp" + IDS_DEFAULTFILENAME "Namnlös.png" IDS_MINIATURETITLE "Miniatyr" IDS_TOOLTIP1 "Lasso" IDS_TOOLTIP2 "Markering" diff --git a/base/applications/mspaint/lang/tr-TR.rc b/base/applications/mspaint/lang/tr-TR.rc index e0d3b2f03e9..346e8ba5e49 100644 --- a/base/applications/mspaint/lang/tr-TR.rc +++ b/base/applications/mspaint/lang/tr-TR.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "ReactOS için Paint" IDS_INFOTEXT "GNU Kısıtlı Genel Kamu Lisansı (LGPL, bakınız:
www.gnu.org
) altındadır." IDS_SAVEPROMPTTEXT "%s için yapılan değişiklikleri kaydetmek ister misiniz?" - IDS_DEFAULTFILENAME "Adsız.bmp" + IDS_DEFAULTFILENAME "Adsız.png" IDS_MINIATURETITLE "Küçük Resim" IDS_TOOLTIP1 "Serbest seçim" IDS_TOOLTIP2 "Seçim" diff --git a/base/applications/mspaint/lang/uk-UA.rc b/base/applications/mspaint/lang/uk-UA.rc index f98ee55c9b1..5e5c0dd1dac 100644 --- a/base/applications/mspaint/lang/uk-UA.rc +++ b/base/applications/mspaint/lang/uk-UA.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Paint для ReactOS" IDS_INFOTEXT "Доступний згідно з GNU Lesser General Public License (LGPL, дивіться
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Зберегти зміни до %s?" - IDS_DEFAULTFILENAME "Без_імені.bmp" + IDS_DEFAULTFILENAME "Без_імені.png" IDS_MINIATURETITLE "Мініатюра" IDS_TOOLTIP1 "Виділення довільної області" IDS_TOOLTIP2 "Виділення" diff --git a/base/applications/mspaint/lang/vi-VN.rc b/base/applications/mspaint/lang/vi-VN.rc index a02c75351f0..08cc40b5b97 100644 --- a/base/applications/mspaint/lang/vi-VN.rc +++ b/base/applications/mspaint/lang/vi-VN.rc @@ -198,7 +198,7 @@ BEGIN IDS_INFOTITLE "Trình Vẽ cho ReactOS" IDS_INFOTEXT "Được cung cấp theo điều lệ trong GNU Lesser General Public License (LGPL, xem
www.gnu.org
)" IDS_SAVEPROMPTTEXT "Bạn có muốn lưu lại những thay đổi trong %s?" - IDS_DEFAULTFILENAME "Khongten.bmp" + IDS_DEFAULTFILENAME "Khongten.png" IDS_MINIATURETITLE "Ảnh nhỏ" IDS_TOOLTIP1 "Chọn tự do" IDS_TOOLTIP2 "Chọn" diff --git a/base/applications/mspaint/lang/zh-CN.rc b/base/applications/mspaint/lang/zh-CN.rc index b560d1b3320..ca12cbb1199 100644 --- a/base/applications/mspaint/lang/zh-CN.rc +++ b/base/applications/mspaint/lang/zh-CN.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "ReactOS 画图" IDS_INFOTEXT "GNU LGPL 许可证下发布的 (详见
www.gnu.org
)" IDS_SAVEPROMPTTEXT "您想把改变保存到 %s 吗?" - IDS_DEFAULTFILENAME "未命名.bmp" + IDS_DEFAULTFILENAME "未命名.png" IDS_MINIATURETITLE "缩略图" IDS_TOOLTIP1 "自由选择" IDS_TOOLTIP2 "选择" diff --git a/base/applications/mspaint/lang/zh-TW.rc b/base/applications/mspaint/lang/zh-TW.rc index daf5a584b02..3e642fad5dc 100644 --- a/base/applications/mspaint/lang/zh-TW.rc +++ b/base/applications/mspaint/lang/zh-TW.rc @@ -199,7 +199,7 @@ BEGIN IDS_INFOTITLE "ReactOS 畫圖" IDS_INFOTEXT "GNU LGPL 下發佈的 (詳見
www.gnu.org
)" IDS_SAVEPROMPTTEXT "您想把變更儲存到 %s 嗎?" - IDS_DEFAULTFILENAME "未命名.bmp" + IDS_DEFAULTFILENAME "未命名.png" IDS_MINIATURETITLE "縮圖" IDS_TOOLTIP1 "自由選擇" IDS_TOOLTIP2 "選擇" diff --git a/base/applications/mspaint/main.cpp b/base/applications/mspaint/main.cpp index f176f3b7c86..f1145d7f179 100644 --- a/base/applications/mspaint/main.cpp +++ b/base/applications/mspaint/main.cpp @@ -264,7 +264,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument choosecolor.lpCustColors = custColors; /* initializing the OPENFILENAME structure for use with GetOpenFileName and GetSaveFileName */ - CopyMemory(ofnFilename, filepathname, sizeof(filepathname)); + ofnFilename[0] = 0; CString strImporters; CSimpleArray<GUID> aguidFileTypesI; CString strAllPictureFiles; @@ -283,7 +283,7 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument ofn.lpstrFileTitle = ofnFiletitle; ofn.nMaxFileTitle = SIZEOF(ofnFiletitle); ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY; - ofn.lpstrDefExt = L"bmp"; + ofn.lpstrDefExt = L"png"; CopyMemory(sfnFilename, filepathname, sizeof(filepathname)); CString strExporters; @@ -300,7 +300,16 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument sfn.nMaxFileTitle = SIZEOF(sfnFiletitle); sfn.Flags = OFN_EXPLORER | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_EXPLORER | OFN_ENABLEHOOK; sfn.lpfnHook = OFNHookProc; - sfn.lpstrDefExt = L"bmp"; + sfn.lpstrDefExt = L"png"; + // Choose PNG + for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i) + { + if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG) + { + sfn.nFilterIndex = i + 1; + break; + } + } /* creating the size boxes */ RECT sizeboxPos = {0, 0, 0 + 3, 0 + 3};
3 years
1
0
0
0
[reactos] 01/01: [SCHEDSVC] Use a timer to start jobs
by Eric Kohl
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fa607733cb063d233ca04…
commit fa607733cb063d233ca04c090b03e328d8645be7 Author: Eric Kohl <eric.kohl(a)reactos.org> AuthorDate: Sat Dec 25 14:18:53 2021 +0100 Commit: Eric Kohl <eric.kohl(a)reactos.org> CommitDate: Sat Dec 25 14:18:53 2021 +0100 [SCHEDSVC] Use a timer to start jobs This enables the service to start multiple jobs at the same time. --- base/services/schedsvc/job.c | 220 +++++++++++++++---------------------- base/services/schedsvc/precomp.h | 12 +- base/services/schedsvc/rpcserver.c | 4 - base/services/schedsvc/schedsvc.c | 26 +++-- 4 files changed, 110 insertions(+), 152 deletions(-) diff --git a/base/services/schedsvc/job.c b/base/services/schedsvc/job.c index 558ac3797dd..e29d2732716 100644 --- a/base/services/schedsvc/job.c +++ b/base/services/schedsvc/job.c @@ -31,60 +31,59 @@ RTL_RESOURCE JobListLock; LIST_ENTRY StartListHead; RTL_RESOURCE StartListLock; +FILETIME NextJobStartTime; +BOOL bValidNextJobStartTime = FALSE; + static WORD wDaysArray[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; /* FUNCTIONS *****************************************************************/ -DWORD -GetNextJobTimeout(VOID) +VOID +GetNextJobTimeout(HANDLE hTimer) { - FILETIME FileTime; - SYSTEMTIME SystemTime; - ULARGE_INTEGER CurrentTime, Timeout; - PJOB pNextJob; + PLIST_ENTRY CurrentEntry; + FILETIME DueTime; + PJOB CurrentJob; - if (IsListEmpty(&StartListHead)) + bValidNextJobStartTime = FALSE; + CurrentEntry = JobListHead.Flink; + while (CurrentEntry != &JobListHead) { - TRACE("No job in list! Wait until next update.\n"); - return INFINITE; - } - - pNextJob = CONTAINING_RECORD((&StartListHead)->Flink, JOB, StartEntry); - - FileTime.dwLowDateTime = pNextJob->StartTime.u.LowPart; - FileTime.dwHighDateTime = pNextJob->StartTime.u.HighPart; - FileTimeToSystemTime(&FileTime, &SystemTime); - - TRACE("Start next job (%lu) at %02hu:%02hu %02hu.%02hu.%hu\n", - pNextJob->JobId, SystemTime.wHour, SystemTime.wMinute, - SystemTime.wDay, SystemTime.wMonth, SystemTime.wYear); - - GetLocalTime(&SystemTime); - SystemTimeToFileTime(&SystemTime, &FileTime); + CurrentJob = CONTAINING_RECORD(CurrentEntry, JOB, JobEntry); - CurrentTime.u.LowPart = FileTime.dwLowDateTime; - CurrentTime.u.HighPart = FileTime.dwHighDateTime; + if (bValidNextJobStartTime == FALSE) + { + CopyMemory(&NextJobStartTime, &CurrentJob->StartTime, sizeof(FILETIME)); + bValidNextJobStartTime = TRUE; + } + else + { + if (CompareFileTime(&NextJobStartTime, &CurrentJob->StartTime) > 0) + CopyMemory(&NextJobStartTime, &CurrentJob->StartTime, sizeof(FILETIME)); + } - if (CurrentTime.QuadPart >= pNextJob->StartTime.QuadPart) - { - TRACE("Next event has already gone by!\n"); - return 0; + CurrentEntry = CurrentEntry->Flink; } - Timeout.QuadPart = (pNextJob->StartTime.QuadPart - CurrentTime.QuadPart) / 10000; - if (Timeout.u.HighPart != 0) + if (bValidNextJobStartTime == FALSE) { - TRACE("Event happens too far in the future!\n"); - return INFINITE; + TRACE("No valid job!\n"); + return; } - TRACE("Timeout: %lu\n", Timeout.u.LowPart); - return Timeout.u.LowPart; -} + LocalFileTimeToFileTime(&DueTime, &NextJobStartTime); + SetWaitableTimer(hTimer, + (PLARGE_INTEGER)&DueTime, + 0, + NULL, + NULL, + TRUE); +} +#if 0 static VOID ReScheduleJob( @@ -117,59 +116,61 @@ ReScheduleJob( DumpStartList(&StartListHead); #endif } - +#endif VOID -RunNextJob(VOID) +RunCurrentJobs(VOID) { PROCESS_INFORMATION ProcessInformation; STARTUPINFOW StartupInfo; + PLIST_ENTRY CurrentEntry; + PJOB CurrentJob; BOOL bRet; - PJOB pNextJob; - if (IsListEmpty(&StartListHead)) + CurrentEntry = JobListHead.Flink; + while (CurrentEntry != &JobListHead) { - ERR("No job in list!\n"); - return; - } + CurrentJob = CONTAINING_RECORD(CurrentEntry, JOB, JobEntry); - pNextJob = CONTAINING_RECORD((&StartListHead)->Flink, JOB, StartEntry); + if (CompareFileTime(&NextJobStartTime, &CurrentJob->StartTime) == 0) + { + TRACE("Run job %ld: %S\n", CurrentJob->JobId, CurrentJob->Command); - TRACE("Run job %ld: %S\n", pNextJob->JobId, pNextJob->Command); + ZeroMemory(&StartupInfo, sizeof(StartupInfo)); + StartupInfo.cb = sizeof(StartupInfo); + StartupInfo.lpTitle = CurrentJob->Command; + StartupInfo.dwFlags = STARTF_USESHOWWINDOW; + StartupInfo.wShowWindow = SW_SHOWDEFAULT; - ZeroMemory(&StartupInfo, sizeof(StartupInfo)); - StartupInfo.cb = sizeof(StartupInfo); - StartupInfo.lpTitle = pNextJob->Command; - StartupInfo.dwFlags = STARTF_USESHOWWINDOW; - StartupInfo.wShowWindow = SW_SHOWDEFAULT; + if ((CurrentJob->Flags & JOB_NONINTERACTIVE) == 0) + { + StartupInfo.dwFlags |= STARTF_INHERITDESKTOP; + StartupInfo.lpDesktop = L"WinSta0\\Default"; + } - if ((pNextJob->Flags & JOB_NONINTERACTIVE) == 0) - { - StartupInfo.dwFlags |= STARTF_INHERITDESKTOP; - StartupInfo.lpDesktop = L"WinSta0\\Default"; - } + bRet = CreateProcessW(NULL, + CurrentJob->Command, + NULL, + NULL, + FALSE, + CREATE_NEW_CONSOLE, + NULL, + NULL, + &StartupInfo, + &ProcessInformation); + if (bRet == FALSE) + { + ERR("CreateProcessW() failed (Error %lu)\n", GetLastError()); + } + else + { + CloseHandle(ProcessInformation.hThread); + CloseHandle(ProcessInformation.hProcess); + } + } - bRet = CreateProcessW(NULL, - pNextJob->Command, - NULL, - NULL, - FALSE, - CREATE_NEW_CONSOLE, - NULL, - NULL, - &StartupInfo, - &ProcessInformation); - if (bRet == FALSE) - { - ERR("CreateProcessW() failed (Error %lu)\n", GetLastError()); - } - else - { - CloseHandle(ProcessInformation.hThread); - CloseHandle(ProcessInformation.hProcess); + CurrentEntry = CurrentEntry->Flink; } - - ReScheduleJob(pNextJob); } @@ -420,8 +421,6 @@ LoadJobs(VOID) /* Calculate the next start time */ CalculateNextStartTime(pJob); - /* Insert the job into the start list */ - InsertJobIntoStartList(&StartListHead, pJob); #if 0 DumpStartList(&StartListHead); #endif @@ -473,6 +472,7 @@ CalculateNextStartTime( WORD wDaysOffset, wTempOffset, i, wJobDayOfWeek, wJobDayOfMonth; DWORD_PTR CurrentTimeMs; BOOL bDaysOffsetValid; + ULARGE_INTEGER LocalStartTime; TRACE("CalculateNextStartTime(%p)\n", pJob); TRACE("JobTime: %lu\n", pJob->JobTime); @@ -590,66 +590,18 @@ CalculateNextStartTime( SystemTimeToFileTime(&StartSystemTime, &StartFileTime); - pJob->StartTime.u.LowPart = StartFileTime.dwLowDateTime; - pJob->StartTime.u.HighPart = StartFileTime.dwHighDateTime; + LocalStartTime.u.LowPart = StartFileTime.dwLowDateTime; + LocalStartTime.u.HighPart = StartFileTime.dwHighDateTime; if (bDaysOffsetValid && wDaysOffset != 0) { - pJob->StartTime.QuadPart += ((ULONGLONG)wDaysOffset * 24 * 60 * 60 * 10000); - } -} - - -VOID -InsertJobIntoStartList( - _In_ PLIST_ENTRY StartListHead, - _In_ PJOB pJob) -{ - PLIST_ENTRY CurrentEntry, PreviousEntry; - PJOB CurrentJob; - - if (IsListEmpty(StartListHead)) - { - InsertHeadList(StartListHead, &pJob->StartEntry); - return; + LocalStartTime.QuadPart += ((ULONGLONG)wDaysOffset * 24 * 60 * 60 * 10000); } - CurrentEntry = StartListHead->Flink; - while (CurrentEntry != StartListHead) - { - CurrentJob = CONTAINING_RECORD(CurrentEntry, JOB, StartEntry); - - if ((CurrentEntry == StartListHead->Flink) && - (pJob->StartTime.QuadPart < CurrentJob->StartTime.QuadPart)) - { - /* Insert before the first entry */ - InsertHeadList(StartListHead, &pJob->StartEntry); - return; - } - - if (pJob->StartTime.QuadPart < CurrentJob->StartTime.QuadPart) - { - /* Insert between the previous and the current entry */ - PreviousEntry = CurrentEntry->Blink; - pJob->StartEntry.Blink = PreviousEntry; - pJob->StartEntry.Flink = CurrentEntry; - PreviousEntry->Flink = &pJob->StartEntry; - CurrentEntry->Blink = &pJob->StartEntry; - return; - } - - if ((CurrentEntry->Flink == StartListHead) && - (pJob->StartTime.QuadPart >= CurrentJob->StartTime.QuadPart)) - { - /* Insert after the last entry */ - InsertTailList(StartListHead, &pJob->StartEntry); - return; - } - - CurrentEntry = CurrentEntry->Flink; - } + pJob->StartTime.dwLowDateTime = LocalStartTime.u.LowPart; + pJob->StartTime.dwHighDateTime = LocalStartTime.u.HighPart; } - +#if 0 VOID DumpStartList( _In_ PLIST_ENTRY StartListHead) @@ -657,8 +609,8 @@ DumpStartList( PLIST_ENTRY CurrentEntry; PJOB CurrentJob; - CurrentEntry = StartListHead->Flink; - while (CurrentEntry != StartListHead) + CurrentEntry = JobListHead->Flink; + while (CurrentEntry != &JobListHead) { CurrentJob = CONTAINING_RECORD(CurrentEntry, JOB, StartEntry); @@ -667,5 +619,5 @@ DumpStartList( CurrentEntry = CurrentEntry->Flink; } } - +#endif /* EOF */ diff --git a/base/services/schedsvc/precomp.h b/base/services/schedsvc/precomp.h index 992e16796d8..f3c3e4255cf 100644 --- a/base/services/schedsvc/precomp.h +++ b/base/services/schedsvc/precomp.h @@ -32,8 +32,7 @@ typedef struct _JOB { LIST_ENTRY JobEntry; - LIST_ENTRY StartEntry; - ULARGE_INTEGER StartTime; + FILETIME StartTime; WCHAR Name[JOB_NAME_LENGTH]; DWORD JobId; @@ -54,16 +53,17 @@ extern RTL_RESOURCE JobListLock; extern LIST_ENTRY StartListHead; extern RTL_RESOURCE StartListLock; -extern HANDLE Events[2]; +extern HANDLE Events[3]; /* job.c */ -DWORD -GetNextJobTimeout(VOID); +VOID +GetNextJobTimeout( + HANDLE hTimer); VOID -RunNextJob(VOID); +RunCurrentJobs(VOID); LONG SaveJob( diff --git a/base/services/schedsvc/rpcserver.c b/base/services/schedsvc/rpcserver.c index 4ae657f6a2a..ca3c8fd5b99 100644 --- a/base/services/schedsvc/rpcserver.c +++ b/base/services/schedsvc/rpcserver.c @@ -121,8 +121,6 @@ NetrJobAdd( /* Calculate the next start time */ CalculateNextStartTime(pJob); - /* Insert the job into the start list */ - InsertJobIntoStartList(&StartListHead, pJob); #if 0 DumpStartList(&StartListHead); #endif @@ -169,8 +167,6 @@ NetrJobDel( if ((CurrentJob->JobId >= MinJobId) && (CurrentJob->JobId <= MaxJobId)) { - /* Remove the job from the start list */ - RemoveEntryList(&CurrentJob->StartEntry); #if 0 DumpStartList(&StartListHead); #endif diff --git a/base/services/schedsvc/schedsvc.c b/base/services/schedsvc/schedsvc.c index ba96195839f..dea78455141 100644 --- a/base/services/schedsvc/schedsvc.c +++ b/base/services/schedsvc/schedsvc.c @@ -37,7 +37,7 @@ static WCHAR ServiceName[] = L"Schedule"; static SERVICE_STATUS_HANDLE ServiceStatusHandle; static SERVICE_STATUS ServiceStatus; -HANDLE Events[2] = {NULL, NULL}; // StopEvent, UpdateEvent +HANDLE Events[3] = {NULL, NULL, NULL}; // StopEvent, UpdateEvent, Timer /* FUNCTIONS *****************************************************************/ @@ -181,6 +181,15 @@ ServiceInit(VOID) return GetLastError(); } + Events[2] = CreateWaitableTimerW(NULL, FALSE, NULL); + if (Events[2] == NULL) + { + ERR("Could not create the timer\n"); + CloseHandle(Events[1]); + CloseHandle(Events[0]); + return GetLastError(); + } + return ERROR_SUCCESS; } @@ -188,7 +197,7 @@ ServiceInit(VOID) VOID WINAPI SchedServiceMain(DWORD argc, LPTSTR *argv) { - DWORD dwWait, dwTimeout, dwError; + DWORD dwWait, dwError; UNREFERENCED_PARAMETER(argc); UNREFERENCED_PARAMETER(argv); @@ -216,13 +225,13 @@ SchedServiceMain(DWORD argc, LPTSTR *argv) UpdateServiceStatus(SERVICE_RUNNING); - dwTimeout = GetNextJobTimeout(); + GetNextJobTimeout(Events[2]); for (;;) { /* Wait for the next event */ TRACE("Wait for next event!\n"); - dwWait = WaitForMultipleObjects(2, Events, FALSE, dwTimeout); + dwWait = WaitForMultipleObjects(3, Events, FALSE, INFINITE); if (dwWait == WAIT_OBJECT_0) { TRACE("Stop event signaled!\n"); @@ -233,16 +242,16 @@ SchedServiceMain(DWORD argc, LPTSTR *argv) TRACE("Update event signaled!\n"); RtlAcquireResourceShared(&JobListLock, TRUE); - dwTimeout = GetNextJobTimeout(); + GetNextJobTimeout(Events[2]); RtlReleaseResource(&JobListLock); } - else if (dwWait == WAIT_TIMEOUT) + else if (dwWait == WAIT_OBJECT_0 + 2) { TRACE("Timeout: Start the next job!\n"); RtlAcquireResourceExclusive(&JobListLock, TRUE); - RunNextJob(); - dwTimeout = GetNextJobTimeout(); + RunCurrentJobs(); + GetNextJobTimeout(Events[2]); RtlReleaseResource(&JobListLock); } } @@ -250,6 +259,7 @@ SchedServiceMain(DWORD argc, LPTSTR *argv) /* Close the start and update event handles */ CloseHandle(Events[0]); CloseHandle(Events[1]); + CloseHandle(Events[2]); /* Stop the service */ UpdateServiceStatus(SERVICE_STOPPED);
3 years
1
0
0
0
[reactos] 05/05: [MSV1_0] Implement LsaApLogonUserEx2_Network (5/5)
by Andreas Maier
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=99dcd6f71cb72a973e858…
commit 99dcd6f71cb72a973e85888903b5ed31241ad5c3 Author: Andreas Maier <staubim(a)quantentunnel.de> AuthorDate: Thu Jul 16 20:44:01 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sat Dec 25 15:55:43 2021 +0300 [MSV1_0] Implement LsaApLogonUserEx2_Network (5/5) This is a part of the Partial Network Login Implementation PR. --- dll/win32/msv1_0/CMakeLists.txt | 1 + dll/win32/msv1_0/lsa.c | 1 - dll/win32/msv1_0/lsa.h | 3 - dll/win32/msv1_0/msv1_0.c | 209 +++++++++++++++++----- dll/win32/msv1_0/msv1_0.h | 58 +++++++ dll/win32/msv1_0/ntlm/global.c | 41 +++++ dll/win32/msv1_0/ntlm/global.h | 22 ++- dll/win32/msv1_0/ntlm/protocol.h | 24 +++ dll/win32/msv1_0/ntlm/util.c | 367 +++++++++++++++++++++++++++++++++++++++ dll/win32/msv1_0/ntlm/util.h | 64 +++++++ dll/win32/msv1_0/precomp.h | 2 + dll/win32/msv1_0/sam.c | 2 + dll/win32/msv1_0/sam.h | 12 ++ 13 files changed, 758 insertions(+), 48 deletions(-) diff --git a/dll/win32/msv1_0/CMakeLists.txt b/dll/win32/msv1_0/CMakeLists.txt index 50fa39aa44b..a336c7a6a4e 100644 --- a/dll/win32/msv1_0/CMakeLists.txt +++ b/dll/win32/msv1_0/CMakeLists.txt @@ -5,6 +5,7 @@ list(APPEND SOURCE lsa.c msv1_0.c ntlm/global.c + ntlm/util.c sam.c user.c usercontext.c diff --git a/dll/win32/msv1_0/lsa.c b/dll/win32/msv1_0/lsa.c index 0bbf4699c66..e8e4da8854e 100644 --- a/dll/win32/msv1_0/lsa.c +++ b/dll/win32/msv1_0/lsa.c @@ -10,7 +10,6 @@ #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msv1_0); -SECPKG_FUNCTION_TABLE NtlmLsaFn[1]; NTSTATUS NTAPI diff --git a/dll/win32/msv1_0/lsa.h b/dll/win32/msv1_0/lsa.h index 2df98a710c6..3577dbce361 100644 --- a/dll/win32/msv1_0/lsa.h +++ b/dll/win32/msv1_0/lsa.h @@ -7,9 +7,6 @@ #pragma once -// functions we provide to LSA in SpLsaModeInitialize -extern SECPKG_FUNCTION_TABLE NtlmLsaFn[1]; - NTSTATUS NTAPI SpInitialize( diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index eefddf3d0e0..63aad086fd9 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -13,11 +13,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(msv1_0); -/* GLOBALS *****************************************************************/ - -LSA_DISPATCH_TABLE DispatchTable; - - /* FUNCTIONS ***************************************************************/ static @@ -176,6 +171,110 @@ done: } +static +NTSTATUS +BuildLm20LogonProfileBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ PSAMPR_USER_INFO_BUFFER UserInfo, + _In_ PLSA_SAM_PWD_DATA LogonPwdData, + _Out_ PMSV1_0_LM20_LOGON_PROFILE *ProfileBuffer, + _Out_ PULONG ProfileBufferLength) +{ + PMSV1_0_LM20_LOGON_PROFILE LocalBuffer; + NTLM_CLIENT_BUFFER Buffer; + PBYTE PtrOffset; + ULONG BufferLength; + NTSTATUS Status = STATUS_SUCCESS; + UNICODE_STRING ComputerNameUCS; + + *ProfileBuffer = NULL; + *ProfileBufferLength = 0; + + if (!NtlmUStrAlloc(&ComputerNameUCS, LogonPwdData->ComputerName->Length + sizeof(WCHAR) * 3, 0)) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + Status = RtlAppendUnicodeToString(&ComputerNameUCS, L"\\\\"); + if (!NT_SUCCESS(Status)) + { + ERR("RtlAppendUnicodeToString failed 0x%lx\n", Status); + goto done; + } + Status = RtlAppendUnicodeStringToString(&ComputerNameUCS, LogonPwdData->ComputerName); + if (!NT_SUCCESS(Status)) + { + ERR("RtlAppendUnicodeStringToString failed 0x%lx\n", Status); + goto done; + } + + BufferLength = sizeof(MSV1_0_LM20_LOGON_PROFILE) + ComputerNameUCS.Length + sizeof(WCHAR); + + Status = NtlmAllocateClientBuffer(ClientRequest, BufferLength, &Buffer); + if (!NT_SUCCESS(Status)) + { + TRACE("DispatchTable.AllocateClientBuffer failed (Status 0x%08lx)\n", Status); + goto done; + } + + TRACE("ClientBaseAddress: %p\n", Buffer.ClientBaseAddress); + + LocalBuffer = (PMSV1_0_LM20_LOGON_PROFILE)Buffer.LocalBuffer; + PtrOffset = (PBYTE)(LocalBuffer + 1); + + LocalBuffer->MessageType = MsV1_0Lm20LogonProfile; + LocalBuffer->KickOffTime.LowPart = UserInfo->All.AccountExpires.LowPart; + LocalBuffer->KickOffTime.HighPart = UserInfo->All.AccountExpires.HighPart; + LocalBuffer->LogoffTime.LowPart = UserInfo->All.AccountExpires.LowPart; + LocalBuffer->LogoffTime.HighPart = UserInfo->All.AccountExpires.HighPart; + + memcpy(LocalBuffer->UserSessionKey, + &LogonPwdData->UserSessionKey, + MSV1_0_USER_SESSION_KEY_LENGTH); + + //FIXME: Set Domainname if we domain joined + // what to do if not? WORKGROUP + RtlInitUnicodeString(&LocalBuffer->LogonDomainName, NULL); + + memcpy(LocalBuffer->LanmanSessionKey, + &LogonPwdData->LanmanSessionKey, + MSV1_0_LANMAN_SESSION_KEY_LENGTH); + + if (!NtlmUStrWriteToStruct(LocalBuffer, + BufferLength, + &LocalBuffer->LogonServer, + &ComputerNameUCS, + &PtrOffset, + TRUE)) + { + ERR("NtlmStructWriteUCS failed.\n"); + Status = ERROR_INTERNAL_ERROR; + goto done; + } + /* not supported */ + RtlInitUnicodeString(&LocalBuffer->UserParameters, NULL); + /* Build user flags */ + LocalBuffer->UserFlags = 0x0; + if (LogonPwdData->LogonType == NetLogonLmKey) + LocalBuffer->UserFlags |= LOGON_USED_LM_PASSWORD; + + /* copy data to client buffer */ + Status = NtlmCopyToClientBuffer(ClientRequest, BufferLength, &Buffer); + if (!NT_SUCCESS(Status)) + { + TRACE("DispatchTable.CopyToClientBuffer failed (Status 0x%08lx)\n", Status); + goto done; + } + + *ProfileBuffer = (PMSV1_0_LM20_LOGON_PROFILE)Buffer.ClientBaseAddress; + *ProfileBufferLength = BufferLength; +done: + /* On success Buffer.ClientBaseAddress will not be free */ + NtlmFreeClientBuffer(ClientRequest, !NT_SUCCESS(Status), &Buffer); + NtlmUStrFree(&ComputerNameUCS); + return Status; +} + static PSID AppendRidToSid(PSID SrcSid, @@ -931,7 +1030,72 @@ LsaApLogonUserEx2_Network( _Out_ PULONG LogonProfileSize, _Out_ PNTSTATUS SubStatus) { - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PMSV1_0_LM20_LOGON LogonInfo; + ULONG_PTR PtrOffset; + + *LogonProfile = NULL; + *LogonProfileSize = 0; + *UserInfoPtr = NULL; + *AccountDomainSidPtr = NULL; + *SpecialAccount = FALSE; + LogonInfo = ProtocolSubmitBuffer; + + if (SubmitBufferSize < sizeof(MSV1_0_LM20_LOGON)) + { + ERR("Invalid SubmitBufferSize %lu\n", SubmitBufferSize); + return STATUS_INVALID_PARAMETER; + } + + /* Fix-up pointers in the authentication info */ + PtrOffset = (ULONG_PTR)ProtocolSubmitBuffer - (ULONG_PTR)ClientBufferBase; + + if ((!NtlmFixupAndValidateUStr(&LogonInfo->LogonDomainName, PtrOffset)) || + (!NtlmFixupAndValidateUStr(&LogonInfo->UserName, PtrOffset)) || + (!NtlmFixupAndValidateUStr(&LogonInfo->Workstation, PtrOffset)) || + (!NtlmFixupAStr(&LogonInfo->CaseSensitiveChallengeResponse, PtrOffset)) || + (!NtlmFixupAStr(&LogonInfo->CaseInsensitiveChallengeResponse, PtrOffset))) + { + return STATUS_INVALID_PARAMETER; + } + + LogonPwdData->IsNetwork = TRUE; + LogonPwdData->LogonInfo = LogonInfo; + LogonPwdData->ComputerName = ComputerName; + Status = SamValidateUser(Network, + &LogonInfo->UserName, + &LogonInfo->LogonDomainName, + LogonPwdData, + ComputerName, + SpecialAccount, + AccountDomainSidPtr, + UserHandlePtr, + UserInfoPtr, + SubStatus); + if (!NT_SUCCESS(Status)) + { + ERR("SamValidateUser failed with 0x%lx\n", Status); + return Status; + } + + if (LogonInfo->ParameterControl & MSV1_0_RETURN_PROFILE_PATH) + { + Status = BuildLm20LogonProfileBuffer(ClientRequest, + *UserInfoPtr, + LogonPwdData, + LogonProfile, + LogonProfileSize); + if (!NT_SUCCESS(Status)) + { + ERR("BuildLm20LogonProfileBuffer failed with 0x%lx\n", Status); + return Status; + } + } + + *LogonUserRef = &LogonInfo->UserName; + *LogonDomainRef = &LogonInfo->LogonDomainName; + + return Status; } /* @@ -1325,39 +1489,6 @@ SpLsaModeInitialize( *PackageVersion = SECPKG_INTERFACE_VERSION; - RtlZeroMemory(NtlmLsaFn, sizeof(NtlmLsaFn)); - - /* msv1_0 (XP, win2k) returns NULL for - * InitializePackage, LsaLogonUser,LsaLogonUserEx, - * SpQueryContextAttributes and SpAddCredentials */ - NtlmLsaFn[0].InitializePackage = NULL; - NtlmLsaFn[0].LsaLogonUser = NULL; - NtlmLsaFn[0].CallPackage = LsaApCallPackage; - NtlmLsaFn[0].LogonTerminated = LsaApLogonTerminated; - NtlmLsaFn[0].CallPackageUntrusted = LsaApCallPackageUntrusted; - NtlmLsaFn[0].CallPackagePassthrough = LsaApCallPackagePassthrough; - NtlmLsaFn[0].LogonUserEx = NULL; - NtlmLsaFn[0].LogonUserEx2 = LsaApLogonUserEx2; - NtlmLsaFn[0].Initialize = SpInitialize; - NtlmLsaFn[0].Shutdown = LsaSpShutDown; - NtlmLsaFn[0].GetInfo = LsaSpGetInfoW; - NtlmLsaFn[0].AcceptCredentials = SpAcceptCredentials; - NtlmLsaFn[0].SpAcquireCredentialsHandle = LsaSpAcquireCredentialsHandle; - NtlmLsaFn[0].SpQueryCredentialsAttributes = LsaSpQueryCredentialsAttributes; - NtlmLsaFn[0].FreeCredentialsHandle = LsaSpFreeCredentialsHandle; - NtlmLsaFn[0].SaveCredentials = LsaSpSaveCredentials; - NtlmLsaFn[0].GetCredentials = LsaSpGetCredentials; - NtlmLsaFn[0].DeleteCredentials = LsaSpDeleteCredentials; - NtlmLsaFn[0].InitLsaModeContext = LsaSpInitLsaModeContext; - NtlmLsaFn[0].AcceptLsaModeContext = LsaSpAcceptLsaModeContext; - NtlmLsaFn[0].DeleteContext = LsaSpDeleteContext; - NtlmLsaFn[0].ApplyControlToken = LsaSpApplyControlToken; - NtlmLsaFn[0].GetUserInfo = LsaSpGetUserInfo; - NtlmLsaFn[0].GetExtendedInformation = LsaSpGetExtendedInformation; - NtlmLsaFn[0].SpQueryContextAttributes = NULL; - NtlmLsaFn[0].SpAddCredentials = NULL; - NtlmLsaFn[0].SetExtendedInformation = LsaSpSetExtendedInformation; - *ppTables = NtlmLsaFn; *pcTables = 1; diff --git a/dll/win32/msv1_0/msv1_0.h b/dll/win32/msv1_0/msv1_0.h index 1b656bca4f1..40b6c6bfc75 100644 --- a/dll/win32/msv1_0/msv1_0.h +++ b/dll/win32/msv1_0/msv1_0.h @@ -326,4 +326,62 @@ SystemFunction012(const BYTE *in, const BYTE *key, LPBYTE out); +NTSTATUS +NTAPI +LsaApCallPackage( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ PVOID ProtocolSubmitBuffer, + _In_ PVOID ClientBufferBase, + _In_ ULONG SubmitBufferLength, + _Out_ PVOID *ProtocolReturnBuffer, + _Out_ PULONG ReturnBufferLength, + _Out_ PNTSTATUS ProtocolStatus); + +NTSTATUS +NTAPI +LsaApCallPackagePassthrough( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ PVOID ProtocolSubmitBuffer, + _In_ PVOID ClientBufferBase, + _In_ ULONG SubmitBufferLength, + _Out_ PVOID *ProtocolReturnBuffer, + _Out_ PULONG ReturnBufferLength, + _Out_ PNTSTATUS ProtocolStatus); + +NTSTATUS +NTAPI +LsaApCallPackageUntrusted( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ PVOID ProtocolSubmitBuffer, + _In_ PVOID ClientBufferBase, + _In_ ULONG SubmitBufferLength, + _Out_ PVOID *ProtocolReturnBuffer, + _Out_ PULONG ReturnBufferLength, + _Out_ PNTSTATUS ProtocolStatus); + +VOID +NTAPI +LsaApLogonTerminated( + _In_ PLUID LogonId); + +NTSTATUS +NTAPI +LsaApLogonUserEx2( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ SECURITY_LOGON_TYPE LogonType, + _In_ PVOID ProtocolSubmitBuffer, + _In_ PVOID ClientBufferBase, + _In_ ULONG SubmitBufferSize, + _Out_ PVOID *ProfileBuffer, + _Out_ PULONG ProfileBufferSize, + _Out_ PLUID LogonId, + _Out_ PNTSTATUS SubStatus, + _Out_ PLSA_TOKEN_INFORMATION_TYPE TokenInformationType, + _Out_ PVOID *TokenInformation, + _Out_ PUNICODE_STRING *AccountName, + _Out_ PUNICODE_STRING *AuthenticatingAuthority, + _Out_ PUNICODE_STRING *MachineName, + _Out_ PSECPKG_PRIMARY_CRED PrimaryCredentials, + _Out_ PSECPKG_SUPPLEMENTAL_CRED_ARRAY *SupplementalCredentials); + /* EOF */ diff --git a/dll/win32/msv1_0/ntlm/global.c b/dll/win32/msv1_0/ntlm/global.c index ba1082f9ff9..12057fd2084 100644 --- a/dll/win32/msv1_0/ntlm/global.c +++ b/dll/win32/msv1_0/ntlm/global.c @@ -12,6 +12,47 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntlm); /* globals */ +NTLM_MODE NtlmMode = NtlmUnknownMode; + +LSA_DISPATCH_TABLE DispatchTable; + +PLSA_SECPKG_FUNCTION_TABLE LsaFunctions = NULL; +/* msv1_0 (XP, win2k) returns NULL for + * InitializePackage, LsaLogonUser,LsaLogonUserEx, + * SpQueryContextAttributes and SpAddCredentials */ +SECPKG_FUNCTION_TABLE NtlmLsaFn[1] = +{ + { + .InitializePackage = NULL, + .LsaLogonUser = NULL, + .CallPackage = LsaApCallPackage, + .LogonTerminated = LsaApLogonTerminated, + .CallPackageUntrusted = LsaApCallPackageUntrusted, + .CallPackagePassthrough = LsaApCallPackagePassthrough, + .LogonUserEx = NULL, + .LogonUserEx2 = LsaApLogonUserEx2, + .Initialize = SpInitialize, + .Shutdown = LsaSpShutDown, + .GetInfo = LsaSpGetInfoW, + .AcceptCredentials = SpAcceptCredentials, + .SpAcquireCredentialsHandle = LsaSpAcquireCredentialsHandle, + .SpQueryCredentialsAttributes = LsaSpQueryCredentialsAttributes, + .FreeCredentialsHandle = LsaSpFreeCredentialsHandle, + .SaveCredentials = LsaSpSaveCredentials, + .GetCredentials = LsaSpGetCredentials, + .DeleteCredentials = LsaSpDeleteCredentials, + .InitLsaModeContext = LsaSpInitLsaModeContext, + .AcceptLsaModeContext = LsaSpAcceptLsaModeContext, + .DeleteContext = LsaSpDeleteContext, + .ApplyControlToken = LsaSpApplyControlToken, + .GetUserInfo = LsaSpGetUserInfo, + .GetExtendedInformation = LsaSpGetExtendedInformation, + .SpQueryContextAttributes = NULL, + .SpAddCredentials = NULL, + .SetExtendedInformation = LsaSpSetExtendedInformation + } +}; + PSECPKG_DLL_FUNCTIONS UsrFunctions = NULL; SECPKG_USER_FUNCTION_TABLE NtlmUsrFn[1] = { diff --git a/dll/win32/msv1_0/ntlm/global.h b/dll/win32/msv1_0/ntlm/global.h index 2ee2f1092dd..4b83d232bc4 100644 --- a/dll/win32/msv1_0/ntlm/global.h +++ b/dll/win32/msv1_0/ntlm/global.h @@ -1,17 +1,29 @@ /* * PROJECT: Authentication Package DLL * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) - * PURPOSE: ntlm globals definitions (header) + * PURPOSE: NTLM globals definitions (header) * COPYRIGHT: Copyright 2011 Samuel Serapión - * Copyright 2020 Andreas Maier (staubim(a)quantentunnel.de) + * Copyright 2020 Andreas Maier <staubim(a)quantentunnel.de> */ -#ifndef _MSV1_0_NTLM_GLOBALS_H_ -#define _MSV1_0_NTLM_GLOBALS_H_ +#pragma once +/* functions provided by LSA in SpInitialize */ +extern PLSA_SECPKG_FUNCTION_TABLE LsaFunctions; +/* functions we provide to LSA in SpLsaModeInitialize */ +extern SECPKG_FUNCTION_TABLE NtlmLsaFn[1]; /* functions provided by LSA in SpInstanceInit */ extern PSECPKG_DLL_FUNCTIONS UsrFunctions; /* functions we provide to LSA in SpUserModeInitialize */ extern SECPKG_USER_FUNCTION_TABLE NtlmUsrFn[1]; -#endif +extern LSA_DISPATCH_TABLE DispatchTable; + +typedef enum _NTLM_MODE +{ + NtlmUnknownMode = 0, + NtlmLsaMode = 1, + NtlmUserMode +} NTLM_MODE, *PNTLM_MODE; + +extern NTLM_MODE NtlmMode; diff --git a/dll/win32/msv1_0/ntlm/protocol.h b/dll/win32/msv1_0/ntlm/protocol.h new file mode 100644 index 00000000000..e379845eb80 --- /dev/null +++ b/dll/win32/msv1_0/ntlm/protocol.h @@ -0,0 +1,24 @@ +/* + * PROJECT: Authentication Package DLL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: NTLM protocol definitions (header) + * COPYRIGHT: Copyright 2011 Samuel Serapión + * Copyright 2020 Andreas Maier <staubim(a)quantentunnel.de> + */ + +#pragma once + +typedef struct _CYPHER_BLOCK +{ + CHAR data[8]; +} CYPHER_BLOCK, *PCYPHER_BLOCK; + +typedef struct _USER_SESSION_KEY +{ + CYPHER_BLOCK data[2]; +} USER_SESSION_KEY, *PUSER_SESSION_KEY; + +typedef struct _LANMAN_SESSION_KEY +{ + UINT8 data[MSV1_0_LANMAN_SESSION_KEY_LENGTH]; +} LANMAN_SESSION_KEY, *PLANMAN_SESSION_KEY; diff --git a/dll/win32/msv1_0/ntlm/util.c b/dll/win32/msv1_0/ntlm/util.c new file mode 100644 index 00000000000..948a0b72e09 --- /dev/null +++ b/dll/win32/msv1_0/ntlm/util.c @@ -0,0 +1,367 @@ +/* + * PROJECT: Authentication Package DLL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Utils for msv1_0 + * COPYRIGHT: Copyright 2011 Samuel Serapión + * Copyright 2020 Andreas Maier <staubim(a)quantentunnel.de> + */ + +#include "../precomp.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(ntlm); + +#define NTLM_ALLOC_TAG "NTLM" +#define NTLM_ALLOC_TAG_SIZE strlen(NTLM_ALLOC_TAG) + +PVOID +NtlmAllocate( + _In_ size_t Size, + _In_ bool UsePrivateLsaHeap) +{ + PVOID buffer = NULL; + + if (Size == 0) + { + ERR("Allocating 0 bytes!\n"); + return NULL; + } + + Size += NTLM_ALLOC_TAG_SIZE; + + switch (NtlmMode) + { + case NtlmLsaMode: + { + if (UsePrivateLsaHeap) + buffer = LsaFunctions->AllocatePrivateHeap(Size); + else + buffer = LsaFunctions->AllocateLsaHeap(Size); + + if (buffer != NULL) + RtlZeroMemory(buffer, Size); + break; + } + case NtlmUserMode: + { + buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Size); + break; + } + default: + { + ERR("NtlmState unknown!\n"); + break; + } + } + + memcpy(buffer, NTLM_ALLOC_TAG, NTLM_ALLOC_TAG_SIZE); + buffer = (PBYTE)buffer + NTLM_ALLOC_TAG_SIZE; + + return buffer; +} + +VOID +NtlmFree( + _In_ PVOID Buffer, + _In_ bool FromPrivateLsaHeap) +{ + if (Buffer) + { + Buffer = (PBYTE)Buffer - NTLM_ALLOC_TAG_SIZE; + ASSERT(memcmp(Buffer, NTLM_ALLOC_TAG, NTLM_ALLOC_TAG_SIZE) == 0); + *(char*)Buffer = 'D'; + + switch (NtlmMode) + { + case NtlmLsaMode: + { + if (FromPrivateLsaHeap) + LsaFunctions->FreePrivateHeap(Buffer); + else + LsaFunctions->FreeLsaHeap(Buffer); + break; + } + case NtlmUserMode: + { + HeapFree(GetProcessHeap(), HEAP_ZERO_MEMORY, Buffer); + break; + } + default: + { + ERR("NtlmState unknown!\n"); + break; + } + } + } + else + { + ERR("Trying to free NULL!\n"); + } +} + +bool +NtlmUStrAlloc( + _Inout_ PUNICODE_STRING Dst, + _In_ UINT16 SizeInBytes, + _In_ UINT16 InitLength) +{ + Dst->Length = InitLength; + Dst->MaximumLength = SizeInBytes; + Dst->Buffer = NtlmAllocate(SizeInBytes, false); + return (Dst->Buffer != NULL); +} + +VOID +NtlmUStrFree( + _In_ PUNICODE_STRING String) +{ + if (String == NULL || String->Buffer == NULL || String->MaximumLength == 0) + return; + + NtlmFree(String->Buffer, false); + String->Buffer = NULL; + String->MaximumLength = 0; +} + +/** + * @brief Helper to fill a WCHAR-String in a struct. + * The stringdata is appended to the struct. + * The function does not allocate memory. + * + * @param[in] DataStart + * Start address of the struct + * + * @param[in] DataSize + * Size of allocated memory (including payload) + * + * @param[out] DstDataWPtr + * Pointer to the WCHAR* datafield. The address of the data will be written to it. + * + * @param[in] SrcDataW + * Data to write/append at pOffset (payload). pOffset will be increased after writing data. + * + * @param[in] SrcDataLen + * SrcDataLen is the length in bytes without terminator. + * if 0 it will be autodetected by assuming a 0-terminating string. + * + * @param[in,out] AbsoluteOffsetPtr + * Current absolute offset. Will be increased by data length. + * + * @param[in] TerminateWith0 + * Whether to terminate the string with a NULL-char. + * + * @return FALSE if something went wrong + */ +static +bool +NtlmStructWriteStrW( + _In_ PVOID DataStart, + _In_ ULONG DataSize, + _Out_ PWCHAR* DstDataWPtr, + _In_ const WCHAR* SrcDataW, + _In_ ULONG SrcDataLen, + _Inout_ PBYTE* AbsoluteOffsetPtr, + _In_ bool TerminateWith0) +{ + ULONG SrcDataMaxLen; + + if (SrcDataLen == 0) + SrcDataLen = wcslen(SrcDataW) * sizeof(WCHAR); + + SrcDataMaxLen = SrcDataLen; + if (TerminateWith0) + SrcDataMaxLen += sizeof(WCHAR); + + if (*AbsoluteOffsetPtr < (PBYTE)DataStart) + { + ERR("Invalid offset\n"); + return false; + } + + if (*AbsoluteOffsetPtr + SrcDataMaxLen > (PBYTE)DataStart + DataSize) + { + ERR("Out of bounds!\n"); + return false; + } + + memcpy(*AbsoluteOffsetPtr, SrcDataW, SrcDataLen); + *DstDataWPtr = (WCHAR*)*AbsoluteOffsetPtr; + if (TerminateWith0) + (*DstDataWPtr)[SrcDataLen / sizeof(WCHAR)] = 0; + *AbsoluteOffsetPtr += SrcDataMaxLen; + + return true; +} + +bool +NtlmUStrWriteToStruct( + _In_ PVOID DataStart, + _In_ ULONG DataSize, + _Out_ PUNICODE_STRING DstData, + _In_ const PUNICODE_STRING SrcData, + _Inout_ PBYTE* AbsoluteOffsetPtr, + _In_ bool TerminateWith0) +{ + if (!NtlmStructWriteStrW(DataStart, + DataSize, + &DstData->Buffer, + SrcData->Buffer, + SrcData->Length, + AbsoluteOffsetPtr, + TerminateWith0)) + return false; + + DstData->Length = SrcData->Length; + DstData->MaximumLength = SrcData->Length; + if (TerminateWith0) + SrcData->MaximumLength += sizeof(WCHAR); + + return true; +} + +bool +NtlmFixupAndValidateUStr( + _Inout_ PUNICODE_STRING String, + _In_ ULONG_PTR FixupOffset) +{ + NTSTATUS Status; + + if (String->Length) + { + String->Buffer = FIXUP_POINTER(String->Buffer, FixupOffset); + String->MaximumLength = String->Length; + } + else + { + String->Buffer = NULL; + String->MaximumLength = 0; + } + + Status = RtlValidateUnicodeString(0, String); + return NT_SUCCESS(Status); +} + +bool +NtlmFixupAStr( + _Inout_ PSTRING String, + _In_ ULONG_PTR FixupOffset) +{ + if (String->Length) + { + String->Buffer = (PCHAR)FIXUP_POINTER(String->Buffer, FixupOffset); + String->MaximumLength = String->Length; + } + else + { + String->Buffer = NULL; + String->MaximumLength = 0; + } + + return true; +} + +NTSTATUS +NtlmAllocateClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ ULONG BufferLength, + _Inout_ PNTLM_CLIENT_BUFFER Buffer) +{ + NTSTATUS Status = STATUS_SUCCESS; + + if (!Buffer) + return STATUS_NO_MEMORY; + + Buffer->LocalBuffer = NtlmAllocate(BufferLength, false); + if (!Buffer->LocalBuffer) + return STATUS_NO_MEMORY; + + if ((HANDLE)ClientRequest == INVALID_HANDLE_VALUE) + { + Buffer->ClientBaseAddress = Buffer->LocalBuffer; + //if (!ClientBaseAddress) + // return STATUS_INSUFFICIENT_RESOURCES; + } + else + { + Status = DispatchTable.AllocateClientBuffer(ClientRequest, + BufferLength, + &Buffer->ClientBaseAddress); + if (!NT_SUCCESS(Status)) + { + NtlmFree(Buffer->LocalBuffer, false); + Buffer->LocalBuffer = NULL; + } + //FIXME: Maybe we have to free ClientBaseAddress if something + // goes wrong ...? I'm not sure about that ... + } + return Status; +} + +NTSTATUS +NtlmCopyToClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ ULONG BufferLength, + _Inout_ PNTLM_CLIENT_BUFFER Buffer) +{ + NTSTATUS Status = STATUS_SUCCESS; + + if ((HANDLE)ClientRequest == INVALID_HANDLE_VALUE) + { + // If ClientRequest ist INVALID_HANDLE_VALUE + // Buffer->LocalBuffer == Buffer->ClientBaseAddress + if (Buffer->ClientBaseAddress != Buffer->LocalBuffer) + { + ERR("Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n"); + return STATUS_INTERNAL_ERROR; + } + } + else + { + if (!Buffer->ClientBaseAddress || + !Buffer->LocalBuffer) + { + ERR("Invalid Buffer - not allocated!\n"); + return STATUS_NO_MEMORY; + } + Status = DispatchTable.CopyToClientBuffer(ClientRequest, + BufferLength, + Buffer->ClientBaseAddress, + Buffer->LocalBuffer); + } + return Status; +} + +VOID +NtlmFreeClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ bool FreeClientBuffer, + _Inout_ PNTLM_CLIENT_BUFFER Buffer) +{ + if (!Buffer->ClientBaseAddress) + return; + + if ((HANDLE)ClientRequest == INVALID_HANDLE_VALUE) + { + if (Buffer->ClientBaseAddress != Buffer->LocalBuffer) + { + ERR("Buffer->ClientBaseAddress != Buffer->LocalBuffer (something must be wrong!)\n"); + return; + } + // LocalBuffer and ClientBaseAddress is the same + // so we have only to free it if FreeClientBuffer is TRUE. + Buffer->LocalBuffer = NULL; + if (FreeClientBuffer) + { + NtlmFree(Buffer->ClientBaseAddress, false); + Buffer->ClientBaseAddress = NULL; + } + } + else + { + NtlmFree(Buffer->LocalBuffer, false); + Buffer->LocalBuffer = NULL; + if (FreeClientBuffer) + DispatchTable.FreeClientBuffer(ClientRequest, Buffer->ClientBaseAddress); + Buffer->ClientBaseAddress = NULL; + } +} diff --git a/dll/win32/msv1_0/ntlm/util.h b/dll/win32/msv1_0/ntlm/util.h new file mode 100644 index 00000000000..69cfa5077ce --- /dev/null +++ b/dll/win32/msv1_0/ntlm/util.h @@ -0,0 +1,64 @@ +/* + * PROJECT: Authentication Package DLL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Utils for msv1_0 (header) + * COPYRIGHT: Copyright 2011 Samuel Serapión + * Copyright 2020 Andreas Maier <staubim(a)quantentunnel.de> + */ + +#pragma once + +bool +NtlmUStrAlloc( + _Out_ PUNICODE_STRING Dst, + _In_ UINT16 SizeInBytes, + _In_ UINT16 InitLength); + +VOID +NtlmUStrFree( + _In_ PUNICODE_STRING String); + +bool +NtlmUStrWriteToStruct( + _In_ PVOID DataStart, + _In_ ULONG DataSize, + _Out_ PUNICODE_STRING DstData, + _In_ const PUNICODE_STRING SrcData, + _In_ OUT PBYTE* AbsoluteOffsetPtr, + _In_ bool TerminateWith0); + +/* misc */ +bool +NtlmFixupAndValidateUStr( + _Inout_ PUNICODE_STRING String, + _In_ ULONG_PTR FixupOffset); + +bool +NtlmFixupAStr( + _Inout_ PSTRING String, + _In_ ULONG_PTR FixupOffset); + +/* ClientBuffer */ +typedef struct _NTLM_CLIENT_BUFFER +{ + PVOID ClientBaseAddress; + PVOID LocalBuffer; +} NTLM_CLIENT_BUFFER, *PNTLM_CLIENT_BUFFER; + +NTSTATUS +NtlmAllocateClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ ULONG BufferLength, + _Inout_ PNTLM_CLIENT_BUFFER Buffer); + +NTSTATUS +NtlmCopyToClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ ULONG BufferLength, + _In_ OUT PNTLM_CLIENT_BUFFER Buffer); + +VOID +NtlmFreeClientBuffer( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ bool FreeClientBuffer, + _Inout_ PNTLM_CLIENT_BUFFER Buffer); diff --git a/dll/win32/msv1_0/precomp.h b/dll/win32/msv1_0/precomp.h index cf7b0842d50..71b2524844c 100644 --- a/dll/win32/msv1_0/precomp.h +++ b/dll/win32/msv1_0/precomp.h @@ -32,6 +32,8 @@ //#include <lsass/lsasrv.h> #include "ntlm/global.h" +#include "ntlm/protocol.h" +#include "ntlm/util.h" #include "lsa.h" #include "msv1_0.h" #include "sam.h" diff --git a/dll/win32/msv1_0/sam.c b/dll/win32/msv1_0/sam.c index 0ffcf20d4f7..684a9f89506 100644 --- a/dll/win32/msv1_0/sam.c +++ b/dll/win32/msv1_0/sam.c @@ -476,6 +476,8 @@ SamValidateUser( NTSTATUS Status = STATUS_SUCCESS; *SpecialAccount = FALSE; + *UserInfoPtr = NULL; + *SubStatus = STATUS_SUCCESS; /* Check for special accounts */ // FIXME: Windows does not do this that way!! (msv1_0 does not contain these hardcoded values) diff --git a/dll/win32/msv1_0/sam.h b/dll/win32/msv1_0/sam.h index 2f82f0e1c6f..d02f2263751 100644 --- a/dll/win32/msv1_0/sam.h +++ b/dll/win32/msv1_0/sam.h @@ -7,6 +7,13 @@ #pragma once +typedef enum _LSA_SAM_NETLOGON_TYPE +{ + NetLogonAnonymous = 0, + NetLogonLmKey, + NetLogonNtKey +} LSA_SAM_NETLOGON_TYPE; + typedef struct _LSA_SAM_PWD_DATA { /* TRUE: PlainPwd is filled, @@ -15,7 +22,12 @@ typedef struct _LSA_SAM_PWD_DATA PUNICODE_STRING PlainPwd; /* Input (IsNetwork = TRUE) */ + PMSV1_0_LM20_LOGON LogonInfo; PUNICODE_STRING ComputerName; + /* Result (IsNetwork = TRUE) */ + LSA_SAM_NETLOGON_TYPE LogonType; + LANMAN_SESSION_KEY LanmanSessionKey; + USER_SESSION_KEY UserSessionKey; } LSA_SAM_PWD_DATA, *PLSA_SAM_PWD_DATA; /**
3 years
1
0
0
0
[reactos] 04/05: [MSV1_0] Stub LsaApLogonUserEx2_Network (4/5)
by Andreas Maier
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=dbca423cf889a2efd18b3…
commit dbca423cf889a2efd18b3e1108c3cf5fe4c7570f Author: Andreas Maier <staubim(a)quantentunnel.de> AuthorDate: Mon Jun 22 19:25:47 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sat Dec 25 15:55:43 2021 +0300 [MSV1_0] Stub LsaApLogonUserEx2_Network (4/5) This is a part of the Partial Network Login Implementation PR. --- dll/win32/msv1_0/msv1_0.c | 70 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 9 deletions(-) diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index c60453f1745..eefddf3d0e0 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -909,6 +909,31 @@ LsaApLogonTerminated(IN PLUID LogonId) } +/* + * Handle Network logon + */ +static +NTSTATUS +LsaApLogonUserEx2_Network( + _In_ PLSA_CLIENT_REQUEST ClientRequest, + _In_ PVOID ProtocolSubmitBuffer, + _In_ PVOID ClientBufferBase, + _In_ ULONG SubmitBufferSize, + _In_ PUNICODE_STRING ComputerName, + _Out_ PUNICODE_STRING* LogonUserRef, + _Out_ PUNICODE_STRING* LogonDomainRef, + _Inout_ PLSA_SAM_PWD_DATA LogonPwdData, + _Out_ SAMPR_HANDLE* UserHandlePtr, + _Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr, + _Out_ PRPC_SID* AccountDomainSidPtr, + _Out_ PBOOL SpecialAccount, + _Out_ PMSV1_0_LM20_LOGON_PROFILE *LogonProfile, + _Out_ PULONG LogonProfileSize, + _Out_ PNTSTATUS SubStatus) +{ + return STATUS_NOT_IMPLEMENTED; +} + /* * @implemented */ @@ -1080,6 +1105,26 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, // TODO: If LogonType == Service, do some extra work using LogonInfo->Password. } + else if (LogonType == Network) + { + Status = LsaApLogonUserEx2_Network(ClientRequest, + ProtocolSubmitBuffer, + ClientBufferBase, + SubmitBufferSize, + &ComputerName, + &LogonUserName, + &LogonDomain, + &LogonPwdData, + &UserHandle, + &UserInfo, + &AccountDomainSid, + &SpecialAccount, + (PMSV1_0_LM20_LOGON_PROFILE*)ProfileBuffer, + ProfileBufferSize, + SubStatus); + if (!NT_SUCCESS(Status)) + goto done; + } else { FIXME("LogonType %lu is not supported yet!\n", LogonType); @@ -1120,16 +1165,23 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, SessionCreated = TRUE; - /* Build and fill the interactive profile buffer */ - Status = BuildInteractiveProfileBuffer(ClientRequest, - UserInfo, - ComputerNameData, - (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer, - ProfileBufferSize); - if (!NT_SUCCESS(Status)) + if (LogonType == Interactive || LogonType == Batch || LogonType == Service) { - TRACE("BuildInteractiveProfileBuffer failed (Status %08lx)\n", Status); - goto done; + /* Build and fill the interactive profile buffer */ + Status = BuildInteractiveProfileBuffer(ClientRequest, + UserInfo, + ComputerName.Buffer, + (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer, + ProfileBufferSize); + if (!NT_SUCCESS(Status)) + { + TRACE("BuildInteractiveProfileBuffer failed (Status %08lx)\n", Status); + goto done; + } + } + else if (LogonType == Network) + { + //FIXME: no need to do anything, its already done ... } /* Return the token information type */
3 years
1
0
0
0
[reactos] 03/05: [MSV1_0] Extract the code for SamValidateUser function (3/5)
by Andreas Maier
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=472b32d9020cdd3607c0c…
commit 472b32d9020cdd3607c0c6ca17779ec7de6b1b8a Author: Andreas Maier <staubim(a)quantentunnel.de> AuthorDate: Mon Jun 22 19:01:37 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sat Dec 25 15:55:43 2021 +0300 [MSV1_0] Extract the code for SamValidateUser function (3/5) This is a part of the Partial Network Login Implementation PR. - Extract code for SamValidateUser (sam.c) from LsaApLogonUserEx2. - Make SamValidateNormalUser a local function for sam.c - Move dependent function GetNtAuthorityDomainSid to sam.c --- dll/win32/msv1_0/msv1_0.c | 186 ++++++++++++++-------------------------------- dll/win32/msv1_0/sam.c | 116 +++++++++++++++++++++++++++++ dll/win32/msv1_0/sam.h | 15 ++-- 3 files changed, 181 insertions(+), 136 deletions(-) diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index e4e07f8b7bc..c60453f1745 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -20,28 +20,6 @@ LSA_DISPATCH_TABLE DispatchTable; /* FUNCTIONS ***************************************************************/ - -static -NTSTATUS -GetNtAuthorityDomainSid(PRPC_SID *Sid) -{ - SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - ULONG Length = 0; - - Length = RtlLengthRequiredSid(0); - *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); - if (*Sid == NULL) - { - ERR("Failed to allocate SID\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } - - RtlInitializeSid(*Sid,&NtAuthority, 0); - - return STATUS_SUCCESS; -} - - static NTSTATUS BuildInteractiveProfileBuffer(IN PLSA_CLIENT_REQUEST ClientRequest, @@ -953,15 +931,12 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, OUT PSECPKG_PRIMARY_CRED PrimaryCredentials, /* Not supported yet */ OUT PSECPKG_SUPPLEMENTAL_CRED_ARRAY *SupplementalCredentials) /* Not supported yet */ { - static const UNICODE_STRING NtAuthorityU = RTL_CONSTANT_STRING(L"NT AUTHORITY"); - static const UNICODE_STRING LocalServiceU = RTL_CONSTANT_STRING(L"LocalService"); - static const UNICODE_STRING NetworkServiceU = RTL_CONSTANT_STRING(L"NetworkService"); - NTSTATUS Status; - PMSV1_0_INTERACTIVE_LOGON LogonInfo; UNICODE_STRING ComputerName; WCHAR ComputerNameData[MAX_COMPUTERNAME_LENGTH + 1]; + PUNICODE_STRING LogonUserName = NULL; LSA_SAM_PWD_DATA LogonPwdData = { FALSE, NULL }; + PUNICODE_STRING LogonDomain = NULL; SAMPR_HANDLE UserHandle = NULL; PRPC_SID AccountDomainSid = NULL; PSAMPR_USER_INFO_BUFFER UserInfo = NULL; @@ -997,6 +972,7 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, LogonType == Batch || LogonType == Service) { + PMSV1_0_INTERACTIVE_LOGON LogonInfo; ULONG_PTR PtrOffset; if (SubmitBufferSize < sizeof(MSV1_0_INTERACTIVE_LOGON)) @@ -1092,8 +1068,11 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, if (!NT_SUCCESS(Status)) return STATUS_INVALID_PARAMETER; + LogonUserName = &LogonInfo->UserName; + LogonDomain = &LogonInfo->LogonDomainName; LogonPwdData.IsNetwork = FALSE; LogonPwdData.PlainPwd = &LogonInfo->Password; + LogonPwdData.ComputerName = &ComputerName; TRACE("Domain: %wZ\n", &LogonInfo->LogonDomainName); TRACE("User: %wZ\n", &LogonInfo->UserName); @@ -1108,80 +1087,18 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, } // TODO: Add other LogonType validity checks. - /* Check for special accounts */ - // FIXME: Windows does not do this that way!! (msv1_0 does not contain these hardcoded values) - if (RtlEqualUnicodeString(&LogonInfo->LogonDomainName, &NtAuthorityU, TRUE)) - { - SpecialAccount = TRUE; - - /* Get the authority domain SID */ - Status = GetNtAuthorityDomainSid(&AccountDomainSid); - if (!NT_SUCCESS(Status)) - { - ERR("GetNtAuthorityDomainSid() failed (Status 0x%08lx)\n", Status); - return Status; - } - - if (RtlEqualUnicodeString(&LogonInfo->UserName, &LocalServiceU, TRUE)) - { - TRACE("SpecialAccount: LocalService\n"); - - if (LogonType != Service) - return STATUS_LOGON_FAILURE; - - UserInfo = RtlAllocateHeap(RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(SAMPR_USER_ALL_INFORMATION)); - if (UserInfo == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - UserInfo->All.UserId = SECURITY_LOCAL_SERVICE_RID; - UserInfo->All.PrimaryGroupId = SECURITY_LOCAL_SERVICE_RID; - } - else if (RtlEqualUnicodeString(&LogonInfo->UserName, &NetworkServiceU, TRUE)) - { - TRACE("SpecialAccount: NetworkService\n"); - - if (LogonType != Service) - return STATUS_LOGON_FAILURE; - - UserInfo = RtlAllocateHeap(RtlGetProcessHeap(), - HEAP_ZERO_MEMORY, - sizeof(SAMPR_USER_ALL_INFORMATION)); - if (UserInfo == NULL) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - UserInfo->All.UserId = SECURITY_NETWORK_SERVICE_RID; - UserInfo->All.PrimaryGroupId = SECURITY_NETWORK_SERVICE_RID; - } - else - { - Status = STATUS_NO_SUCH_USER; - goto done; - } - } - else - { - TRACE("NormalAccount\n"); - Status = SamValidateNormalUser(&LogonInfo->UserName, - &LogonPwdData, - &ComputerName, - &AccountDomainSid, - &UserHandle, - &UserInfo, - SubStatus); - if (!NT_SUCCESS(Status)) - { - ERR("SamValidateNormalUser() failed (Status 0x%08lx)\n", Status); - return Status; - } - } + Status = SamValidateUser(LogonType, + LogonUserName, + LogonDomain, + &LogonPwdData, + &ComputerName, + &SpecialAccount, + &AccountDomainSid, + &UserHandle, + &UserInfo, + SubStatus); + if (!NT_SUCCESS(Status)) + goto done; /* Return logon information */ @@ -1254,44 +1171,51 @@ done: &InternalInfo); } - /* Return the account name */ - *AccountName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); - if (*AccountName != NULL) + if (NT_SUCCESS(Status)) { - (*AccountName)->Buffer = DispatchTable.AllocateLsaHeap(LogonInfo->UserName.Length + - sizeof(UNICODE_NULL)); - if ((*AccountName)->Buffer != NULL) + /* Return the account name */ + *AccountName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); + if ((LogonUserName != NULL) && + (*AccountName != NULL)) { - (*AccountName)->MaximumLength = LogonInfo->UserName.Length + - sizeof(UNICODE_NULL); - RtlCopyUnicodeString(*AccountName, &LogonInfo->UserName); + (*AccountName)->Buffer = DispatchTable.AllocateLsaHeap(LogonUserName->Length + + sizeof(UNICODE_NULL)); + if ((*AccountName)->Buffer != NULL) + { + (*AccountName)->MaximumLength = LogonUserName->Length + + sizeof(UNICODE_NULL); + RtlCopyUnicodeString(*AccountName, LogonUserName); + } } - } - /* Return the authenticating authority */ - *AuthenticatingAuthority = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); - if (*AuthenticatingAuthority != NULL) - { - (*AuthenticatingAuthority)->Buffer = DispatchTable.AllocateLsaHeap(LogonInfo->LogonDomainName.Length + - sizeof(UNICODE_NULL)); - if ((*AuthenticatingAuthority)->Buffer != NULL) + /* Return the authenticating authority */ + *AuthenticatingAuthority = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); + if ((LogonDomain != NULL) && + (*AuthenticatingAuthority != NULL)) { - (*AuthenticatingAuthority)->MaximumLength = LogonInfo->LogonDomainName.Length + - sizeof(UNICODE_NULL); - RtlCopyUnicodeString(*AuthenticatingAuthority, &LogonInfo->LogonDomainName); + (*AuthenticatingAuthority)->Buffer = DispatchTable.AllocateLsaHeap(LogonDomain->Length + + sizeof(UNICODE_NULL)); + if ((*AuthenticatingAuthority)->Buffer != NULL) + { + (*AuthenticatingAuthority)->MaximumLength = LogonDomain->Length + + sizeof(UNICODE_NULL); + RtlCopyUnicodeString(*AuthenticatingAuthority, LogonDomain); + } } - } - /* Return the machine name */ - *MachineName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); - if (*MachineName != NULL) - { - (*MachineName)->Buffer = DispatchTable.AllocateLsaHeap(ComputerName.MaximumLength); - if ((*MachineName)->Buffer != NULL) + /* Return the machine name */ + *MachineName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); + if (*MachineName != NULL) { - (*MachineName)->MaximumLength = ComputerName.MaximumLength; - (*MachineName)->Length = ComputerName.Length; - RtlCopyMemory((*MachineName)->Buffer, ComputerName.Buffer, ComputerName.MaximumLength); + (*MachineName)->Buffer = DispatchTable.AllocateLsaHeap(ComputerName.MaximumLength); + if ((*MachineName)->Buffer != NULL) + { + (*MachineName)->MaximumLength = ComputerName.MaximumLength; + (*MachineName)->Length = ComputerName.Length; + RtlCopyMemory((*MachineName)->Buffer, + ComputerName.Buffer, + ComputerName.MaximumLength); + } } } diff --git a/dll/win32/msv1_0/sam.c b/dll/win32/msv1_0/sam.c index 266c976b2f0..0ffcf20d4f7 100644 --- a/dll/win32/msv1_0/sam.c +++ b/dll/win32/msv1_0/sam.c @@ -238,6 +238,7 @@ MsvpCheckWorkstations( } +static NTSTATUS SamValidateNormalUser( _In_ PUNICODE_STRING UserName, @@ -431,3 +432,118 @@ done: return Status; } + + +static +NTSTATUS +GetNtAuthorityDomainSid( + _In_ PRPC_SID *Sid) +{ + SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; + ULONG Length = 0; + + Length = RtlLengthRequiredSid(0); + *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); + if (*Sid == NULL) + { + ERR("Failed to allocate SID\n"); + return STATUS_INSUFFICIENT_RESOURCES; + } + + RtlInitializeSid(*Sid,&NtAuthority, 0); + + return STATUS_SUCCESS; +} + + +NTSTATUS +SamValidateUser( + _In_ SECURITY_LOGON_TYPE LogonType, + _In_ PUNICODE_STRING LogonUserName, + _In_ PUNICODE_STRING LogonDomain, + _In_ PLSA_SAM_PWD_DATA LogonPwdData, + _In_ PUNICODE_STRING ComputerName, + _Out_ PBOOL SpecialAccount, + _Out_ PRPC_SID* AccountDomainSidPtr, + _Out_ SAMPR_HANDLE* UserHandlePtr, + _Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr, + _Out_ PNTSTATUS SubStatus) +{ + static const UNICODE_STRING NtAuthorityU = RTL_CONSTANT_STRING(L"NT AUTHORITY"); + static const UNICODE_STRING LocalServiceU = RTL_CONSTANT_STRING(L"LocalService"); + static const UNICODE_STRING NetworkServiceU = RTL_CONSTANT_STRING(L"NetworkService"); + + NTSTATUS Status = STATUS_SUCCESS; + + *SpecialAccount = FALSE; + + /* Check for special accounts */ + // FIXME: Windows does not do this that way!! (msv1_0 does not contain these hardcoded values) + if (RtlEqualUnicodeString(LogonDomain, &NtAuthorityU, TRUE)) + { + *SpecialAccount = TRUE; + + /* Get the authority domain SID */ + Status = GetNtAuthorityDomainSid(AccountDomainSidPtr); + if (!NT_SUCCESS(Status)) + { + ERR("GetNtAuthorityDomainSid() failed (Status 0x%08lx)\n", Status); + return Status; + } + + if (RtlEqualUnicodeString(LogonUserName, &LocalServiceU, TRUE)) + { + TRACE("SpecialAccount: LocalService\n"); + + if (LogonType != Service) + return STATUS_LOGON_FAILURE; + + *UserInfoPtr = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SAMPR_USER_ALL_INFORMATION)); + if (*UserInfoPtr == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + (*UserInfoPtr)->All.UserId = SECURITY_LOCAL_SERVICE_RID; + (*UserInfoPtr)->All.PrimaryGroupId = SECURITY_LOCAL_SERVICE_RID; + } + else if (RtlEqualUnicodeString(LogonUserName, &NetworkServiceU, TRUE)) + { + TRACE("SpecialAccount: NetworkService\n"); + + if (LogonType != Service) + return STATUS_LOGON_FAILURE; + + *UserInfoPtr = RtlAllocateHeap(RtlGetProcessHeap(), + HEAP_ZERO_MEMORY, + sizeof(SAMPR_USER_ALL_INFORMATION)); + if (*UserInfoPtr == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + (*UserInfoPtr)->All.UserId = SECURITY_NETWORK_SERVICE_RID; + (*UserInfoPtr)->All.PrimaryGroupId = SECURITY_NETWORK_SERVICE_RID; + } + else + { + return STATUS_NO_SUCH_USER; + } + } + else + { + TRACE("NormalAccount\n"); + Status = SamValidateNormalUser(LogonUserName, + LogonPwdData, + ComputerName, + AccountDomainSidPtr, + UserHandlePtr, + UserInfoPtr, + SubStatus); + if (!NT_SUCCESS(Status)) + { + ERR("SamValidateNormalUser() failed (Status 0x%08lx)\n", Status); + return Status; + } + } + + return Status; +} diff --git a/dll/win32/msv1_0/sam.h b/dll/win32/msv1_0/sam.h index 314989d16ba..2f82f0e1c6f 100644 --- a/dll/win32/msv1_0/sam.h +++ b/dll/win32/msv1_0/sam.h @@ -14,17 +14,22 @@ typedef struct _LSA_SAM_PWD_DATA BOOL IsNetwork; PUNICODE_STRING PlainPwd; + /* Input (IsNetwork = TRUE) */ + PUNICODE_STRING ComputerName; } LSA_SAM_PWD_DATA, *PLSA_SAM_PWD_DATA; /** - * @brief Validates a normal user by checking if it exists in the sam database. - * Further some other checks are done. + * @brief Validates a user by checking if it exists in the sam database. + * Some other checks are done further. */ NTSTATUS -SamValidateNormalUser( - _In_ PUNICODE_STRING UserName, - _In_ PLSA_SAM_PWD_DATA PwdData, +SamValidateUser( + _In_ SECURITY_LOGON_TYPE LogonType, + _In_ PUNICODE_STRING LogonUserName, + _In_ PUNICODE_STRING LogonDomain, + _In_ PLSA_SAM_PWD_DATA LogonPwdData, _In_ PUNICODE_STRING ComputerName, + _Out_ PBOOL SpecialAccount, _Out_ PRPC_SID* AccountDomainSidPtr, _Out_ SAMPR_HANDLE* UserHandlePtr, _Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr,
3 years
1
0
0
0
[reactos] 02/05: [MSV1_0] Extract SamValidateNormalUser to a separate file (2/5)
by Andreas Maier
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=045cd5d42f61b4976d96a…
commit 045cd5d42f61b4976d96a6fecca9a07ad9794617 Author: Andreas Maier <staubim(a)quantentunnel.de> AuthorDate: Sun Jun 21 23:47:30 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sat Dec 25 15:55:43 2021 +0300 [MSV1_0] Extract SamValidateNormalUser to a separate file (2/5) This is a part of the Partial Network Login Implementation PR. - Extract code for SamValidateNormalUser (sam.c) from LsaApLogonUserEx2. - Move dependent functions to sam.c: * GetAccountDomainSid * MsvpCheckPassword * MsvpCheckLogonHours * MsvpCheckWorkstations --- dll/win32/msv1_0/CMakeLists.txt | 1 + dll/win32/msv1_0/msv1_0.c | 411 ++------------------------------------ dll/win32/msv1_0/precomp.h | 3 +- dll/win32/msv1_0/sam.c | 433 ++++++++++++++++++++++++++++++++++++++++ dll/win32/msv1_0/sam.h | 31 +++ 5 files changed, 479 insertions(+), 400 deletions(-) diff --git a/dll/win32/msv1_0/CMakeLists.txt b/dll/win32/msv1_0/CMakeLists.txt index 3b2b5e7fd65..50fa39aa44b 100644 --- a/dll/win32/msv1_0/CMakeLists.txt +++ b/dll/win32/msv1_0/CMakeLists.txt @@ -5,6 +5,7 @@ list(APPEND SOURCE lsa.c msv1_0.c ntlm/global.c + sam.c user.c usercontext.c ${CMAKE_CURRENT_BINARY_DIR}/msv1_0_stubs.c diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index 38bdbc40179..e4e07f8b7bc 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -20,54 +20,6 @@ LSA_DISPATCH_TABLE DispatchTable; /* FUNCTIONS ***************************************************************/ -static -NTSTATUS -GetAccountDomainSid(PRPC_SID *Sid) -{ - LSAPR_HANDLE PolicyHandle = NULL; - PLSAPR_POLICY_INFORMATION PolicyInfo = NULL; - ULONG Length = 0; - NTSTATUS Status; - - Status = LsaIOpenPolicyTrusted(&PolicyHandle); - if (!NT_SUCCESS(Status)) - { - TRACE("LsaIOpenPolicyTrusted() failed (Status 0x%08lx)\n", Status); - return Status; - } - - Status = LsarQueryInformationPolicy(PolicyHandle, - PolicyAccountDomainInformation, - &PolicyInfo); - if (!NT_SUCCESS(Status)) - { - TRACE("LsarQueryInformationPolicy() failed (Status 0x%08lx)\n", Status); - goto done; - } - - Length = RtlLengthSid(PolicyInfo->PolicyAccountDomainInfo.Sid); - - *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); - if (*Sid == NULL) - { - ERR("Failed to allocate SID\n"); - Status = STATUS_INSUFFICIENT_RESOURCES; - goto done; - } - - memcpy(*Sid, PolicyInfo->PolicyAccountDomainInfo.Sid, Length); - -done: - if (PolicyInfo != NULL) - LsaIFree_LSAPR_POLICY_INFORMATION(PolicyAccountDomainInformation, - PolicyInfo); - - if (PolicyHandle != NULL) - LsarClose(&PolicyHandle); - - return Status; -} - static NTSTATUS @@ -790,182 +742,6 @@ done: } -static -NTSTATUS -MsvpCheckPassword(PUNICODE_STRING UserPassword, - PSAMPR_USER_INFO_BUFFER UserInfo) -{ - ENCRYPTED_NT_OWF_PASSWORD UserNtPassword; - ENCRYPTED_LM_OWF_PASSWORD UserLmPassword; - BOOLEAN UserLmPasswordPresent = FALSE; - BOOLEAN UserNtPasswordPresent = FALSE; - OEM_STRING LmPwdString; - CHAR LmPwdBuffer[15]; - NTSTATUS Status; - - TRACE("(%p %p)\n", UserPassword, UserInfo); - - /* Calculate the LM password and hash for the users password */ - LmPwdString.Length = 15; - LmPwdString.MaximumLength = 15; - LmPwdString.Buffer = LmPwdBuffer; - ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength); - - Status = RtlUpcaseUnicodeStringToOemString(&LmPwdString, - UserPassword, - FALSE); - if (NT_SUCCESS(Status)) - { - /* Calculate the LM hash value of the users password */ - Status = SystemFunction006(LmPwdString.Buffer, - (LPSTR)&UserLmPassword); - if (NT_SUCCESS(Status)) - { - UserLmPasswordPresent = TRUE; - } - } - - /* Calculate the NT hash of the users password */ - Status = SystemFunction007(UserPassword, - (LPBYTE)&UserNtPassword); - if (NT_SUCCESS(Status)) - { - UserNtPasswordPresent = TRUE; - } - - Status = STATUS_WRONG_PASSWORD; - - /* Succeed, if no password has been set */ - if (UserInfo->All.NtPasswordPresent == FALSE && - UserInfo->All.LmPasswordPresent == FALSE) - { - TRACE("No password check!\n"); - Status = STATUS_SUCCESS; - goto done; - } - - /* Succeed, if NT password matches */ - if (UserNtPasswordPresent && UserInfo->All.NtPasswordPresent) - { - TRACE("Check NT password hashes:\n"); - if (RtlEqualMemory(&UserNtPassword, - UserInfo->All.NtOwfPassword.Buffer, - sizeof(ENCRYPTED_NT_OWF_PASSWORD))) - { - TRACE(" success!\n"); - Status = STATUS_SUCCESS; - goto done; - } - - TRACE(" failed!\n"); - } - - /* Succeed, if LM password matches */ - if (UserLmPasswordPresent && UserInfo->All.LmPasswordPresent) - { - TRACE("Check LM password hashes:\n"); - if (RtlEqualMemory(&UserLmPassword, - UserInfo->All.LmOwfPassword.Buffer, - sizeof(ENCRYPTED_LM_OWF_PASSWORD))) - { - TRACE(" success!\n"); - Status = STATUS_SUCCESS; - goto done; - } - TRACE(" failed!\n"); - } - -done: - return Status; -} - - -static -BOOL -MsvpCheckLogonHours( - _In_ PSAMPR_LOGON_HOURS LogonHours, - _In_ PLARGE_INTEGER LogonTime) -{ -#if 0 - LARGE_INTEGER LocalLogonTime; - TIME_FIELDS TimeFields; - USHORT MinutesPerUnit, Offset; - BOOL bFound; - - FIXME("MsvpCheckLogonHours(%p %p)\n", LogonHours, LogonTime); - - if (LogonHours->UnitsPerWeek == 0 || LogonHours->LogonHours == NULL) - { - FIXME("No logon hours!\n"); - return TRUE; - } - - RtlSystemTimeToLocalTime(LogonTime, &LocalLogonTime); - RtlTimeToTimeFields(&LocalLogonTime, &TimeFields); - - FIXME("UnitsPerWeek: %u\n", LogonHours->UnitsPerWeek); - MinutesPerUnit = 10080 / LogonHours->UnitsPerWeek; - - Offset = ((TimeFields.Weekday * 24 + TimeFields.Hour) * 60 + TimeFields.Minute) / MinutesPerUnit; - FIXME("Offset: %us\n", Offset); - - bFound = (BOOL)(LogonHours->LogonHours[Offset / 8] & (1 << (Offset % 8))); - FIXME("Logon permitted: %s\n", bFound ? "Yes" : "No"); - - return bFound; -#endif - return TRUE; -} - - -static -BOOL -MsvpCheckWorkstations( - _In_ PRPC_UNICODE_STRING WorkStations, - _In_ PWSTR ComputerName) -{ - PWSTR pStart, pEnd; - BOOL bFound = FALSE; - - TRACE("MsvpCheckWorkstations(%p %S)\n", WorkStations, ComputerName); - - if (WorkStations->Length == 0 || WorkStations->Buffer == NULL) - { - TRACE("No workstations!\n"); - return TRUE; - } - - TRACE("Workstations: %wZ\n", WorkStations); - - pStart = WorkStations->Buffer; - for (;;) - { - pEnd = wcschr(pStart, L','); - if (pEnd != NULL) - *pEnd = UNICODE_NULL; - - TRACE("Comparing '%S' and '%S'\n", ComputerName, pStart); - if (_wcsicmp(ComputerName, pStart) == 0) - { - bFound = TRUE; - if (pEnd != NULL) - *pEnd = L','; - break; - } - - if (pEnd == NULL) - break; - - *pEnd = L','; - pStart = pEnd + 1; - } - - TRACE("Found allowed workstation: %s\n", (bFound) ? "Yes" : "No"); - - return bFound; -} - - /* * @unimplemented */ @@ -1185,19 +961,11 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, PMSV1_0_INTERACTIVE_LOGON LogonInfo; UNICODE_STRING ComputerName; WCHAR ComputerNameData[MAX_COMPUTERNAME_LENGTH + 1]; - SAMPR_HANDLE ServerHandle = NULL; - SAMPR_HANDLE DomainHandle = NULL; + LSA_SAM_PWD_DATA LogonPwdData = { FALSE, NULL }; SAMPR_HANDLE UserHandle = NULL; PRPC_SID AccountDomainSid = NULL; - RPC_UNICODE_STRING Names[1]; - SAMPR_ULONG_ARRAY RelativeIds = {0, NULL}; - SAMPR_ULONG_ARRAY Use = {0, NULL}; PSAMPR_USER_INFO_BUFFER UserInfo = NULL; BOOLEAN SessionCreated = FALSE; - LARGE_INTEGER LogonTime; - LARGE_INTEGER AccountExpires; - LARGE_INTEGER PasswordMustChange; - LARGE_INTEGER PasswordLastSet; DWORD ComputerNameSize; BOOL SpecialAccount = FALSE; UCHAR LogonPassHash; @@ -1324,6 +1092,9 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, if (!NT_SUCCESS(Status)) return STATUS_INVALID_PARAMETER; + LogonPwdData.IsNetwork = FALSE; + LogonPwdData.PlainPwd = &LogonInfo->Password; + TRACE("Domain: %wZ\n", &LogonInfo->LogonDomainName); TRACE("User: %wZ\n", &LogonInfo->UserName); TRACE("Password: %wZ\n", &LogonInfo->Password); @@ -1337,9 +1108,6 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, } // TODO: Add other LogonType validity checks. - /* Get the logon time */ - NtQuerySystemTime(&LogonTime); - /* Check for special accounts */ // FIXME: Windows does not do this that way!! (msv1_0 does not contain these hardcoded values) if (RtlEqualUnicodeString(&LogonInfo->LogonDomainName, &NtAuthorityU, TRUE)) @@ -1401,165 +1169,18 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, else { TRACE("NormalAccount\n"); - - /* Get the account domain SID */ - Status = GetAccountDomainSid(&AccountDomainSid); + Status = SamValidateNormalUser(&LogonInfo->UserName, + &LogonPwdData, + &ComputerName, + &AccountDomainSid, + &UserHandle, + &UserInfo, + SubStatus); if (!NT_SUCCESS(Status)) { - ERR("GetAccountDomainSid() failed (Status 0x%08lx)\n", Status); + ERR("SamValidateNormalUser() failed (Status 0x%08lx)\n", Status); return Status; } - - /* Connect to the SAM server */ - Status = SamIConnect(NULL, - &ServerHandle, - SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN, - TRUE); - if (!NT_SUCCESS(Status)) - { - TRACE("SamIConnect() failed (Status 0x%08lx)\n", Status); - goto done; - } - - /* Open the account domain */ - Status = SamrOpenDomain(ServerHandle, - DOMAIN_LOOKUP, - AccountDomainSid, - &DomainHandle); - if (!NT_SUCCESS(Status)) - { - ERR("SamrOpenDomain failed (Status %08lx)\n", Status); - goto done; - } - - Names[0].Length = LogonInfo->UserName.Length; - Names[0].MaximumLength = LogonInfo->UserName.MaximumLength; - Names[0].Buffer = LogonInfo->UserName.Buffer; - - /* Try to get the RID for the user name */ - Status = SamrLookupNamesInDomain(DomainHandle, - 1, - Names, - &RelativeIds, - &Use); - if (!NT_SUCCESS(Status)) - { - ERR("SamrLookupNamesInDomain failed (Status %08lx)\n", Status); - Status = STATUS_NO_SUCH_USER; - goto done; - } - - /* Fail, if it is not a user account */ - if (Use.Element[0] != SidTypeUser) - { - ERR("Account is not a user account!\n"); - Status = STATUS_NO_SUCH_USER; - goto done; - } - - /* Open the user object */ - Status = SamrOpenUser(DomainHandle, - USER_READ_GENERAL | USER_READ_LOGON | - USER_READ_ACCOUNT | USER_READ_PREFERENCES, /* FIXME */ - RelativeIds.Element[0], - &UserHandle); - if (!NT_SUCCESS(Status)) - { - ERR("SamrOpenUser failed (Status %08lx)\n", Status); - goto done; - } - - Status = SamrQueryInformationUser(UserHandle, - UserAllInformation, - &UserInfo); - if (!NT_SUCCESS(Status)) - { - ERR("SamrQueryInformationUser failed (Status %08lx)\n", Status); - goto done; - } - - TRACE("UserName: %wZ\n", &UserInfo->All.UserName); - - /* Check the password */ - if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) - { - Status = MsvpCheckPassword(&LogonInfo->Password, - UserInfo); - if (!NT_SUCCESS(Status)) - { - ERR("MsvpCheckPassword failed (Status %08lx)\n", Status); - goto done; - } - } - - /* Check account restrictions for non-administrator accounts */ - if (RelativeIds.Element[0] != DOMAIN_USER_RID_ADMIN) - { - /* Check if the account has been disabled */ - if (UserInfo->All.UserAccountControl & USER_ACCOUNT_DISABLED) - { - ERR("Account disabled!\n"); - *SubStatus = STATUS_ACCOUNT_DISABLED; - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - - /* Check if the account has been locked */ - if (UserInfo->All.UserAccountControl & USER_ACCOUNT_AUTO_LOCKED) - { - ERR("Account locked!\n"); - *SubStatus = STATUS_ACCOUNT_LOCKED_OUT; - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - - /* Check if the account expired */ - AccountExpires.LowPart = UserInfo->All.AccountExpires.LowPart; - AccountExpires.HighPart = UserInfo->All.AccountExpires.HighPart; - if (LogonTime.QuadPart >= AccountExpires.QuadPart) - { - ERR("Account expired!\n"); - *SubStatus = STATUS_ACCOUNT_EXPIRED; - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - - /* Check if the password expired */ - PasswordMustChange.LowPart = UserInfo->All.PasswordMustChange.LowPart; - PasswordMustChange.HighPart = UserInfo->All.PasswordMustChange.HighPart; - PasswordLastSet.LowPart = UserInfo->All.PasswordLastSet.LowPart; - PasswordLastSet.HighPart = UserInfo->All.PasswordLastSet.HighPart; - - if (LogonTime.QuadPart >= PasswordMustChange.QuadPart) - { - ERR("Password expired!\n"); - if (PasswordLastSet.QuadPart == 0) - *SubStatus = STATUS_PASSWORD_MUST_CHANGE; - else - *SubStatus = STATUS_PASSWORD_EXPIRED; - - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - - /* Check logon hours */ - if (!MsvpCheckLogonHours(&UserInfo->All.LogonHours, &LogonTime)) - { - ERR("Invalid logon hours!\n"); - *SubStatus = STATUS_INVALID_LOGON_HOURS; - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - - /* Check workstations */ - if (!MsvpCheckWorkstations(&UserInfo->All.WorkStations, ComputerNameData)) - { - ERR("Invalid workstation!\n"); - *SubStatus = STATUS_INVALID_WORKSTATION; - Status = STATUS_ACCOUNT_RESTRICTION; - goto done; - } - } } /* Return logon information */ @@ -1692,14 +1313,6 @@ done: SamIFree_SAMPR_USER_INFO_BUFFER(UserInfo, UserAllInformation); - SamIFree_SAMPR_ULONG_ARRAY(&RelativeIds); - SamIFree_SAMPR_ULONG_ARRAY(&Use); - - if (DomainHandle != NULL) - SamrCloseHandle(&DomainHandle); - - if (ServerHandle != NULL) - SamrCloseHandle(&ServerHandle); if (AccountDomainSid != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid); diff --git a/dll/win32/msv1_0/precomp.h b/dll/win32/msv1_0/precomp.h index 094db60e990..cf7b0842d50 100644 --- a/dll/win32/msv1_0/precomp.h +++ b/dll/win32/msv1_0/precomp.h @@ -5,6 +5,7 @@ #define _INC_WINDOWS #define COM_NO_WINDOWS_H #include <stdarg.h> +#include <stdbool.h> #include <windef.h> #include <winbase.h> #include <winreg.h> @@ -33,10 +34,10 @@ #include "ntlm/global.h" #include "lsa.h" #include "msv1_0.h" +#include "sam.h" #include "user.h" #include "usercontext.h" - #include <wine/debug.h> #endif diff --git a/dll/win32/msv1_0/sam.c b/dll/win32/msv1_0/sam.c new file mode 100644 index 00000000000..266c976b2f0 --- /dev/null +++ b/dll/win32/msv1_0/sam.c @@ -0,0 +1,433 @@ +/* + * PROJECT: Authentication Package DLL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Security Account Manager (SAM) related functions + * COPYRIGHT: Copyright 2013 Eric Kohl <eric.kohl(a)reactos.org> + */ + +#include "precomp.h" + +#include "wine/debug.h" +WINE_DEFAULT_DEBUG_CHANNEL(msv1_0_sam); + + +static +NTSTATUS +GetAccountDomainSid( + _In_ PRPC_SID *Sid) +{ + LSAPR_HANDLE PolicyHandle = NULL; + PLSAPR_POLICY_INFORMATION PolicyInfo = NULL; + ULONG Length = 0; + NTSTATUS Status; + + Status = LsaIOpenPolicyTrusted(&PolicyHandle); + if (!NT_SUCCESS(Status)) + { + TRACE("LsaIOpenPolicyTrusted() failed (Status 0x%08lx)\n", Status); + return Status; + } + + Status = LsarQueryInformationPolicy(PolicyHandle, + PolicyAccountDomainInformation, + &PolicyInfo); + if (!NT_SUCCESS(Status)) + { + TRACE("LsarQueryInformationPolicy() failed (Status 0x%08lx)\n", Status); + goto done; + } + + Length = RtlLengthSid(PolicyInfo->PolicyAccountDomainInfo.Sid); + + *Sid = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length); + if (*Sid == NULL) + { + ERR("Failed to allocate SID\n"); + Status = STATUS_INSUFFICIENT_RESOURCES; + goto done; + } + + memcpy(*Sid, PolicyInfo->PolicyAccountDomainInfo.Sid, Length); + +done: + if (PolicyInfo != NULL) + LsaIFree_LSAPR_POLICY_INFORMATION(PolicyAccountDomainInformation, + PolicyInfo); + + if (PolicyHandle != NULL) + LsarClose(&PolicyHandle); + + return Status; +} + + +static +NTSTATUS +MsvpCheckPassword( + _In_ PLSA_SAM_PWD_DATA UserPwdData, + _In_ PSAMPR_USER_INFO_BUFFER UserInfo) +{ + ENCRYPTED_NT_OWF_PASSWORD UserNtPassword; + ENCRYPTED_LM_OWF_PASSWORD UserLmPassword; + BOOLEAN UserLmPasswordPresent = FALSE; + BOOLEAN UserNtPasswordPresent = FALSE; + OEM_STRING LmPwdString; + CHAR LmPwdBuffer[15]; + NTSTATUS Status; + + TRACE("(%p %p)\n", UserPwdData, UserInfo); + + /* Calculate the LM password and hash for the users password */ + LmPwdString.Length = 15; + LmPwdString.MaximumLength = 15; + LmPwdString.Buffer = LmPwdBuffer; + ZeroMemory(LmPwdString.Buffer, LmPwdString.MaximumLength); + + Status = RtlUpcaseUnicodeStringToOemString(&LmPwdString, + UserPwdData->PlainPwd, + FALSE); + if (NT_SUCCESS(Status)) + { + /* Calculate the LM hash value of the users password */ + Status = SystemFunction006(LmPwdString.Buffer, + (LPSTR)&UserLmPassword); + if (NT_SUCCESS(Status)) + { + UserLmPasswordPresent = TRUE; + } + } + + /* Calculate the NT hash of the users password */ + Status = SystemFunction007(UserPwdData->PlainPwd, + (LPBYTE)&UserNtPassword); + if (NT_SUCCESS(Status)) + { + UserNtPasswordPresent = TRUE; + } + + Status = STATUS_WRONG_PASSWORD; + + /* Succeed, if no password has been set */ + if (UserInfo->All.NtPasswordPresent == FALSE && + UserInfo->All.LmPasswordPresent == FALSE) + { + TRACE("No password check!\n"); + Status = STATUS_SUCCESS; + goto done; + } + + /* Succeed, if NT password matches */ + if (UserNtPasswordPresent && UserInfo->All.NtPasswordPresent) + { + TRACE("Check NT password hashes:\n"); + if (RtlEqualMemory(&UserNtPassword, + UserInfo->All.NtOwfPassword.Buffer, + sizeof(ENCRYPTED_NT_OWF_PASSWORD))) + { + TRACE(" success!\n"); + Status = STATUS_SUCCESS; + goto done; + } + + TRACE(" failed!\n"); + } + + /* Succeed, if LM password matches */ + if (UserLmPasswordPresent && UserInfo->All.LmPasswordPresent) + { + TRACE("Check LM password hashes:\n"); + if (RtlEqualMemory(&UserLmPassword, + UserInfo->All.LmOwfPassword.Buffer, + sizeof(ENCRYPTED_LM_OWF_PASSWORD))) + { + TRACE(" success!\n"); + Status = STATUS_SUCCESS; + goto done; + } + TRACE(" failed!\n"); + } + +done: + return Status; +} + + +static +bool +MsvpCheckLogonHours( + _In_ PSAMPR_LOGON_HOURS LogonHours, + _In_ LARGE_INTEGER LogonTime) +{ +#if 0 + LARGE_INTEGER LocalLogonTime; + TIME_FIELDS TimeFields; + USHORT MinutesPerUnit, Offset; + bool bFound; + + FIXME("MsvpCheckLogonHours(%p %llx)\n", LogonHours, LogonTime); + + if (LogonHours->UnitsPerWeek == 0 || LogonHours->LogonHours == NULL) + { + FIXME("No logon hours!\n"); + return true; + } + + RtlSystemTimeToLocalTime(&LogonTime, &LocalLogonTime); + RtlTimeToTimeFields(&LocalLogonTime, &TimeFields); + + FIXME("UnitsPerWeek: %u\n", LogonHours->UnitsPerWeek); + MinutesPerUnit = 10080 / LogonHours->UnitsPerWeek; + + Offset = ((TimeFields.Weekday * 24 + TimeFields.Hour) * 60 + TimeFields.Minute) / MinutesPerUnit; + FIXME("Offset: %us\n", Offset); + + bFound = (bool)(LogonHours->LogonHours[Offset / 8] & (1 << (Offset % 8))); + FIXME("Logon permitted: %s\n", bFound ? "Yes" : "No"); + + return bFound; +#endif + return true; +} + + +static +bool +MsvpCheckWorkstations( + _In_ PRPC_UNICODE_STRING WorkStations, + _In_ PWSTR ComputerName) +{ + PWSTR pStart, pEnd; + bool bFound = false; + + TRACE("MsvpCheckWorkstations(%p %S)\n", WorkStations, ComputerName); + + if (WorkStations->Length == 0 || WorkStations->Buffer == NULL) + { + TRACE("No workstations!\n"); + return true; + } + + TRACE("Workstations: %wZ\n", WorkStations); + + pStart = WorkStations->Buffer; + for (;;) + { + pEnd = wcschr(pStart, L','); + if (pEnd != NULL) + *pEnd = UNICODE_NULL; + + TRACE("Comparing '%S' and '%S'\n", ComputerName, pStart); + if (_wcsicmp(ComputerName, pStart) == 0) + { + bFound = true; + if (pEnd != NULL) + *pEnd = L','; + break; + } + + if (pEnd == NULL) + break; + + *pEnd = L','; + pStart = pEnd + 1; + } + + TRACE("Found allowed workstation: %s\n", (bFound) ? "Yes" : "No"); + + return bFound; +} + + +NTSTATUS +SamValidateNormalUser( + _In_ PUNICODE_STRING UserName, + _In_ PLSA_SAM_PWD_DATA PwdData, + _In_ PUNICODE_STRING ComputerName, + _Out_ PRPC_SID* AccountDomainSidPtr, + _Out_ SAMPR_HANDLE* UserHandlePtr, + _Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr, + _Out_ PNTSTATUS SubStatus) +{ + NTSTATUS Status; + SAMPR_HANDLE ServerHandle = NULL; + SAMPR_HANDLE DomainHandle = NULL; + PRPC_SID AccountDomainSid; + RPC_UNICODE_STRING Names[1]; + SAMPR_HANDLE UserHandle = NULL; + SAMPR_ULONG_ARRAY RelativeIds = {0, NULL}; + SAMPR_ULONG_ARRAY Use = {0, NULL}; + PSAMPR_USER_INFO_BUFFER UserInfo = NULL; + LARGE_INTEGER LogonTime; + + /* Get the logon time */ + NtQuerySystemTime(&LogonTime); + + /* Get the account domain SID */ + Status = GetAccountDomainSid(&AccountDomainSid); + if (!NT_SUCCESS(Status)) + { + ERR("GetAccountDomainSid() failed (Status 0x%08lx)\n", Status); + return Status; + } + + /* Connect to the SAM server */ + Status = SamIConnect(NULL, &ServerHandle, SAM_SERVER_CONNECT | SAM_SERVER_LOOKUP_DOMAIN, TRUE); + if (!NT_SUCCESS(Status)) + { + TRACE("SamIConnect() failed (Status 0x%08lx)\n", Status); + goto done; + } + + /* Open the account domain */ + Status = SamrOpenDomain(ServerHandle, DOMAIN_LOOKUP, AccountDomainSid, &DomainHandle); + if (!NT_SUCCESS(Status)) + { + ERR("SamrOpenDomain failed (Status %08lx)\n", Status); + goto done; + } + + Names[0].Length = UserName->Length; + Names[0].MaximumLength = UserName->MaximumLength; + Names[0].Buffer = UserName->Buffer; + + /* Try to get the RID for the user name */ + Status = SamrLookupNamesInDomain(DomainHandle, 1, Names, &RelativeIds, &Use); + if (!NT_SUCCESS(Status)) + { + ERR("SamrLookupNamesInDomain failed (Status %08lx)\n", Status); + Status = STATUS_NO_SUCH_USER; + // FIXME: Try without domain? + goto done; + } + + /* Fail, if it is not a user account */ + if (Use.Element[0] != SidTypeUser) + { + ERR("Account is not a user account!\n"); + Status = STATUS_NO_SUCH_USER; + goto done; + } + + /* Open the user object */ + Status = SamrOpenUser(DomainHandle, + USER_READ_GENERAL | USER_READ_LOGON | + USER_READ_ACCOUNT | USER_READ_PREFERENCES, /* FIXME */ + RelativeIds.Element[0], + &UserHandle); + if (!NT_SUCCESS(Status)) + { + ERR("SamrOpenUser failed (Status %08lx)\n", Status); + goto done; + } + + Status = SamrQueryInformationUser(UserHandle, UserAllInformation, &UserInfo); + if (!NT_SUCCESS(Status)) + { + ERR("SamrQueryInformationUser failed (Status %08lx)\n", Status); + goto done; + } + + TRACE("UserName: %wZ\n", &UserInfo->All.UserName); + + /* Check the password */ + if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) + { + Status = MsvpCheckPassword(PwdData, UserInfo); + if (!NT_SUCCESS(Status)) + { + ERR("MsvpCheckPassword failed (Status %08lx)\n", Status); + goto done; + } + } + + /* Check account restrictions for non-administrator accounts */ + if (RelativeIds.Element[0] != DOMAIN_USER_RID_ADMIN) + { + /* Check if the account has been disabled */ + if (UserInfo->All.UserAccountControl & USER_ACCOUNT_DISABLED) + { + ERR("Account disabled!\n"); + *SubStatus = STATUS_ACCOUNT_DISABLED; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check if the account has been locked */ + if (UserInfo->All.UserAccountControl & USER_ACCOUNT_AUTO_LOCKED) + { + ERR("Account locked!\n"); + *SubStatus = STATUS_ACCOUNT_LOCKED_OUT; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check if the account expired */ + if (LogonTime.QuadPart >= *(UINT64*)&UserInfo->All.AccountExpires) + { + ERR("Account expired!\n"); + *SubStatus = STATUS_ACCOUNT_EXPIRED; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check if the password expired */ + if (LogonTime.QuadPart >= *(UINT64*)&UserInfo->All.PasswordMustChange) + { + ERR("Password expired!\n"); + if (*(UINT64*)&UserInfo->All.PasswordLastSet == 0) + *SubStatus = STATUS_PASSWORD_MUST_CHANGE; + else + *SubStatus = STATUS_PASSWORD_EXPIRED; + + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check logon hours */ + if (!MsvpCheckLogonHours(&UserInfo->All.LogonHours, LogonTime)) + { + ERR("Invalid logon hours!\n"); + *SubStatus = STATUS_INVALID_LOGON_HOURS; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check workstations */ + if (!MsvpCheckWorkstations(&UserInfo->All.WorkStations, ComputerName->Buffer)) + { + ERR("Invalid workstation!\n"); + *SubStatus = STATUS_INVALID_WORKSTATION; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + } +done: + if (NT_SUCCESS(Status)) + { + *UserHandlePtr = UserHandle; + *AccountDomainSidPtr = AccountDomainSid; + *UserInfoPtr = UserInfo; + } + else + { + if (AccountDomainSid != NULL) + RtlFreeHeap(RtlGetProcessHeap(), 0, AccountDomainSid); + + if (UserHandle != NULL) + SamrCloseHandle(&UserHandle); + + SamIFree_SAMPR_USER_INFO_BUFFER(UserInfo, + UserAllInformation); + } + + SamIFree_SAMPR_ULONG_ARRAY(&RelativeIds); + SamIFree_SAMPR_ULONG_ARRAY(&Use); + + if (DomainHandle != NULL) + SamrCloseHandle(&DomainHandle); + + if (ServerHandle != NULL) + SamrCloseHandle(&ServerHandle); + + return Status; +} diff --git a/dll/win32/msv1_0/sam.h b/dll/win32/msv1_0/sam.h new file mode 100644 index 00000000000..314989d16ba --- /dev/null +++ b/dll/win32/msv1_0/sam.h @@ -0,0 +1,31 @@ +/* + * PROJECT: Authentication Package DLL + * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later
) + * PURPOSE: Security Account Manager (SAM) related functions - header + * COPYRIGHT: Copyright 2013 Eric Kohl <eric.kohl(a)reactos.org> + */ + +#pragma once + +typedef struct _LSA_SAM_PWD_DATA +{ + /* TRUE: PlainPwd is filled, + FALSE: LmPwd and NtPwd is filled */ + BOOL IsNetwork; + PUNICODE_STRING PlainPwd; + +} LSA_SAM_PWD_DATA, *PLSA_SAM_PWD_DATA; + +/** + * @brief Validates a normal user by checking if it exists in the sam database. + * Further some other checks are done. + */ +NTSTATUS +SamValidateNormalUser( + _In_ PUNICODE_STRING UserName, + _In_ PLSA_SAM_PWD_DATA PwdData, + _In_ PUNICODE_STRING ComputerName, + _Out_ PRPC_SID* AccountDomainSidPtr, + _Out_ SAMPR_HANDLE* UserHandlePtr, + _Out_ PSAMPR_USER_INFO_BUFFER* UserInfoPtr, + _Out_ PNTSTATUS SubStatus);
3 years
1
0
0
0
[reactos] 01/05: [MSV1_0] Improve GetComputerNameW call (1/5)
by Andreas Maier
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5a67ed775f685d4e5e2d2…
commit 5a67ed775f685d4e5e2d289394c851af752ccfeb Author: Andreas Maier <staubim(a)quantentunnel.de> AuthorDate: Sun Jun 21 22:50:29 2020 +0200 Commit: Victor Perevertkin <victor(a)perevertkin.ru> CommitDate: Sat Dec 25 15:55:43 2021 +0300 [MSV1_0] Improve GetComputerNameW call (1/5) This is a part of the Partial Network Login Implementation PR. --- dll/win32/msv1_0/msv1_0.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dll/win32/msv1_0/msv1_0.c b/dll/win32/msv1_0/msv1_0.c index c5d87f88c2d..38bdbc40179 100644 --- a/dll/win32/msv1_0/msv1_0.c +++ b/dll/win32/msv1_0/msv1_0.c @@ -1183,7 +1183,8 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, NTSTATUS Status; PMSV1_0_INTERACTIVE_LOGON LogonInfo; - WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + UNICODE_STRING ComputerName; + WCHAR ComputerNameData[MAX_COMPUTERNAME_LENGTH + 1]; SAMPR_HANDLE ServerHandle = NULL; SAMPR_HANDLE DomainHandle = NULL; SAMPR_HANDLE UserHandle = NULL; @@ -1214,6 +1215,15 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, *AccountName = NULL; *AuthenticatingAuthority = NULL; + /* Get the computer name */ + ComputerNameSize = ARRAYSIZE(ComputerNameData); + if (!GetComputerNameW(ComputerNameData, &ComputerNameSize)) + { + ERR("Failed to get Computername.\n"); + return STATUS_INTERNAL_ERROR; + } + RtlInitUnicodeString(&ComputerName, ComputerNameData); + /* Parameters validation */ if (LogonType == Interactive || LogonType == Batch || @@ -1330,10 +1340,6 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, /* Get the logon time */ NtQuerySystemTime(&LogonTime); - /* Get the computer name */ - ComputerNameSize = ARRAYSIZE(ComputerName); - GetComputerNameW(ComputerName, &ComputerNameSize); - /* Check for special accounts */ // FIXME: Windows does not do this that way!! (msv1_0 does not contain these hardcoded values) if (RtlEqualUnicodeString(&LogonInfo->LogonDomainName, &NtAuthorityU, TRUE)) @@ -1546,7 +1552,7 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, } /* Check workstations */ - if (!MsvpCheckWorkstations(&UserInfo->All.WorkStations, ComputerName)) + if (!MsvpCheckWorkstations(&UserInfo->All.WorkStations, ComputerNameData)) { ERR("Invalid workstation!\n"); *SubStatus = STATUS_INVALID_WORKSTATION; @@ -1579,7 +1585,7 @@ LsaApLogonUserEx2(IN PLSA_CLIENT_REQUEST ClientRequest, /* Build and fill the interactive profile buffer */ Status = BuildInteractiveProfileBuffer(ClientRequest, UserInfo, - ComputerName, + ComputerNameData, (PMSV1_0_INTERACTIVE_PROFILE*)ProfileBuffer, ProfileBufferSize); if (!NT_SUCCESS(Status)) @@ -1659,12 +1665,12 @@ done: *MachineName = DispatchTable.AllocateLsaHeap(sizeof(UNICODE_STRING)); if (*MachineName != NULL) { - (*MachineName)->Buffer = DispatchTable.AllocateLsaHeap((ComputerNameSize + 1) * sizeof(WCHAR)); + (*MachineName)->Buffer = DispatchTable.AllocateLsaHeap(ComputerName.MaximumLength); if ((*MachineName)->Buffer != NULL) { - (*MachineName)->MaximumLength = (ComputerNameSize + 1) * sizeof(WCHAR); - (*MachineName)->Length = ComputerNameSize * sizeof(WCHAR); - RtlCopyMemory((*MachineName)->Buffer, ComputerName, (*MachineName)->MaximumLength); + (*MachineName)->MaximumLength = ComputerName.MaximumLength; + (*MachineName)->Length = ComputerName.Length; + RtlCopyMemory((*MachineName)->Buffer, ComputerName.Buffer, ComputerName.MaximumLength); } }
3 years
1
0
0
0
[reactos] 01/01: [BOOTDATA] Support EMF/WMF metafile file types (#4183)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2be9ea9c3beb343674a09…
commit 2be9ea9c3beb343674a090e8e84621c0f8ffafd2 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Dec 25 21:40:59 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Dec 25 21:40:59 2021 +0900 [BOOTDATA] Support EMF/WMF metafile file types (#4183) Improve "Open with" registry info. CORE-17814 --- boot/bootdata/hivesft.inf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/boot/bootdata/hivesft.inf b/boot/bootdata/hivesft.inf index ad07c1fdf53..8ba9faac33f 100644 --- a/boot/bootdata/hivesft.inf +++ b/boot/bootdata/hivesft.inf @@ -88,8 +88,8 @@ HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".jpeg",0x000000 HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".jpe",0x00000000,"" HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".jfif",0x00000000,"" HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".gif",0x00000000,"" -; HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".emf",0x00000000,"" ; NOT SUPPORTED YET -; HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".wmf",0x00000000,"" ; NOT SUPPORTED YET +HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".emf",0x00000000,"" +HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".wmf",0x00000000,"" HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".tif",0x00000000,"" HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".tiff",0x00000000,"" HKLM,"SOFTWARE\Classes\Applications\mspaint.exe\SupportedTypes",".png",0x00000000,""
3 years
1
0
0
0
[reactos] 01/01: [GDIPLUS] GdipCreateBitmapFromStream should accept metafiles (#4181)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c8ae0d76697c28b850e8…
commit 5c8ae0d76697c28b850e8914680a95e5327d616f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Dec 25 21:40:08 2021 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Dec 25 21:40:08 2021 +0900 [GDIPLUS] GdipCreateBitmapFromStream should accept metafiles (#4181) - Add hbitmap_from_emf helper function. - GdipCreateBitmapFromStream accepts the metafiles. CORE-17814 --- dll/win32/gdiplus/image.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dll/win32/gdiplus/image.c b/dll/win32/gdiplus/image.c index 8425bcb54b3..e9fd781a1be 100644 --- a/dll/win32/gdiplus/image.c +++ b/dll/win32/gdiplus/image.c @@ -1897,6 +1897,41 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, return Ok; } +#ifdef __REACTOS__ +static HBITMAP hbitmap_from_emf(HENHMETAFILE hemf) +{ + BITMAPINFO bmi; + HBITMAP hbm; + SIZE size; + ENHMETAHEADER header; + HGDIOBJ hbmOld; + RECT rc; + HDC hdc; + + GetEnhMetaFileHeader(hemf, sizeof(header), &header); + size.cx = header.rclBounds.right - header.rclBounds.left + 1; + size.cy = header.rclBounds.bottom - header.rclBounds.top + 1; + + ZeroMemory(&bmi, sizeof(bmi)); + bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader); + bmi.bmiHeader.biWidth = size.cx; + bmi.bmiHeader.biHeight = size.cy; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biBitCount = 24; + + hdc = CreateCompatibleDC(NULL); + hbm = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); + + hbmOld = SelectObject(hdc, hbm); + SetRect(&rc, 0, 0, size.cx, size.cy); + PlayEnhMetaFile(hdc, hemf, &rc); + SelectObject(hdc, hbmOld); + + DeleteDC(hdc); + return hbm; +} + +#endif GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream, GpBitmap **bitmap) { @@ -1909,6 +1944,19 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream, if(stat != Ok) return stat; +#ifdef __REACTOS__ + if ((*bitmap)->image.type == ImageTypeMetafile) + { + HBITMAP hbm = hbitmap_from_emf(((GpMetafile*)*bitmap)->hemf); + GdipDisposeImage(&(*bitmap)->image); + if (!hbm) + return GenericError; /* FIXME: what error to return? */ + + GdipCreateBitmapFromHBITMAP(hbm, NULL, bitmap); + DeleteObject(hbm); + } + else +#endif if((*bitmap)->image.type != ImageTypeBitmap){ GdipDisposeImage(&(*bitmap)->image); *bitmap = NULL;
3 years
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
16
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Results per page:
10
25
50
100
200