ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
May 2015
----- 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
15 participants
500 discussions
Start a n
N
ew thread
[tkreuzer] 67534: [ATL] - Convert tabs to spaces - Remove excessive local variable indentation for alignment, since that doesn't help to improve readability - No code changes
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sun May 3 15:10:09 2015 New Revision: 67534 URL:
http://svn.reactos.org/svn/reactos?rev=67534&view=rev
Log: [ATL] - Convert tabs to spaces - Remove excessive local variable indentation for alignment, since that doesn't help to improve readability - No code changes Modified: trunk/reactos/lib/atl/atlbase.cpp trunk/reactos/lib/atl/atlbase.h trunk/reactos/lib/atl/atlcom.h trunk/reactos/lib/atl/atlcore.h trunk/reactos/lib/atl/atlwin.h trunk/reactos/lib/atl/statreg.h [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/reactos/lib/atl/atlbase.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlbase.cpp?rev=67…
Modified: trunk/reactos/lib/atl/atlbase.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlbase.h?rev=6753…
Modified: trunk/reactos/lib/atl/atlcom.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcom.h?rev=67534…
Modified: trunk/reactos/lib/atl/atlcore.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcore.h?rev=6753…
Modified: trunk/reactos/lib/atl/atlwin.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlwin.h?rev=67534…
Modified: trunk/reactos/lib/atl/statreg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/statreg.h?rev=6753…
9 years, 7 months
1
0
0
0
[aandrejevic] 67533: [FAST486] Don't overwrite the masked flags in IRET.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun May 3 13:14:53 2015 New Revision: 67533 URL:
http://svn.reactos.org/svn/reactos?rev=67533&view=rev
Log: [FAST486] Don't overwrite the masked flags in IRET. Modified: trunk/reactos/lib/fast486/opcodes.c Modified: trunk/reactos/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=…
============================================================================== --- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Sun May 3 13:14:53 2015 @@ -4739,8 +4739,16 @@ State->Cpl = GET_SEGMENT_RPL(CodeSel); /* Set the new flags */ - if (Size) State->Flags.Long = NewFlags.Long & PROT_MODE_FLAGS_MASK; - else State->Flags.LowWord = NewFlags.LowWord & PROT_MODE_FLAGS_MASK; + if (Size) + { + State->Flags.Long = (State->Flags.Long & ~PROT_MODE_FLAGS_MASK) + | (NewFlags.Long & PROT_MODE_FLAGS_MASK); + } + else + { + State->Flags.LowWord = (State->Flags.LowWord & ~PROT_MODE_FLAGS_MASK) + | (NewFlags.LowWord & PROT_MODE_FLAGS_MASK); + } State->Flags.AlwaysSet = TRUE; /* Set additional flags */
9 years, 7 months
1
0
0
0
[akhaldi] 67532: [KERNEL32] Add Italian translation by Carlo Bramini. CORE-9650
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun May 3 12:56:51 2015 New Revision: 67532 URL:
http://svn.reactos.org/svn/reactos?rev=67532&view=rev
Log: [KERNEL32] Add Italian translation by Carlo Bramini. CORE-9650 Added: trunk/reactos/dll/win32/kernel32/winnls/lang/it-IT.rc (with props) Modified: trunk/reactos/dll/win32/kernel32/kernel32.rc Modified: trunk/reactos/dll/win32/kernel32/kernel32.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/kernel3…
============================================================================== --- trunk/reactos/dll/win32/kernel32/kernel32.rc [iso-8859-1] (original) +++ trunk/reactos/dll/win32/kernel32/kernel32.rc [iso-8859-1] Sun May 3 12:56:51 2015 @@ -29,6 +29,9 @@ #ifdef LANGUAGE_FR_FR #include "winnls/lang/fr-FR.rc" #endif +#ifdef LANGUAGE_IT_IT + #include "winnls/lang/it-IT.rc" +#endif #ifdef LANGUAGE_RO_RO #include "winnls/lang/ro-RO.rc" #endif Added: trunk/reactos/dll/win32/kernel32/winnls/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
============================================================================== --- trunk/reactos/dll/win32/kernel32/winnls/lang/it-IT.rc (added) +++ trunk/reactos/dll/win32/kernel32/winnls/lang/it-IT.rc [iso-8859-1] Sun May 3 12:56:51 2015 @@ -0,0 +1,432 @@ +LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + /* Names of code pages */ + 1250 "1250 (ANSI - Europa Centrale)" + 1251 "1251 (ANSI - Cirillico)" + 1252 "1252 (ANSI - Latino 1)" + 1253 "1253 (ANSI - Greco)" + 1254 "1254 (ANSI - Turco)" + 1255 "1255 (ANSI - Ebraico)" + 1256 "1256 (ANSI - Arabo)" + 1257 "1257 (ANSI - Baltico)" + 1258 "1258 (ANSI/OEM - Vietnamita)" + 874 "874 (ANSI/OEM - Thai)" + 932 "932 (ANSI/OEM - Giapponese Shift-JIS)" + 936 "936 (ANSI/OEM - Cinese Semplificato GBK)" + 949 "949 (ANSI/OEM - Coreano)" + 950 "950 (ANSI/OEM - Cinese Tradizionale Big5)" + + 437 "437 (OEM - Stati Uniti)" + 737 "737 (OEM - Greco 437G)" + 775 "775 (OEM - Baltico)" + 850 "850 (OEM - Multilingue Latino I)" + 852 "852 (OEM - Latino II)" + 855 "855 (OEM - Cirillico)" + 857 "857 (OEM - Turco)" + 858 "858 (OEM - Multilingue Latino I + Euro)" + 860 "860 (OEM - Portoghese)" + 861 "861 (OEM - Islandese)" + 862 "862 (OEM - Ebraico)" + 863 "863 (OEM - Francese canadese)" + 864 "864 (OEM - Arabo)" + 865 "865 (OEM - Nordic)" + 866 "866 (OEM - Russo)" + 869 "869 (OEM - Greco moderno)" + + 10000 "10000 (MAC - Roman)" + 10001 "10001 (MAC - Giapponese)" + 10002 "10002 (MAC - Cinese Tradizionale Big5)" + 10003 "10003 (MAC - Coreano)" + 10004 "10004 (MAC - Arabo)" + 10005 "10005 (MAC - Ebraico)" + 10006 "10006 (MAC - Greco I)" + 10007 "10007 (MAC - Cirillico)" + 10008 "10008 (MAC - Cinese Semplificato GB 2312)" + 10010 "10010 (MAC - Rumeno)" + 10017 "10017 (MAC - Ucraino)" + 10021 "10021 (MAC - Thai)" + 10029 "10029 (MAC - Latino II)" + 10079 "10079 (MAC - Islandese)" + 10081 "10081 (MAC - Turco)" + 10082 "10082 (MAC - Croato)" + + 65000 "65000 (UTF-7)" + 65001 "65001 (UTF-8)" + + 3700 "37 (IBM EBCDIC - Stati Uniti/Canada)" /* FIXME */ + 1026 "1026 (IBM EBCDIC - Turco (Latino-5))" + 1047 "1047 (IBM EBCDIC - Latino-1/Sistema aperto)" + 1140 "1140 (IBM EBCDIC - Stati Uniti/Canada (37 + Euro))" + 1141 "1141 (IBM EBCDIC - Germania (20273 + Euro))" + 1142 "1142 (IBM EBCDIC - Danimarca/Norvegia (20277 + Euro))" + 1143 "1143 (IBM EBCDIC - Finlandia/Svezia (20278 + Euro))" + 1144 "1144 (IBM EBCDIC - Italia (20280 + Euro))" + 1145 "1145 (IBM EBCDIC - America Latina/Spagna (20284 + Euro))" + 1146 "1146 (IBM EBCDIC - Regno Unito (20285 + Euro))" + 1147 "1147 (IBM EBCDIC - Francia (20297 + Euro))" + 1148 "1148 (IBM EBCDIC - Internazionale (500 + Euro))" + 1149 "1149 (IBM EBCDIC - Islandese (20871 + Euro))" + 20273 "20273 (IBM EBCDIC - Germania)" + 20277 "20277 (IBM EBCDIC - Danimarca/Norvegia)" + 20278 "20278 (IBM EBCDIC - Finlandia/Svezia)" + 20280 "20280 (IBM EBCDIC - Italia)" + 20284 "20284 (IBM EBCDIC - America Latina/Spagna)" + 20285 "20285 (IBM EBCDIC - Regno Unito)" + 20290 "20290 (IBM EBCDIC - Giapponese Katakana Esteso)" + 20297 "20297 (IBM EBCDIC - Francia)" + 20420 "20420 (IBM EBCDIC - Arabo)" + 20423 "20423 (IBM EBCDIC - Greco)" + 20424 "20424 (IBM EBCDIC - Ebraico)" + 20833 "20833 (IBM EBCDIC - Coreano Esteso)" + 20838 "20838 (IBM EBCDIC - Thai)" + 20871 "20871 (IBM EBCDIC - Islandese)" + 20880 "20880 (IBM EBCDIC - Cirillico (Russo))" + 20905 "20905 (IBM EBCDIC - Turco)" + 20924 "20924 (IBM EBCDIC - Latino-1/Sistema Aperto (1047 + Euro))" + 21025 "21025 (IBM EBCDIC - Cirillico (Serbo, Bulgaro))" + 500 "500 (IBM EBCDIC - Internazionale)" + 870 "870 (IBM EBCDIC - Multilingue/ROECE (Latino-2))" + 875 "875 (IBM EBCDIC - Greco moderno)" + + 20269 "20269 (ISO 6937 Non-Spacing Accent)" + 28591 "28591 (ISO 8859-1 Latino I)" + 28592 "28592 (ISO 8859-2 Europa Centrale)" + 28593 "28593 (ISO 8859-3 Latino 3)" + 28594 "28594 (ISO 8859-4 Baltico)" + 28595 "28595 (ISO 8859-5 Cirillico)" + 28596 "28596 (ISO 8859-6 Arabo)" + 28597 "28597 (ISO 8859-7 Greco)" + 28598 "28598 (ISO 8859-8 Ebraico: Ordinamento Visivo)" + 28599 "28599 (ISO 8859-9 Latino 5)" + 28605 "28605 (ISO 8859-15 Latino 9)" + 38598 "38598 (ISO 8859-8 Ebraico: Ordinamento Logico)" + + 20105 "20105 (IA5 IRV Alfabeto Internazionale No.5)" + 20106 "20106 (IA5 Tedesco)" + 20107 "20107 (IA5 Svedese)" + 20108 "20108 (IA5 Norvegese)" + + 1361 "1361 (Coreano - Johab)" + 20000 "20000 (CNS - Taiwan)" + 20001 "20001 (TCA - Taiwan)" + 20002 "20002 (Eten - Taiwan)" + 20003 "20003 (IBM5550 - Taiwan)" + 20004 "20004 (TeleText - Taiwan)" + 20005 "20005 (Wang - Taiwan)" + 20127 "20127 (US-ASCII)" + 20261 "20261 (T.61)" + 20866 "20866 (Russo - KOI8)" + 21027 "21027 (Ext Alpha minuscolo)" + 21866 "21866 (Ucraino - KOI8-U)" + 708 "708 (Arabo - ASMO)" + 720 "720 (Arabo - ASMO Trasparente)" + 20932 "20932 (JIS X 0208-1990 & 0212-1990)" + 20936 "20936 (Cinese semplificato GB2312)" + 20949 "20949 (Coreano Wansung)" + + 57002 "57002 (ISCII Devanagari)" + 57003 "57003 (ISCII Bengali)" + 57004 "57004 (ISCII Tamil)" + 57005 "57005 (ISCII Telugu)" + 57006 "57006 (ISCII Assamese)" + 57007 "57007 (ISCII Oriya)" + 57008 "57008 (ISCII Kannada)" + 57009 "57009 (ISCII Malayalam)" + 57010 "57010 (ISCII Gujarati)" + 57011 "57011 (ISCII Gurmukhi)" + + 50930 "50930 (IBM EBCDIC - Giapponese (Katakana) Esteso e Giapponese)" + 50931 "50931 (IBM EBCDIC - Stati Uniti/Canada e Giapponese)" + 50933 "50933 (IBM EBCDIC - Coreano Esteso e Coreano)" + 50935 "50935 (IBM EBCDIC - Cinese Semplificato)" + 50937 "50937 (IBM EBCDIC - Stati Uniti/Canada e Cinese Tradizionale)" + 50939 "50939 (IBM EBCDIC - Giapponese (Latino) Esteso e Giapponese)" + + 50220 "50220 (ISO-2022 Giapponese senza Katakana metà larghezza)" + 50221 "50221 (ISO-2022 Giapponese con Katakana metà larghezza)" + 50222 "50222 (ISO-2022 Giapponese JIS X 0201-1989)" + 50225 "50225 (ISO-2022 Coreano)" + 50227 "50227 (ISO-2022 Cinese Semplificato)" + 50229 "50229 (ISO-2022 Cinese Tradizionale)" + + 51932 "51932 (EUC-Giapponese)" + 51936 "51936 (EUC-Cinese Semplificato)" + 51949 "51949 (EUC-Coreano)" + 51950 "51950 (EUC-Cinese Tradizionale)" + + 52936 "52936 (HZ-GB2312 Cinese Semplificato)" + 54936 "54936 (GB18030 Cinese Semplificato)" + + /* Locations */ + 2+NLSRC_OFFSET "Antigua e Barbuda" + 3+NLSRC_OFFSET "Afghanistan" + 4+NLSRC_OFFSET "Algeria" + 5+NLSRC_OFFSET "Azerbaigian" + 6+NLSRC_OFFSET "Albania" + 7+NLSRC_OFFSET "Armenia" + 8+NLSRC_OFFSET "Andorra" + 9+NLSRC_OFFSET "Angola" + 10+NLSRC_OFFSET "Samoa Americane" + 11+NLSRC_OFFSET "Argentina" + 12+NLSRC_OFFSET "Australia" + 14+NLSRC_OFFSET "Austria" + 17+NLSRC_OFFSET "Bahrain" + 18+NLSRC_OFFSET "Barbados" + 19+NLSRC_OFFSET "Botswana" + 20+NLSRC_OFFSET "Bermuda" + 21+NLSRC_OFFSET "Belgio" + 22+NLSRC_OFFSET "Bahamas" + 23+NLSRC_OFFSET "Bangladesh" + 24+NLSRC_OFFSET "Belize" + 25+NLSRC_OFFSET "Bosnia ed Herzegovina" + 26+NLSRC_OFFSET "Bolivia" + 27+NLSRC_OFFSET "Myanmar" + 28+NLSRC_OFFSET "Benin" + 29+NLSRC_OFFSET "Belarus" + 30+NLSRC_OFFSET "Isole Salomone" + 32+NLSRC_OFFSET "Brasile" + 34+NLSRC_OFFSET "Bhutan" + 35+NLSRC_OFFSET "Bulgaria" + 38+NLSRC_OFFSET "Burundi" + 39+NLSRC_OFFSET "Canada" + 40+NLSRC_OFFSET "Cambogia" + 41+NLSRC_OFFSET "Ciad" + 42+NLSRC_OFFSET "Sri Lanka" + 43+NLSRC_OFFSET "Congo" + 44+NLSRC_OFFSET "Congo (RD)" + 45+NLSRC_OFFSET "Cina" + 46+NLSRC_OFFSET "Cile" + 49+NLSRC_OFFSET "Camerun" + 50+NLSRC_OFFSET "Comore" + 51+NLSRC_OFFSET "Colombia" + 54+NLSRC_OFFSET "Costa Rica" + 55+NLSRC_OFFSET "Repubblica Centrafricana" + 56+NLSRC_OFFSET "Cuba" + 57+NLSRC_OFFSET "Capo Verde" + 59+NLSRC_OFFSET "Cipro" + 61+NLSRC_OFFSET "Danimarca" + 62+NLSRC_OFFSET "Gibuti" + 63+NLSRC_OFFSET "Dominica" + 65+NLSRC_OFFSET "Repubblica Dominicana" + 66+NLSRC_OFFSET "Ecuador" + 67+NLSRC_OFFSET "Egitto" + 68+NLSRC_OFFSET "Irlanda" + 69+NLSRC_OFFSET "Guinea Equatoriale" + 70+NLSRC_OFFSET "Estonia" + 71+NLSRC_OFFSET "Eritrea" + 72+NLSRC_OFFSET "El Salvador" + 73+NLSRC_OFFSET "Etiopia" + 75+NLSRC_OFFSET "Repubblica Ceca" + 77+NLSRC_OFFSET "Finlandia" + 78+NLSRC_OFFSET "Isole Figi" + 80+NLSRC_OFFSET "Micronesia" + 81+NLSRC_OFFSET "Isole Faroe" + 84+NLSRC_OFFSET "Francia" + 86+NLSRC_OFFSET "Gambia" + 87+NLSRC_OFFSET "Gabon" + 88+NLSRC_OFFSET "Georgia" + 89+NLSRC_OFFSET "Ghana" + 90+NLSRC_OFFSET "Gibilterra" + 91+NLSRC_OFFSET "Grenada" + 93+NLSRC_OFFSET "Groenlandia" + 94+NLSRC_OFFSET "Germania" + 98+NLSRC_OFFSET "Grecia" + 99+NLSRC_OFFSET "Guatemala" + 100+NLSRC_OFFSET "Guinea" + 101+NLSRC_OFFSET "Guyana" + 103+NLSRC_OFFSET "Haiti" + 104+NLSRC_OFFSET "Hong Kong R.A.S." + 106+NLSRC_OFFSET "Honduras" + 108+NLSRC_OFFSET "Croazia" + 109+NLSRC_OFFSET "Ungheria" + 110+NLSRC_OFFSET "Islanda" + 111+NLSRC_OFFSET "Indonesia" + 113+NLSRC_OFFSET "India" + 114+NLSRC_OFFSET "Territorio britannico dell'Oceano Indiano" + 116+NLSRC_OFFSET "Iran" + 117+NLSRC_OFFSET "Israele" + 118+NLSRC_OFFSET "Italia" + 119+NLSRC_OFFSET "Costa d'Avorio" + 121+NLSRC_OFFSET "Iraq" + 122+NLSRC_OFFSET "Giappone" + 124+NLSRC_OFFSET "Giamaica" + 125+NLSRC_OFFSET "Jan Mayen" + 126+NLSRC_OFFSET "Giordania" + 127+NLSRC_OFFSET "Atollo Johnston" + 129+NLSRC_OFFSET "Kenya" + 130+NLSRC_OFFSET "Kirghizistan" + 131+NLSRC_OFFSET "Corea del Nord" + 133+NLSRC_OFFSET "Kiribati" + 134+NLSRC_OFFSET "Corea" + 136+NLSRC_OFFSET "Kuwait" + 137+NLSRC_OFFSET "Kazakhstan" + 138+NLSRC_OFFSET "Laos" + 139+NLSRC_OFFSET "Libano" + 140+NLSRC_OFFSET "Lettonia" + 141+NLSRC_OFFSET "Lituania" + 142+NLSRC_OFFSET "Liberia" + 143+NLSRC_OFFSET "Slovacchia" + 145+NLSRC_OFFSET "Liechtenstein" + 146+NLSRC_OFFSET "Lesotho" + 147+NLSRC_OFFSET "Lussemburgo" + 148+NLSRC_OFFSET "Libia" + 149+NLSRC_OFFSET "Madagascar" + 151+NLSRC_OFFSET "Macao R.A.S." + 152+NLSRC_OFFSET "Moldova" + 154+NLSRC_OFFSET "Mongolia" + 156+NLSRC_OFFSET "Malawi" + 157+NLSRC_OFFSET "Mali" + 158+NLSRC_OFFSET "Monaco" + 159+NLSRC_OFFSET "Morocco" + 160+NLSRC_OFFSET "Mauritius" + 162+NLSRC_OFFSET "Mauritania" + 163+NLSRC_OFFSET "Malta" + 164+NLSRC_OFFSET "Oman" + 165+NLSRC_OFFSET "Maldive" + 166+NLSRC_OFFSET "Messico" + 167+NLSRC_OFFSET "Malaysia" + 168+NLSRC_OFFSET "Mozambico" + 173+NLSRC_OFFSET "Niger" + 174+NLSRC_OFFSET "Vanuatu" + 175+NLSRC_OFFSET "Nigeria" + 176+NLSRC_OFFSET "Paesi Bassi" + 177+NLSRC_OFFSET "Norvegia" + 178+NLSRC_OFFSET "Nepal" + 180+NLSRC_OFFSET "Nauru" + 181+NLSRC_OFFSET "Suriname" + 182+NLSRC_OFFSET "Nicaragua" + 183+NLSRC_OFFSET "Nuova Zelanda" + 184+NLSRC_OFFSET "Autorità Palestinese" + 185+NLSRC_OFFSET "Paraguay" + 187+NLSRC_OFFSET "Perù" + 190+NLSRC_OFFSET "Pakistan" + 191+NLSRC_OFFSET "Polonia" + 192+NLSRC_OFFSET "Panama" + 193+NLSRC_OFFSET "Portogallo" + 194+NLSRC_OFFSET "Papua Nuova Guinea" + 195+NLSRC_OFFSET "Palau" + 196+NLSRC_OFFSET "Guinea-Bissau" + 197+NLSRC_OFFSET "Qatar" + 198+NLSRC_OFFSET "Riunione" + 199+NLSRC_OFFSET "Isole Marshall" + 200+NLSRC_OFFSET "Romania" + 201+NLSRC_OFFSET "Filippine" + 202+NLSRC_OFFSET "Portorico" + 203+NLSRC_OFFSET "Russia" + 204+NLSRC_OFFSET "Ruanda" + 205+NLSRC_OFFSET "Arabia Saudita" + 206+NLSRC_OFFSET "Saint-Pierre e Miquelon" + 207+NLSRC_OFFSET "Saint Kitts e Nevis" + 208+NLSRC_OFFSET "Seychelles" + 209+NLSRC_OFFSET "Sudafrica" + 210+NLSRC_OFFSET "Senegal" + 212+NLSRC_OFFSET "Slovenia" + 213+NLSRC_OFFSET "Sierra Leone" + 214+NLSRC_OFFSET "San Marino" + 215+NLSRC_OFFSET "Singapore" + 216+NLSRC_OFFSET "Somalia" + 217+NLSRC_OFFSET "Spagna" + 218+NLSRC_OFFSET "Saint Lucia" + 219+NLSRC_OFFSET "Sudan" + 220+NLSRC_OFFSET "Svalbard" + 221+NLSRC_OFFSET "Svezia" + 222+NLSRC_OFFSET "Siria" + 223+NLSRC_OFFSET "Svizzera" + 224+NLSRC_OFFSET "Emirati Arabi Uniti" + 225+NLSRC_OFFSET "Trinidad e Tobago" + 227+NLSRC_OFFSET "Thailandia" + 228+NLSRC_OFFSET "Tagikistan" + 231+NLSRC_OFFSET "Tonga" + 232+NLSRC_OFFSET "Togo" + 233+NLSRC_OFFSET "São Tomé e PrÃncipe" + 234+NLSRC_OFFSET "Tunisia" + 235+NLSRC_OFFSET "Turchia" + 236+NLSRC_OFFSET "Tuvalu" + 237+NLSRC_OFFSET "Taiwan" + 238+NLSRC_OFFSET "Turkmenistan" + 239+NLSRC_OFFSET "Tanzania" + 240+NLSRC_OFFSET "Uganda" + 241+NLSRC_OFFSET "Ucraina" + 242+NLSRC_OFFSET "Regno Unito" + 244+NLSRC_OFFSET "Stati Uniti" + 245+NLSRC_OFFSET "Burkina Faso" + 246+NLSRC_OFFSET "Uruguay" + 247+NLSRC_OFFSET "Uzbekistan" + 248+NLSRC_OFFSET "Saint Vincent e Grenadine" + 249+NLSRC_OFFSET "Repubblica Bolivariana di Venezuela" + 251+NLSRC_OFFSET "Vietnam" + 252+NLSRC_OFFSET "Isole Vergini" + 253+NLSRC_OFFSET "Città del Vaticano" + 254+NLSRC_OFFSET "Namibia" + 257+NLSRC_OFFSET "Sahara Occidentale (contesa)" + 258+NLSRC_OFFSET "Isola di Wake" + 259+NLSRC_OFFSET "Samoa" + 260+NLSRC_OFFSET "Swaziland" + 261+NLSRC_OFFSET "Yemen" + 263+NLSRC_OFFSET "Zambia" + 264+NLSRC_OFFSET "Zimbabwe" + 269+NLSRC_OFFSET "Serbia e Montenegro (ex)" + 270+NLSRC_OFFSET "Montenegro" + 271+NLSRC_OFFSET "Serbia" + 273+NLSRC_OFFSET "Curaçao" + 276+NLSRC_OFFSET "Sudan del Sud" + 300+NLSRC_OFFSET "Anguilla" + 301+NLSRC_OFFSET "Antartide" + 302+NLSRC_OFFSET "Aruba" + 303+NLSRC_OFFSET "Isola Ascensione" + 304+NLSRC_OFFSET "Isole Ashmore e Cartier" + 305+NLSRC_OFFSET "Isola Baker" + 306+NLSRC_OFFSET "Isola Bouvet" + 307+NLSRC_OFFSET "Isole Cayman" + 308+NLSRC_OFFSET "Isole del Canale" + 309+NLSRC_OFFSET "Isola Christmas" + 310+NLSRC_OFFSET "Isola Clipperton" + 311+NLSRC_OFFSET "Isole Cocos (Keeling)" + 312+NLSRC_OFFSET "Isole Cook" + 313+NLSRC_OFFSET "Isole del Mar dei Coralli" + 314+NLSRC_OFFSET "Diego Garcia" + 315+NLSRC_OFFSET "Isole Falkland (Isole Malvine)" + 317+NLSRC_OFFSET "Guayana francese" + 318+NLSRC_OFFSET "Polinesia francese" + 319+NLSRC_OFFSET "Terre Australi e Antartiche Francesi" + 321+NLSRC_OFFSET "Guadalupa" + 322+NLSRC_OFFSET "Guam" + 323+NLSRC_OFFSET "Baia di Guantánamo" + 324+NLSRC_OFFSET "Guernsey" + 325+NLSRC_OFFSET "Isole Heard e McDonald" + 326+NLSRC_OFFSET "Isola Howland" + 327+NLSRC_OFFSET "Isola Jarvis" + 328+NLSRC_OFFSET "Jersey" + 329+NLSRC_OFFSET "Kingman Reef" + 330+NLSRC_OFFSET "Martinica" + 331+NLSRC_OFFSET "Mayotte" + 332+NLSRC_OFFSET "Montserrat" + 333+NLSRC_OFFSET "Antille olandesi (ex)" + 334+NLSRC_OFFSET "Nuova Caledonia" + 335+NLSRC_OFFSET "Niue" + 336+NLSRC_OFFSET "Isola Norfolk" + 337+NLSRC_OFFSET "Isole Marianne Settentrionali" + 338+NLSRC_OFFSET "Atollo di Palmyra" + 339+NLSRC_OFFSET "Isole Pitcairn" + 340+NLSRC_OFFSET "Isola Rota" + 341+NLSRC_OFFSET "Saipan" + 342+NLSRC_OFFSET "Georgia del Sud e Isole Sandwich Meridionali" + 343+NLSRC_OFFSET "Sant'Elena" + 346+NLSRC_OFFSET "Isola Tinian" + 347+NLSRC_OFFSET "Tokelau" + 348+NLSRC_OFFSET "Tristan da Cunha" + 349+NLSRC_OFFSET "Isole Turks e Caicos" + 351+NLSRC_OFFSET "Isole Vergini Britanniche" + 352+NLSRC_OFFSET "Wallis e Futuna" + 15126+NLSRC_OFFSET "Isola di Man" + 19618+NLSRC_OFFSET "Macedonia, ex Repubblica Jugoslava di" + 21242+NLSRC_OFFSET "Isole Midway" + 30967+NLSRC_OFFSET "Sint Maarten (parte olandese)" + 31706+NLSRC_OFFSET "Saint Martin (parte francese)" + (7299303+NLSRC_OFFSET)&0xffff "Repubblica Democratica di Timor Est" + (10028789+NLSRC_OFFSET)&0xffff "Isole à land" + (161832015+NLSRC_OFFSET)&0xffff "Saint-Barthélemy" + (161832256+NLSRC_OFFSET)&0xffff "Isole minori esterne degli Stati Uniti d'America" +END Propchange: trunk/reactos/dll/win32/kernel32/winnls/lang/it-IT.rc ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 7 months
1
0
0
0
[akhaldi] 67531: [SETUPAPI_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun May 3 11:33:46 2015 New Revision: 67531 URL:
http://svn.reactos.org/svn/reactos?rev=67531&view=rev
Log: [SETUPAPI_WINETEST] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/rostests/winetests/setupapi/devinst.c trunk/rostests/winetests/setupapi/misc.c trunk/rostests/winetests/setupapi/stringtable.c Modified: trunk/rostests/winetests/setupapi/devinst.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/devins…
============================================================================== --- trunk/rostests/winetests/setupapi/devinst.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/devinst.c [iso-8859-1] Sun May 3 11:33:46 2015 @@ -1572,7 +1572,7 @@ if (!winetest_interactive) { - win_skip("testSetupDiGetINFClassA(), ROSTESTS-124.\n"); + win_skip("testSetupDiGetINFClassA(), ROSTESTS-66.\n"); } else { Modified: trunk/rostests/winetests/setupapi/misc.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/misc.c…
============================================================================== --- trunk/rostests/winetests/setupapi/misc.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/misc.c [iso-8859-1] Sun May 3 11:33:46 2015 @@ -731,6 +731,51 @@ } } +struct default_callback_context +{ + DWORD magic; + HWND owner; + DWORD unk1[4]; + DWORD_PTR unk2[7]; + HWND progress; + UINT message; + DWORD_PTR unk3[5]; +}; + +static void test_defaultcallback(void) +{ + struct default_callback_context *ctxt; + static const DWORD magic = 0x43515053; /* "SPQC" */ + HWND owner, progress; + + owner = (HWND)0x123; + progress = (HWND)0x456; + ctxt = SetupInitDefaultQueueCallbackEx(owner, progress, WM_USER, 0, NULL); + ok(ctxt != NULL, "got %p\n", ctxt); + + ok(ctxt->magic == magic || broken(ctxt->magic != magic) /* win2000 */, "got magic 0x%08x\n", ctxt->magic); + if (ctxt->magic == magic) + { + ok(ctxt->owner == owner, "got %p, expected %p\n", ctxt->owner, owner); + ok(ctxt->progress == progress, "got %p, expected %p\n", ctxt->progress, progress); + ok(ctxt->message == WM_USER, "got %d, expected %d\n", ctxt->message, WM_USER); + SetupTermDefaultQueueCallback(ctxt); + } + else + { + win_skip("Skipping tests on old systems.\n"); + SetupTermDefaultQueueCallback(ctxt); + return; + } + + ctxt = SetupInitDefaultQueueCallback(owner); + ok(ctxt->magic == magic, "got magic 0x%08x\n", ctxt->magic); + ok(ctxt->owner == owner, "got %p, expected %p\n", ctxt->owner, owner); + ok(ctxt->progress == NULL, "got %p, expected %p\n", ctxt->progress, progress); + ok(ctxt->message == 0, "got %d\n", ctxt->message); + SetupTermDefaultQueueCallback(ctxt); +} + START_TEST(misc) { HMODULE hsetupapi = GetModuleHandleA("setupapi.dll"); @@ -760,4 +805,6 @@ test_SetupUninstallOEMInf(); else win_skip("SetupUninstallOEMInfA is not available\n"); -} + + test_defaultcallback(); +} Modified: trunk/rostests/winetests/setupapi/stringtable.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/setupapi/string…
============================================================================== --- trunk/rostests/winetests/setupapi/stringtable.c [iso-8859-1] (original) +++ trunk/rostests/winetests/setupapi/stringtable.c [iso-8859-1] Sun May 3 11:33:46 2015 @@ -29,6 +29,7 @@ #include "wingdi.h" #include "winuser.h" #include "winreg.h" +#include "winnls.h" #include "setupapi.h" #include "wine/test.h" @@ -48,57 +49,35 @@ static DWORD (WINAPI *pStringTableLookUpString)(HSTRING_TABLE, LPWSTR, DWORD); static DWORD (WINAPI *pStringTableLookUpStringEx)(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); static LPWSTR (WINAPI *pStringTableStringFromId)(HSTRING_TABLE, DWORD); - -static HMODULE hdll; +static BOOL (WINAPI *pStringTableGetExtraData)(HSTRING_TABLE, ULONG, void*, ULONG); + static WCHAR string[] = {'s','t','r','i','n','g',0}; static WCHAR String[] = {'S','t','r','i','n','g',0}; static WCHAR foo[] = {'f','o','o',0}; static void load_it_up(void) { - hdll = GetModuleHandleA("setupapi.dll"); - - pStringTableInitialize = (void*)GetProcAddress(hdll, "StringTableInitialize"); - if (!pStringTableInitialize) - pStringTableInitialize = (void*)GetProcAddress(hdll, "pSetupStringTableInitialize"); - - pStringTableInitializeEx = (void*)GetProcAddress(hdll, "StringTableInitializeEx"); - if (!pStringTableInitializeEx) - pStringTableInitializeEx = (void*)GetProcAddress(hdll, "pSetupStringTableInitializeEx"); - - pStringTableAddString = (void*)GetProcAddress(hdll, "StringTableAddString"); - if (!pStringTableAddString) - pStringTableAddString = (void*)GetProcAddress(hdll, "pSetupStringTableAddString"); - - pStringTableAddStringEx = (void*)GetProcAddress(hdll, "StringTableAddStringEx"); - if (!pStringTableAddStringEx) - pStringTableAddStringEx = (void*)GetProcAddress(hdll, "pSetupStringTableAddStringEx"); - - pStringTableDuplicate = (void*)GetProcAddress(hdll, "StringTableDuplicate"); - if (!pStringTableDuplicate) - pStringTableDuplicate = (void*)GetProcAddress(hdll, "pSetupStringTableDuplicate"); - - pStringTableDestroy = (void*)GetProcAddress(hdll, "StringTableDestroy"); - if (!pStringTableDestroy) - pStringTableDestroy = (void*)GetProcAddress(hdll, "pSetupStringTableDestroy"); - - pStringTableLookUpString = (void*)GetProcAddress(hdll, "StringTableLookUpString"); - if (!pStringTableLookUpString) - pStringTableLookUpString = (void*)GetProcAddress(hdll, "pSetupStringTableLookUpString"); - - pStringTableLookUpStringEx = (void*)GetProcAddress(hdll, "StringTableLookUpStringEx"); - if (!pStringTableLookUpStringEx) - pStringTableLookUpStringEx = (void*)GetProcAddress(hdll, "pSetupStringTableLookUpStringEx"); - - pStringTableStringFromId = (void*)GetProcAddress(hdll, "StringTableStringFromId"); - if (!pStringTableStringFromId) - pStringTableStringFromId = (void*)GetProcAddress(hdll, "pSetupStringTableStringFromId"); + HMODULE hdll = GetModuleHandleA("setupapi.dll"); + +#define X(f) if (!(p##f = (void*)GetProcAddress(hdll, #f))) \ + p##f = (void*)GetProcAddress(hdll, "pSetup"#f); + X(StringTableInitialize); + X(StringTableInitializeEx); + X(StringTableAddString); + X(StringTableAddStringEx); + X(StringTableDuplicate); + X(StringTableDestroy); + X(StringTableLookUpString); + X(StringTableLookUpStringEx); + X(StringTableStringFromId); + X(StringTableGetExtraData); +#undef X } static void test_StringTableAddString(void) { DWORD retval, hstring, hString, hfoo; - HANDLE table; + HSTRING_TABLE table; table = pStringTableInitialize(); ok(table != NULL, "failed to initialize string table\n"); @@ -106,7 +85,7 @@ /* case insensitive */ hstring=pStringTableAddString(table,string,0); ok(hstring!=-1,"Failed to add string to String Table\n"); - + retval=pStringTableAddString(table,String,0); ok(retval!=-1,"Failed to add String to String Table\n"); ok(hstring==retval,"string handle %x != String handle %x in String Table\n", hstring, retval); @@ -124,22 +103,23 @@ static void test_StringTableAddStringEx(void) { - DWORD retval, hstring, hString, hfoo; + DWORD retval, hstring, hString, hfoo, extra; HANDLE table; + BOOL ret; table = pStringTableInitialize(); ok(table != NULL,"Failed to Initialize String Table\n"); /* case insensitive */ hstring = pStringTableAddStringEx(table, string, 0, NULL, 0); - ok(hstring != ~0u, "Failed to add string to String Table\n"); + ok(hstring != -1, "Failed to add string to String Table\n"); retval = pStringTableAddStringEx(table, String, 0, NULL, 0); - ok(retval != ~0u, "Failed to add String to String Table\n"); + ok(retval != -1, "Failed to add String to String Table\n"); ok(hstring == retval, "string handle %x != String handle %x in String Table\n", hstring, retval); hfoo = pStringTableAddStringEx(table, foo, 0, NULL, 0); - ok(hfoo != ~0u, "Failed to add foo to String Table\n"); + ok(hfoo != -1, "Failed to add foo to String Table\n"); ok(hfoo != hstring, "foo and string share the same ID %x in String Table\n", hfoo); /* case sensitive */ @@ -147,11 +127,33 @@ ok(hstring != hString, "String handle and string share same ID %x in Table\n", hstring); pStringTableDestroy(table); + + /* set same string twice but with different extra */ + table = pStringTableInitializeEx(4, 0); + ok(table != NULL, "Failed to Initialize String Table\n"); + + extra = 10; + hstring = pStringTableAddStringEx(table, string, 0, &extra, 4); + ok(hstring != -1, "failed to add string, %d\n", hstring); + + extra = 0; + ret = pStringTableGetExtraData(table, hstring, &extra, 4); + ok(ret && extra == 10, "got %d, extra %d\n", ret, extra); + + extra = 11; + hstring = pStringTableAddStringEx(table, string, 0, &extra, 4); + ok(hstring != -1, "failed to add string, %d\n", hstring); + + extra = 0; + ret = pStringTableGetExtraData(table, hstring, &extra, 4); + ok(ret && extra == 10, "got %d, extra %d\n", ret, extra); + + pStringTableDestroy(table); } static void test_StringTableDuplicate(void) { - HANDLE table, table2; + HSTRING_TABLE table, table2; table = pStringTableInitialize(); ok(table != NULL,"Failed to Initialize String Table\n"); @@ -166,7 +168,7 @@ static void test_StringTableLookUpString(void) { DWORD retval, retval2, hstring, hString, hfoo; - HANDLE table, table2; + HSTRING_TABLE table, table2; table = pStringTableInitialize(); ok(table != NULL,"failed to initialize string table\n"); @@ -224,7 +226,7 @@ { static WCHAR uilevel[] = {'U','I','L','E','V','E','L',0}; DWORD retval, retval2, hstring, hString, hfoo, data; - HANDLE table, table2; + HSTRING_TABLE table, table2; char buffer[4]; table = pStringTableInitialize(); @@ -305,23 +307,55 @@ static void test_StringTableStringFromId(void) { - HANDLE table; - DWORD hstring; + HSTRING_TABLE table; WCHAR *string2; - int result; - - table = pStringTableInitialize(); - ok(table != NULL,"Failed to Initialize String Table\n"); - - hstring = pStringTableAddString(table, string, 0); - ok(hstring != ~0u,"failed to add 'string' to string table\n"); + DWORD id, id2; + + table = pStringTableInitialize(); + ok(table != NULL, "Failed to Initialize String Table\n"); + + id = pStringTableAddString(table, string, 0); + ok(id != -1, "failed to add 'string' to string table\n"); /* correct */ - string2=pStringTableStringFromId(table,pStringTableLookUpString(table,string,0)); - ok(string2!=NULL,"Failed to look up string by ID from String Table\n"); - - result=lstrcmpiW(string, string2); - ok(result==0,"StringID %p does not match requested StringID %p\n",string,string2); + id2 = pStringTableLookUpString(table, string, 0); + ok(id2 == id, "got %d and %d\n", id2, id); + + string2 = pStringTableStringFromId(table, id2); + ok(string2 != NULL, "failed to lookup string %d\n", id2); + ok(!lstrcmpiW(string, string2), "got %s, expected %s\n", wine_dbgstr_w(string2), wine_dbgstr_w(string)); + + pStringTableDestroy(table); +} + +struct stringtable { + char *data; + ULONG nextoffset; + ULONG allocated; + DWORD_PTR unk[2]; + ULONG max_extra_size; + LCID lcid; +}; + +static void test_stringtable_layout(void) +{ + struct stringtable *ptr; + HSTRING_TABLE table; + + table = pStringTableInitialize(); + ok(table != NULL,"failed to initialize string table\n"); + + ptr = (struct stringtable*)table; + ok(ptr->data != NULL, "got %p\n", ptr->data); + /* first data offset is right after bucket area */ + ok(ptr->nextoffset == 509*sizeof(DWORD), "got %d\n", ptr->nextoffset); + ok(ptr->allocated != 0, "got %d\n", ptr->allocated); +todo_wine { + ok(ptr->unk[0] != 0, "got %lx\n", ptr->unk[0]); + ok(ptr->unk[1] != 0, "got %lx\n", ptr->unk[1]); +} + ok(ptr->max_extra_size == 0, "got %d\n", ptr->max_extra_size); + ok(ptr->lcid == GetThreadLocale(), "got %x, thread lcid %x\n", ptr->lcid, GetThreadLocale()); pStringTableDestroy(table); } @@ -336,4 +370,5 @@ test_StringTableLookUpString(); test_StringTableLookUpStringEx(); test_StringTableStringFromId(); -} + test_stringtable_layout(); +}
9 years, 7 months
1
0
0
0
[akhaldi] 67530: [REG_WINETEST] Import from Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun May 3 11:32:28 2015 New Revision: 67530 URL:
http://svn.reactos.org/svn/reactos?rev=67530&view=rev
Log: [REG_WINETEST] Import from Wine Staging 1.7.37. CORE-9246 Added: trunk/rostests/winetests/reg/ (with props) trunk/rostests/winetests/reg/CMakeLists.txt (with props) trunk/rostests/winetests/reg/reg.c (with props) trunk/rostests/winetests/reg/testlist.c (with props) Modified: trunk/rostests/winetests/CMakeLists.txt Modified: trunk/rostests/winetests/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/CMakeLists.txt?…
============================================================================== --- trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] (original) +++ trunk/rostests/winetests/CMakeLists.txt [iso-8859-1] Sun May 3 11:32:28 2015 @@ -76,6 +76,7 @@ add_subdirectory(qmgr) add_subdirectory(quartz) add_subdirectory(rasapi32) +add_subdirectory(reg) add_subdirectory(regedit) add_subdirectory(riched20) add_subdirectory(riched32) Propchange: trunk/rostests/winetests/reg/ ------------------------------------------------------------------------------ --- bugtraq:logregex (added) +++ bugtraq:logregex Sun May 3 11:32:28 2015 @@ -0,0 +1,2 @@ +([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))? +(\d+) Propchange: trunk/rostests/winetests/reg/ ------------------------------------------------------------------------------ bugtraq:message = See issue #%BUGID% for more details. Propchange: trunk/rostests/winetests/reg/ ------------------------------------------------------------------------------ bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Added: trunk/rostests/winetests/reg/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/reg/CMakeLists.…
============================================================================== --- trunk/rostests/winetests/reg/CMakeLists.txt (added) +++ trunk/rostests/winetests/reg/CMakeLists.txt [iso-8859-1] Sun May 3 11:32:28 2015 @@ -0,0 +1,5 @@ + +add_executable(reg_winetest reg.c testlist.c) +set_module_type(reg_winetest win32cui) +add_importlibs(reg_winetest advapi32 msvcrt kernel32) +add_cd_file(TARGET reg_winetest DESTINATION reactos/bin FOR all) Propchange: trunk/rostests/winetests/reg/CMakeLists.txt ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/reg/reg.c?rev=6…
============================================================================== --- trunk/rostests/winetests/reg/reg.c (added) +++ trunk/rostests/winetests/reg/reg.c [iso-8859-1] Sun May 3 11:32:28 2015 @@ -0,0 +1,429 @@ +/* + * Copyright 2014 Akihiro Sagawa + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <windows.h> +#include "wine/test.h" + +#define lok ok_(__FILE__,line) +#define KEY_BASE "Software\\Wine\\reg_test" +#define REG_EXIT_SUCCESS 0 +#define REG_EXIT_FAILURE 1 +#define TODO_REG_TYPE (0x0001u) +#define TODO_REG_SIZE (0x0002u) +#define TODO_REG_DATA (0x0004u) + +#define run_reg_exe(c,r) run_reg_exe_(__LINE__,c,r) +static BOOL run_reg_exe_(unsigned line, const char *cmd, DWORD *rc) +{ + STARTUPINFOA si = {sizeof(STARTUPINFOA)}; + PROCESS_INFORMATION pi; + BOOL bret; + DWORD ret; + char cmdline[256]; + + si.dwFlags = STARTF_USESTDHANDLES; + si.hStdInput = INVALID_HANDLE_VALUE; + si.hStdOutput = INVALID_HANDLE_VALUE; + si.hStdError = INVALID_HANDLE_VALUE; + + strcpy(cmdline, cmd); + if (!CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) + return FALSE; + + ret = WaitForSingleObject(pi.hProcess, 10000); + if (ret == WAIT_TIMEOUT) + TerminateProcess(pi.hProcess, 1); + + bret = GetExitCodeProcess(pi.hProcess, rc); + lok(bret, "GetExitCodeProcess failed: %d\n", GetLastError()); + + CloseHandle(pi.hThread); + CloseHandle(pi.hProcess); + return bret; +} + +#define verify_reg(k,v,t,d,s,todo) verify_reg_(__LINE__,k,v,t,d,s,todo) +static void verify_reg_(unsigned line, HKEY hkey, const char* value, + DWORD exp_type, const void *exp_data, DWORD exp_size, DWORD todo) +{ + DWORD type, size; + BYTE data[256]; + LONG err; + + size = sizeof(data); + memset(data, 0xdd, size); + err = RegQueryValueExA(hkey, value, NULL, &type, data, &size); + lok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err); + if (err != ERROR_SUCCESS) + return; + + if (todo & TODO_REG_TYPE) + todo_wine lok(type == exp_type, "got wrong type %d, expected %d\n", type, exp_type); + else + lok(type == exp_type, "got wrong type %d, expected %d\n", type, exp_type); + if (todo & TODO_REG_SIZE) + todo_wine lok(size == exp_size, "got wrong size %d, expected %d\n", size, exp_size); + else + lok(size == exp_size, "got wrong size %d, expected %d\n", size, exp_size); + if (todo & TODO_REG_DATA) + todo_wine lok(memcmp(data, exp_data, size) == 0, "got wrong data\n"); + else + lok(memcmp(data, exp_data, size) == 0, "got wrong data\n"); +} + +static void test_add(void) +{ + HKEY hkey, subkey; + LONG err; + DWORD r, dword, type, size; + char buffer[22]; + + run_reg_exe("reg add", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS || err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + ok(err == ERROR_SUCCESS, "key creation failed, got %d\n", err); + + /* Test empty type */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v emptyType /t \"\" /d WineTest /f", &r); + ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */), + "got exit code %u\n", r); + if (r == REG_EXIT_SUCCESS) + verify_reg(hkey, "emptyType", REG_SZ, "", 1, 0); + else + win_skip("broken reg.exe detected\n"); + + /* Test input key formats */ + run_reg_exe("reg add \\HKCU\\" KEY_BASE "\\keytest0 /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\keytest0"); + ok(err == ERROR_FILE_NOT_FOUND, "got exit code %d\n", r); + + run_reg_exe("reg add \\\\HKCU\\" KEY_BASE "\\keytest1 /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\keytest1"); + ok(err == ERROR_FILE_NOT_FOUND, "got exit code %d\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest2\\\\ /f", &r); + ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), + "got exit code %u\n", r); + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\keytest2"); + ok(err == ERROR_FILE_NOT_FOUND || broken(err == ERROR_SUCCESS /* WinXP */), + "got exit code %d\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest3\\ /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE "\\keytest3", 0, KEY_READ, &subkey); + ok(err == ERROR_SUCCESS, "key creation failed, got %d\n", err); + RegCloseKey(subkey); + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\keytest3"); + ok(err == ERROR_SUCCESS, "got exit code %d\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE "\\keytest4 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE "\\keytest4", 0, KEY_READ, &subkey); + ok(err == ERROR_SUCCESS, "key creation failed, got %d\n", err); + RegCloseKey(subkey); + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE "\\keytest4"); + ok(err == ERROR_SUCCESS, "got exit code %d\n", r); + + /* REG_NONE */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v none0 /d deadbeef /t REG_NONE /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d\n", r); + verify_reg(hkey, "none0", REG_NONE, "d\0e\0a\0d\0b\0e\0e\0f\0\0", 18, 0); + + /* REG_SZ */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /d WineTest /f", &r); + ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */), + "got exit code %d, expected 0\n", r); + if (r == REG_EXIT_SUCCESS) + verify_reg(hkey, "", REG_SZ, "WineTest", 9, 0); + else + win_skip("broken reg.exe detected\n"); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v test /d deadbeef /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "test", REG_SZ, "deadbeef", 9, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v test /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "test", REG_SZ, "", 1, 0); + + run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /d WineTEST /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "", REG_SZ, "WineTEST", 9, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_SZ /v test2 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "test2", REG_SZ, "", 1, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_SZ /v test3 /f /d \"\"", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + verify_reg(hkey, "test3", REG_SZ, "", 1, 0); + + /* REG_EXPAND_SZ */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand0 /t REG_EXpand_sz /d \"dead%PATH%beef\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "expand0", REG_EXPAND_SZ, "dead%PATH%beef", 15, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v expand1 /t REG_EXpand_sz /d \"dead^%PATH^%beef\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "expand1", REG_EXPAND_SZ, "dead^%PATH^%beef", 17, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_EXPAND_SZ /v expand2 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "expand2", REG_EXPAND_SZ, "", 1, 0); + + run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /t REG_EXPAND_SZ /d WineTEST /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "", REG_EXPAND_SZ, "WineTEST", 9, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_EXPAND_SZ /v expand3 /f /d \"\"", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "expand3", REG_EXPAND_SZ, "", 1, 0); + + /* REG_BINARY */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin0 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "bin0", REG_BINARY, buffer, 0, 0); + + run_reg_exe("reg add HKEY_CURRENT_USER\\" KEY_BASE " /ve /t REG_BINARY /d deadbeef /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + dword = 0xefbeadde; + verify_reg(hkey, "", REG_BINARY, &dword, sizeof(DWORD), 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin1 /f /d 0xDeAdBeEf", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin2 /f /d x01", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin3 /f /d 01x", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin4 /f /d DeAdBeEf0DD", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + /* Remaining nibble prefixed */ + buffer[0] = 0x0d; buffer[1] = 0xea; buffer[2] = 0xdb; + buffer[3] = 0xee; buffer[4] = 0xf0; buffer[5] = 0xdd; + /* Remaining nibble suffixed on winXP */ + buffer[6] = 0xde; buffer[7] = 0xad; buffer[8] = 0xbe; + buffer[9] = 0xef; buffer[10] = 0x0d; buffer[11] = 0xd0; + size = 6; + err = RegQueryValueExA(hkey, "bin4", NULL, &type, (void *) (buffer+12), &size); + ok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err); + ok(type == REG_BINARY, "got wrong type %u\n", type); + ok(size == 6, "got wrong size %u\n", size); + ok(memcmp(buffer, buffer+12, 6) == 0 || + broken(memcmp(buffer+6, buffer+12, 6) == 0 /* WinXP */), "got wrong data\n"); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_BINARY /v bin5 /d \"\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "bin5", REG_BINARY, buffer, 0, 0); + + /* REG_DWORD */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /f /d 12345678", &r); + ok(r == REG_EXIT_SUCCESS || broken(r == REG_EXIT_FAILURE /* WinXP */), + "got exit code %d, expected 0\n", r); + dword = 12345678; + if (r == REG_EXIT_SUCCESS) + verify_reg(hkey, "", REG_DWORD, &dword, sizeof(dword), 0); + else + win_skip("broken reg.exe detected\n"); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword1 /t REG_DWORD /f", &r); + ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), + "got exit code %d, expected 0\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword2 /t REG_DWORD /d zzz /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword3 /t REG_DWORD /d deadbeef /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword4 /t REG_DWORD /d 123xyz /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword5 /t reg_dword /d 12345678 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + dword = 12345678; + verify_reg(hkey, "dword5", REG_DWORD, &dword, sizeof(dword), 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword6 /t REG_DWORD /D 0123 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + size = sizeof(dword); + err = RegQueryValueExA(hkey, "dword6", NULL, &type, (LPBYTE)&dword, &size); + ok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err); + ok(type == REG_DWORD, "got wrong type %d, expected %d\n", type, REG_DWORD); + ok(size == sizeof(DWORD), "got wrong size %d, expected %d\n", size, (int)sizeof(DWORD)); + ok(dword == 123 || broken(dword == 0123 /* WinXP */), + "got wrong data %d, expected %d\n", dword, 123); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword7 /t reg_dword /d 0xabcdefg /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword8 /t REG_dword /d 0xdeadbeef /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + dword = 0xdeadbeef; + verify_reg(hkey, "dword8", REG_DWORD, &dword, sizeof(dword), 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /v dword9 /f /d -1", &r); + ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_DWORD /v dword10 /f /d -0x1", &r); + ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %u\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword8 /t REG_dword /d 0x01ffffffff /f", &r); + todo_wine ok(r == REG_EXIT_FAILURE || broken(r == REG_EXIT_SUCCESS /* WinXP */), "got exit code %d\n", r); + + /* REG_DWORD_LITTLE_ENDIAN */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_LE /t REG_DWORD_LITTLE_ENDIAN /d 456 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + dword = 456; + verify_reg(hkey, "DWORD_LE", REG_DWORD_LITTLE_ENDIAN, &dword, sizeof(dword), 0); + + /* REG_DWORD_BIG_ENDIAN */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v DWORD_BE /t REG_DWORD_BIG_ENDIAN /d 456 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + dword = 456; + verify_reg(hkey, "DWORD_BE", REG_DWORD_BIG_ENDIAN, &dword, sizeof(dword), 0); + /* REG_DWORD_BIG_ENDIAN is broken in every version of windows. It behaves like + * an ordinary REG_DWORD - that is little endian. GG */ + + /* REG_MULTI_SZ */ + run_reg_exe("reg add HKCU\\" KEY_BASE " /v multi0 /t REG_MULTI_SZ /d \"three\\0little\\0strings\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + memcpy(buffer, "three\0little\0strings\0", 22); + verify_reg(hkey, "multi0", REG_MULTI_SZ, buffer, 22, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi1 /s \"#\" /d \"three#little#strings\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "multi1", REG_MULTI_SZ, buffer, 22, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi2 /d \"\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "multi2", REG_MULTI_SZ, &buffer[21], 1, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi3 /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "multi3", REG_MULTI_SZ, &buffer[21], 1, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi4 /s \"#\" /d \"threelittlestrings\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + verify_reg(hkey, "multi4", REG_MULTI_SZ, "threelittlestrings\0", 20, 0); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi5 /s \"#randomgibberish\" /d \"three#little#strings\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi6 /s \"\\0\" /d \"three\\0little\\0strings\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi7 /s \"\" /d \"three#little#strings\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi8 /s \"#\" /d \"##\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi9 /s \"#\" /d \"two##strings\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi10 /s \"#\" /d \"#a\" /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); + + run_reg_exe("reg add HKCU\\" KEY_BASE " /t REG_MULTI_SZ /v multi11 /s \"#\" /d \"a#\" /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %u\n", r); + buffer[0]='a'; buffer[1]=0; buffer[2]=0; + verify_reg(hkey, "multi11", REG_MULTI_SZ, buffer, 3, 0); + + RegCloseKey(hkey); + + err = RegDeleteKeyA(HKEY_CURRENT_USER, KEY_BASE); + ok(err == ERROR_SUCCESS, "got %d\n", err); +} + +static void test_delete(void) +{ + HKEY hkey, hsubkey; + LONG err; + DWORD r; + const DWORD deadbeef = 0xdeadbeef; + + run_reg_exe("reg delete", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); + + err = RegCreateKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); + ok(err == ERROR_SUCCESS, "got %d\n", err); + + err = RegSetValueExA(hkey, "foo", 0, REG_DWORD, (LPBYTE)&deadbeef, sizeof(deadbeef)); + ok(err == ERROR_SUCCESS, "got %d\n" ,err); + + err = RegSetValueExA(hkey, "bar", 0, REG_DWORD, (LPBYTE)&deadbeef, sizeof(deadbeef)); + ok(err == ERROR_SUCCESS, "got %d\n" ,err); + + err = RegSetValueExA(hkey, "", 0, REG_DWORD, (LPBYTE)&deadbeef, sizeof(deadbeef)); + ok(err == ERROR_SUCCESS, "got %d\n" ,err); + + err = RegCreateKeyExA(hkey, "subkey", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hsubkey, NULL); + ok(err == ERROR_SUCCESS, "got %d\n" ,err); + RegCloseKey(hsubkey); + + run_reg_exe("reg delete HKCU\\" KEY_BASE " /v bar /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + err = RegQueryValueExA(hkey, "bar", NULL, NULL, NULL, NULL); + ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + + run_reg_exe("reg delete HKCU\\" KEY_BASE " /ve /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + err = RegQueryValueExA(hkey, "", NULL, NULL, NULL, NULL); + ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + + run_reg_exe("reg delete HKCU\\" KEY_BASE " /va /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + err = RegQueryValueExA(hkey, "foo", NULL, NULL, NULL, NULL); + ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + err = RegOpenKeyExA(hkey, "subkey", 0, KEY_READ, &hsubkey); + ok(err == ERROR_SUCCESS, "got %d\n", err); + RegCloseKey(hsubkey); + RegCloseKey(hkey); + + run_reg_exe("reg delete HKCU\\" KEY_BASE " /f", &r); + ok(r == REG_EXIT_SUCCESS, "got exit code %d, expected 0\n", r); + err = RegOpenKeyExA(HKEY_CURRENT_USER, KEY_BASE, 0, KEY_READ, &hkey); + ok(err == ERROR_FILE_NOT_FOUND, "got %d\n", err); + + run_reg_exe("reg delete HKCU\\" KEY_BASE " /f", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %u\n", r); +} + +static void test_query(void) +{ + DWORD r; + run_reg_exe("reg Query", &r); + ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r); +} + +START_TEST(reg) +{ + DWORD r; + if (!run_reg_exe("reg.exe /?", &r)) { + win_skip("reg.exe not available, skipping reg.exe tests\n"); + return; + } + + test_add(); + test_delete(); + test_query(); +} Propchange: trunk/rostests/winetests/reg/reg.c ------------------------------------------------------------------------------ svn:eol-style = native Added: trunk/rostests/winetests/reg/testlist.c URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/reg/testlist.c?…
============================================================================== --- trunk/rostests/winetests/reg/testlist.c (added) +++ trunk/rostests/winetests/reg/testlist.c [iso-8859-1] Sun May 3 11:32:28 2015 @@ -0,0 +1,12 @@ +/* Automatically generated by make depend; DO NOT EDIT!! */ + +#define STANDALONE +#include <wine/test.h> + +extern void func_reg(void); + +const struct test winetest_testlist[] = +{ + { "reg", func_reg }, + { 0, 0 } +}; Propchange: trunk/rostests/winetests/reg/testlist.c ------------------------------------------------------------------------------ svn:eol-style = native
9 years, 7 months
1
0
0
0
[akhaldi] 67529: [REG] Sync with Wine Staging 1.7.37. CORE-9246
by akhaldi@svn.reactos.org
Author: akhaldi Date: Sun May 3 11:30:49 2015 New Revision: 67529 URL:
http://svn.reactos.org/svn/reactos?rev=67529&view=rev
Log: [REG] Sync with Wine Staging 1.7.37. CORE-9246 Modified: trunk/reactos/base/applications/cmdutils/reg/CMakeLists.txt trunk/reactos/base/applications/cmdutils/reg/lang/bg-BG.rc trunk/reactos/base/applications/cmdutils/reg/lang/cs-CZ.rc trunk/reactos/base/applications/cmdutils/reg/lang/da-DK.rc trunk/reactos/base/applications/cmdutils/reg/lang/de-DE.rc trunk/reactos/base/applications/cmdutils/reg/lang/en-US.rc trunk/reactos/base/applications/cmdutils/reg/lang/es-ES.rc trunk/reactos/base/applications/cmdutils/reg/lang/fr-FR.rc trunk/reactos/base/applications/cmdutils/reg/lang/it-IT.rc trunk/reactos/base/applications/cmdutils/reg/lang/ja-JP.rc trunk/reactos/base/applications/cmdutils/reg/lang/ko-KR.rc trunk/reactos/base/applications/cmdutils/reg/lang/lt-LT.rc trunk/reactos/base/applications/cmdutils/reg/lang/nl-NL.rc trunk/reactos/base/applications/cmdutils/reg/lang/no-NO.rc trunk/reactos/base/applications/cmdutils/reg/lang/pl-PL.rc trunk/reactos/base/applications/cmdutils/reg/lang/pt-PT.rc trunk/reactos/base/applications/cmdutils/reg/lang/ro-RO.rc trunk/reactos/base/applications/cmdutils/reg/lang/ru-RU.rc trunk/reactos/base/applications/cmdutils/reg/lang/sl-SI.rc trunk/reactos/base/applications/cmdutils/reg/lang/sq-AL.rc trunk/reactos/base/applications/cmdutils/reg/lang/sv-SE.rc trunk/reactos/base/applications/cmdutils/reg/lang/uk-UA.rc trunk/reactos/base/applications/cmdutils/reg/reg.c trunk/reactos/base/applications/cmdutils/reg/reg.h trunk/reactos/media/doc/README.WINE Modified: trunk/reactos/base/applications/cmdutils/reg/CMakeLists.txt URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/CMakeLists.txt [iso-8859-1] Sun May 3 11:30:49 2015 @@ -1,5 +1,6 @@ add_executable(reg reg.c reg.rc) set_module_type(reg win32cui UNICODE) -add_importlibs(reg advapi32 user32 shlwapi msvcrt kernel32) +target_link_libraries(reg wine) +add_importlibs(reg advapi32 user32 shlwapi msvcrt kernel32 ntdll) add_cd_file(TARGET reg DESTINATION reactos/system32 FOR all) Modified: trunk/reactos/base/applications/cmdutils/reg/lang/bg-BG.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/bg-BG.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/bg-BG.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "ÐÑеÑка: ÐепÑавилни паÑамеÑÑи на ÐºÐ¾Ð¼Ð°Ð½Ð´Ð¸Ñ Ñед\n" STRING_NO_REMOTE, "ÐÑеÑка: ÐеÑÑпеÑно добавÑне на клÑÑове в оÑдалеÑенаÑа маÑина\n" STRING_CANNOT_FIND, "ÐÑеÑка: УÑедбаÑа не оÑкÑи ÑÐºÐ°Ð·Ð°Ð½Ð¸Ñ ÑегиÑÑÑÑен клÑÑ Ð¸Ð»Ð¸ ÑÑойноÑÑ\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/cs-CZ.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/cs-CZ.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/cs-CZ.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -16,4 +16,7 @@ STRING_INVALID_CMDLINE, "Chyba: Neplatné parametry pÅÃkazové Åádky\n" STRING_NO_REMOTE, "Chyba: Nelze pÅidat klÃÄe na vzdálený stroj\n" STRING_CANNOT_FIND, "Chyba: Systém nenalezl zadaný klÃÄ nebo hodnotu registru\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/da-DK.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/da-DK.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/da-DK.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Fejl: Ugyldige kommando linje parametre\n" STRING_NO_REMOTE, "Fejl: Kunne ikke tilføje nøgler til fjern maskinen\n" STRING_CANNOT_FIND, "Fejl: Systemet kunne ikke finde, den angivet registrerings nøgle eller værdi\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/de-DE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/de-DE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/de-DE.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Fehler: Ungültige Befehlszeilenargumente\n" STRING_NO_REMOTE, "Fehler: Konnte Schlüssel nicht zum entfernten Rechner hinzufügen\n" STRING_CANNOT_FIND, "Fehler: Der angegebene Schlüssel oder Wert konnte nicht gefunden werden\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/en-US.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/en-US.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/en-US.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -9,6 +9,9 @@ STRING_SUCCESS, "The operation completed successfully\n" STRING_INVALID_KEY, "Error: Invalid key name\n" STRING_INVALID_CMDLINE, "Error: Invalid command line parameters\n" - STRING_NO_REMOTE, "Error: Unable to add keys to remote machine\n" + STRING_NO_REMOTE, "Error: Unable to access remote machine\n" STRING_CANNOT_FIND, "Error: The system was unable to find the specified registry key or value\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/es-ES.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/es-ES.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/es-ES.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Error: parámetros de lÃnea de comandos inválidos\n" STRING_NO_REMOTE, "Error: No se puede agregar claves al equipo remoto\n" STRING_CANNOT_FIND, "Error: El sistema no pudo encontrar la clave o el valor del Registro especificado\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/fr-FR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/fr-FR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/fr-FR.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Erreur : paramètre de ligne de commande non valable\n" STRING_NO_REMOTE, "Erreur : impossible d'ajouter des clés à une machine distante\n" STRING_CANNOT_FIND, "Erreur : le système n'a pas pu trouver la clé ou la valeur de registre spécifiée\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/it-IT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/it-IT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/it-IT.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Errore: parametri della linea di comando non validi\n" STRING_NO_REMOTE, "Errore: impossibile aggiungere chiavi alla macchina remota\n" STRING_CANNOT_FIND, "Errore: il sistema non è riuscito a trovare la chiave di registro o il valore specificati\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/ja-JP.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/ja-JP.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/ja-JP.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "ã¨ã©ã¼: ã³ãã³ã ã©ã¤ã³å¼æ°ãç¡å¹ã§ã\n" STRING_NO_REMOTE, "ã¨ã©ã¼: ãªã¢ã¼ã ãã·ã³ã«ãã¼ã追å ã§ãã¾ããã§ãã\n" STRING_CANNOT_FIND, "ã¨ã©ã¼: ã·ã¹ãã ã¯æå®ããããã¼ã¾ãã¯å¤ãè¦ã¤ãããã¾ããã§ãã\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/ko-KR.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/ko-KR.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/ko-KR.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "ìë¬:ì¬ë°ë¥´ì§ ìì ëª ë ¹ë¼ì¸ 매ê°ë³ì\n" STRING_NO_REMOTE, "ìë¬: ì격 머ì ì í¤ë¥¼ ëíë ê²ì ê°ë¥íì§ ììµëë¤\n" STRING_CANNOT_FIND, "ìë¬: ì´ ìì¤í ìì ì§ì ë ë ì§ì¤í¸ë¦¬ í¤ë ê°ì ì°¾ìì ììµëë¤\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/lt-LT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/lt-LT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/lt-LT.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Klaida: Netinkami komandos eilutÄs parametrai\n" STRING_NO_REMOTE, "Klaida: Negalima pridÄti raktų nuotoliniame kompiuteryje\n" STRING_CANNOT_FIND, "Klaida: Sistemai nepavyko rasti nurodyto registro rakto ar reikÅ¡mÄs\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/nl-NL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/nl-NL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/nl-NL.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Fout: Foutieve commandoregel-parameters\n" STRING_NO_REMOTE, "Fout: Sleutels konden niet toegevoegd worden aan de remote machine\n" STRING_CANNOT_FIND, "Fout: Het systeem kon de gespecificeerde registersleutel of waarde niet vinden\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/no-NO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/no-NO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/no-NO.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Feil: Ugyldige parametere på kommandolinjen\n" STRING_NO_REMOTE, "Feil: Kan ikke legge til nøkler på ekstern maskin\n" STRING_CANNOT_FIND, "Feil: Systemet klarte ikke finne den angitte registernøkkelen eller -verdien\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/pl-PL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/pl-PL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/pl-PL.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "BÅÄ d: NiewÅaÅciwe parametry wiersza poleceÅ\n" STRING_NO_REMOTE, "BÅÄ d: Nie można dodaÄ kluczy do zdalnej maszyny\n" STRING_CANNOT_FIND, "BÅÄ d: System nie mógÅ znaleÅºÄ podanej wartoÅci lub klucza rejestru\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/pt-PT.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/pt-PT.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/pt-PT.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Erro: Parâmetros da linha de comandos inválidos\n" STRING_NO_REMOTE, "Erro: Incapaz de adicionar chaves à máquina remota\n" STRING_CANNOT_FIND, "Erro: O sistema foi incapaz de encontrar a chave de registo ou valor especificado\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/ro-RO.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/ro-RO.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/ro-RO.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -17,4 +17,7 @@ STRING_INVALID_CMDLINE, "Eroare: Parametri nevalizi pentru linia de comandÄ\n" STRING_NO_REMOTE, "Eroare: Nu se pot adÄuga chei pe calculatorul de la distanÈÄ\n" STRING_CANNOT_FIND, "Eroare: Sistemul nu a putut gÄsi cheia sau valoarea de registru specificatÄ\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/ru-RU.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/ru-RU.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/ru-RU.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "ÐÑибка: ÐепÑавилÑнÑе паÑамеÑÑÑ ÐºÐ¾Ð¼Ð°Ð½Ð´Ð½Ð¾Ð¹ ÑÑÑоки\n" STRING_NO_REMOTE, "ÐÑибка: Ðевозможно добавиÑÑ ÐºÐ»ÑÑи на Ñдаленной маÑине\n" STRING_CANNOT_FIND, "ÐÑибка: Ðе ÑдалоÑÑ Ð½Ð°Ð¹Ñи ÑказаннÑй клÑÑ ÑееÑÑÑа или знаÑение\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/sl-SI.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/sl-SI.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/sl-SI.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Napaka: NapaÄen parameter v ukazni vrstici\n" STRING_NO_REMOTE, "Napaka: Na morem dodati kljuÄa na oddaljen raÄunalnik\n" STRING_CANNOT_FIND, "Napaka: Sistem ni naÅ¡el zahtevanega kljuÄa ali vrednosti\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/sq-AL.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/sq-AL.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/sq-AL.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -15,4 +15,7 @@ STRING_INVALID_CMDLINE, "Error: Parametrat e pavlefshme ne vijën komanduse\n" STRING_NO_REMOTE, "Error: Në pamundësi për të shtuar çelësat në makinë në distancë\n" STRING_CANNOT_FIND, "Error: Sistemi nuk ishte në gjendje për të gjetur çelësat të caktuar të regjistrit ose vlerës\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/sv-SE.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/sv-SE.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/sv-SE.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Fel: ogiltiga kommandoradsparametrar\n" STRING_NO_REMOTE, "Fel: Kan inte lägga till nycklar till fjärrmaskin\n" STRING_CANNOT_FIND, "Fel: Systemet kunde inte hitta angiven nyckel eller värde i registret\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/lang/uk-UA.rc URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/lang/uk-UA.rc [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/lang/uk-UA.rc [iso-8859-1] Sun May 3 11:30:49 2015 @@ -11,4 +11,7 @@ STRING_INVALID_CMDLINE, "Ðомилка: непÑавилÑÐ½Ñ Ð¿Ð°ÑамеÑÑи командного ÑÑдка\n" STRING_NO_REMOTE, "Ðомилка: неможливо додаÑи клÑÑÑ Ð½Ð° вÑддаленÑй маÑинÑ\n" STRING_CANNOT_FIND, "Ðомилка: не вдалоÑÑ Ð·Ð½Ð°Ð¹Ñи вказаний клÑÑ ÑеÑÑÑÑÑ Ñи знаÑеннÑ\n" + STRING_ERROR, "Unexpected error: " + STRING_UNSUPPORTED_TYPE, "Error: Unsupported type\n" + STRING_INVALID_DWORD, "Error: /d must be positive number\n" } Modified: trunk/reactos/base/applications/cmdutils/reg/reg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/reg.c [iso-8859-1] Sun May 3 11:30:49 2015 @@ -24,8 +24,69 @@ #include <wincon.h> #include <shlwapi.h> #include <wine/unicode.h> - +#include <wine/debug.h> #include "reg.h" + +#define ARRAY_SIZE(A) (sizeof(A)/sizeof(*A)) + +#define ERROR_NO_REMOTE 20000 +#define ERROR_INVALID_DWORD 20001 + +WINE_DEFAULT_DEBUG_CHANNEL(reg); + +static const WCHAR empty_wstr[] = {0}; + +static const WCHAR short_hklm[] = {'H','K','L','M',0}; +static const WCHAR short_hkcu[] = {'H','K','C','U',0}; +static const WCHAR short_hkcr[] = {'H','K','C','R',0}; +static const WCHAR short_hku[] = {'H','K','U',0}; +static const WCHAR short_hkcc[] = {'H','K','C','C',0}; +static const WCHAR long_hklm[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}; +static const WCHAR long_hkcu[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}; +static const WCHAR long_hkcr[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}; +static const WCHAR long_hku[] = {'H','K','E','Y','_','U','S','E','R','S',0}; +static const WCHAR long_hkcc[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}; + +static const struct +{ + HKEY key; + const WCHAR *short_name; + const WCHAR *long_name; +} +root_rels[] = +{ + {HKEY_LOCAL_MACHINE, short_hklm, long_hklm}, + {HKEY_CURRENT_USER, short_hkcu, long_hkcu}, + {HKEY_CLASSES_ROOT, short_hkcr, long_hkcr}, + {HKEY_USERS, short_hku, long_hku}, + {HKEY_CURRENT_CONFIG, short_hkcc, long_hkcc}, +}; + +static const WCHAR type_none[] = {'R','E','G','_','N','O','N','E',0}; +static const WCHAR type_sz[] = {'R','E','G','_','S','Z',0}; +static const WCHAR type_expand_sz[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0}; +static const WCHAR type_binary[] = {'R','E','G','_','B','I','N','A','R','Y',0}; +static const WCHAR type_dword[] = {'R','E','G','_','D','W','O','R','D',0}; +static const WCHAR type_dword_le[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0}; +static const WCHAR type_dword_be[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0}; +static const WCHAR type_multi_sz[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0}; + +static const struct +{ + DWORD type; + const WCHAR *name; +} +type_rels[] = +{ + {REG_NONE, type_none}, + {REG_SZ, type_sz}, + {REG_EXPAND_SZ, type_expand_sz}, + {REG_BINARY, type_binary}, + {REG_DWORD, type_dword}, + {REG_DWORD_LITTLE_ENDIAN, type_dword_le}, + {REG_DWORD_BIG_ENDIAN, type_dword_be}, + {REG_MULTI_SZ, type_multi_sz}, +}; static int reg_printfW(const WCHAR *msg, ...) { @@ -74,293 +135,407 @@ return reg_printfW(formatW, msg_buffer); } -static HKEY get_rootkey(LPWSTR key) -{ - static const WCHAR szHKLM[] = {'H','K','L','M',0}; - static const WCHAR szHKEY_LOCAL_MACHINE[] = {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}; - static const WCHAR szHKCU[] = {'H','K','C','U',0}; - static const WCHAR szHKEY_CURRENT_USER[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}; - static const WCHAR szHKCR[] = {'H','K','C','R',0}; - static const WCHAR szHKEY_CLASSES_ROOT[] = {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}; - static const WCHAR szHKU[] = {'H','K','U',0}; - static const WCHAR szHKEY_USERS[] = {'H','K','E','Y','_','U','S','E','R','S',0}; - static const WCHAR szHKCC[] = {'H','K','C','C',0}; - static const WCHAR szHKEY_CURRENT_CONFIG[] = {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}; - - if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKLM,4)==CSTR_EQUAL || - CompareStringW(CP_ACP,NORM_IGNORECASE,key,18,szHKEY_LOCAL_MACHINE,18)==CSTR_EQUAL) - return HKEY_LOCAL_MACHINE; - else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCU,4)==CSTR_EQUAL || - CompareStringW(CP_ACP,NORM_IGNORECASE,key,17,szHKEY_CURRENT_USER,17)==CSTR_EQUAL) - return HKEY_CURRENT_USER; - else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCR,4)==CSTR_EQUAL || - CompareStringW(CP_ACP,NORM_IGNORECASE,key,17,szHKEY_CLASSES_ROOT,17)==CSTR_EQUAL) - return HKEY_CLASSES_ROOT; - else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,3,szHKU,3)==CSTR_EQUAL || - CompareStringW(CP_ACP,NORM_IGNORECASE,key,10,szHKEY_USERS,10)==CSTR_EQUAL) - return HKEY_USERS; - else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCC,4)==CSTR_EQUAL || - CompareStringW(CP_ACP,NORM_IGNORECASE,key,19,szHKEY_CURRENT_CONFIG,19)==CSTR_EQUAL) - return HKEY_CURRENT_CONFIG; - else return NULL; -} - -static DWORD get_regtype(LPWSTR type) -{ - static const WCHAR szREG_SZ[] = {'R','E','G','_','S','Z',0}; - static const WCHAR szREG_MULTI_SZ[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0}; - static const WCHAR szREG_DWORD_BIG_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0}; - static const WCHAR szREG_DWORD[] = {'R','E','G','_','D','W','O','R','D',0}; - static const WCHAR szREG_BINARY[] = {'R','E','G','_','B','I','N','A','R','Y',0}; - static const WCHAR szREG_DWORD_LITTLE_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0}; - static const WCHAR szREG_NONE[] = {'R','E','G','_','N','O','N','E',0}; - static const WCHAR szREG_EXPAND_SZ[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0}; - - if (!type) +static void reg_print_error(LSTATUS error_code) +{ + switch (error_code) + { + case ERROR_SUCCESS: + return; + case ERROR_BAD_COMMAND: + reg_message(STRING_INVALID_CMDLINE); + return; + case ERROR_INVALID_HANDLE: + reg_message(STRING_INVALID_KEY); + return; + case ERROR_NO_REMOTE: + reg_message(STRING_NO_REMOTE); + return; + case ERROR_FILE_NOT_FOUND: + reg_message(STRING_CANNOT_FIND); + return; + case ERROR_UNSUPPORTED_TYPE: + reg_message(STRING_UNSUPPORTED_TYPE); + return; + case ERROR_INVALID_DWORD: + reg_message(STRING_INVALID_DWORD); + return; + default: + { + static const WCHAR error_string[] = {'%','0','5','d',':',' ','%','s',0}; + WCHAR *message = NULL; + FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, + error_code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (WCHAR *)&message, 0, NULL); + + reg_message(STRING_ERROR); + reg_printfW(error_string, error_code, message); + LocalFree(message); + return; + } + } +} + +static inline BOOL path_rootname_cmp(const WCHAR *input_path, const WCHAR *rootkey_name) +{ + DWORD length = strlenW(rootkey_name); + + return (!strncmpiW(input_path, rootkey_name, length) && + (input_path[length] == 0 || input_path[length] == '\\')); +} + +static HKEY path_get_rootkey(const WCHAR *path) +{ + DWORD i; + + for (i = 0; i < ARRAY_SIZE(root_rels); i++) + { + if (path_rootname_cmp(path, root_rels[i].short_name) || + path_rootname_cmp(path, root_rels[i].long_name)) + return root_rels[i].key; + } + + return NULL; +} + +static LSTATUS path_open(const WCHAR *path, HKEY *out, BOOL create) +{ + *out = path_get_rootkey(path); + + path = strchrW(path, '\\'); + if (path) + path++; + + if (create) + return RegCreateKeyW(*out, path, out); + else + return RegOpenKeyW(*out, path, out); +} + +static DWORD wchar_get_type(const WCHAR *type_name) +{ + DWORD i; + + if (!type_name) return REG_SZ; - if (lstrcmpiW(type,szREG_SZ)==0) return REG_SZ; - if (lstrcmpiW(type,szREG_DWORD)==0) return REG_DWORD; - if (lstrcmpiW(type,szREG_MULTI_SZ)==0) return REG_MULTI_SZ; - if (lstrcmpiW(type,szREG_EXPAND_SZ)==0) return REG_EXPAND_SZ; - if (lstrcmpiW(type,szREG_DWORD_BIG_ENDIAN)==0) return REG_DWORD_BIG_ENDIAN; - if (lstrcmpiW(type,szREG_DWORD_LITTLE_ENDIAN)==0) return REG_DWORD_LITTLE_ENDIAN; - if (lstrcmpiW(type,szREG_BINARY)==0) return REG_BINARY; - if (lstrcmpiW(type,szREG_NONE)==0) return REG_NONE; - - return -1; -} - -static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *reg_count) -{ - LPBYTE out_data = NULL; - *reg_count = 0; - - switch (reg_type) - { + for (i = 0; i < ARRAY_SIZE(type_rels); i++) + { + if (!strcmpiW(type_rels[i].name, type_name)) + return type_rels[i].type; + } + + return ~0u; +} + +static LSTATUS wchar_get_data(const WCHAR *input, const DWORD type, const WCHAR separator, + DWORD *size_out, BYTE **out) +{ + DWORD i; + + if (!input) + input = empty_wstr; + + switch (type) + { + case REG_NONE: case REG_SZ: - { - *reg_count = (lstrlenW(data) + 1) * sizeof(WCHAR); - out_data = HeapAlloc(GetProcessHeap(),0,*reg_count); - lstrcpyW((LPWSTR)out_data,data); - break; + case REG_EXPAND_SZ: + { + i = (strlenW(input) + 1) * sizeof(WCHAR); + *out = HeapAlloc(GetProcessHeap(), 0, i); + memcpy(*out, input, i); + *size_out = i; + return ERROR_SUCCESS; } case REG_DWORD: - { - LPWSTR rest; - DWORD val; - val = strtolW(data, &rest, 0); - if (rest == data) { - static const WCHAR nonnumber[] = {'E','r','r','o','r',':',' ','/','d',' ','r','e','q','u','i','r','e','s',' ','n','u','m','b','e','r','.','\n',0}; - reg_printfW(nonnumber); - break; + case REG_DWORD_BIG_ENDIAN: + { + WCHAR *temp; + + if (input[0] == '0' && (input[1] == 'x' || input[1] == 'X')) + i = strtoulW(input, &temp, 16); + else + i = strtoulW(input, &temp, 10); + + if (input[0] == '-' || temp[0] || temp == input) + return ERROR_INVALID_DWORD; + + if (i == 0xffffffff) + WINE_FIXME("Check for integer overflow.\n"); + + *out = HeapAlloc(GetProcessHeap(), 0, sizeof(DWORD)); + **(DWORD **) out = i; + *size_out = sizeof(DWORD); + return ERROR_SUCCESS; + } + case REG_MULTI_SZ: + { + WCHAR *temp = HeapAlloc(GetProcessHeap(), 0, (strlenW(input) + 1) * sizeof(WCHAR)); + DWORD p; + + for (i = 0, p = 0; i <= strlenW(input); i++, p++) + { + /* If this character is the separator, or no separator has been given and these + * characters are "\\0", then add a 0 indicating the end of this string */ + if ( (separator && input[i] == separator) || + (!separator && input[i] == '\\' && input[i + 1] == '0') ) + { + /* If it's the first character or the previous one was a separator */ + if (!p || temp[p - 1] == 0) + { + HeapFree(GetProcessHeap(), 0, temp); + return ERROR_INVALID_DATA; + } + temp[p] = 0; + + if (!separator) + i++; + } + else + temp[p] = input[i]; } - *reg_count = sizeof(DWORD); - out_data = HeapAlloc(GetProcessHeap(),0,*reg_count); - ((LPDWORD)out_data)[0] = val; - break; + + /* Add a 0 to the end if the string wasn't "", and it wasn't + * double-0-terminated already (In the case of a trailing separator) */ + if (p > 1 && temp[p - 2]) + temp[p++] = 0; + + *size_out = p * sizeof(WCHAR); + *out = (BYTE *) temp; + return ERROR_SUCCESS; + } + case REG_BINARY: + { + BYTE *temp = HeapAlloc(GetProcessHeap(), 0, strlenW(input)); + DWORD p, odd; + + for (i = 0, p = 0; i < strlenW(input); i++, p++) + { + if (input[i] >= '0' && input[i] <= '9') + temp[p] = input[i] - '0'; + else if (input[i] >= 'a' && input[i] <= 'f') + temp[p] = input[i] - 'a' + 10; + else if (input[i] >= 'A' && input[i] <= 'F') + temp[p] = input[i] - 'A' + 10; + else + { + HeapFree(GetProcessHeap(), 0, temp); + return ERROR_INVALID_DATA; + } + } + + *out = temp; + odd = p & 1; + temp += odd; + p >>= 1; + + for (i = 0; i < p; i++) + temp[i] = (temp[i * 2] << 4) | temp[i * 2 + 1]; + + *size_out = p + odd; + return ERROR_SUCCESS; } default: { - static const WCHAR unhandled[] = {'U','n','h','a','n','d','l','e','d',' ','T','y','p','e',' ','0','x','%','x',' ',' ','d','a','t','a',' ','%','s','\n',0}; - reg_printfW(unhandled, reg_type,data); - } - } - - return out_data; -} - -static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, - WCHAR *type, WCHAR separator, WCHAR *data, BOOL force) -{ - static const WCHAR stubW[] = {'A','D','D',' ','-',' ','%','s', - ' ','%','s',' ','%','d',' ','%','s',' ','%','s',' ','%','d','\n',0}; - LPWSTR p; - HKEY root,subkey; - - reg_printfW(stubW, key_name, value_name, value_empty, type, data, force); - - if (key_name[0]=='\\' && key_name[1]=='\\') - { - reg_message(STRING_NO_REMOTE); - return 1; - } - - p = strchrW(key_name,'\\'); - if (!p) - { - reg_message(STRING_INVALID_KEY); - return 1; - } - p++; - - root = get_rootkey(key_name); - if (!root) - { - reg_message(STRING_INVALID_KEY); - return 1; - } - - if(RegCreateKeyW(root,p,&subkey)!=ERROR_SUCCESS) - { - reg_message(STRING_INVALID_KEY); - return 1; - } + WINE_FIXME("Add support for registry type: %u\n", type); + return ERROR_UNSUPPORTED_TYPE; + } + } +} + +static LSTATUS sane_path(const WCHAR *key) +{ + int i = strlenW(key); + + if (i < 3 || (key[i - 1] == '\\' && key[i - 2] == '\\')) + return ERROR_INVALID_HANDLE; + + if (key[0] == '\\' && key[1] == '\\' && key[2] != '\\') + return ERROR_NO_REMOTE; + + return ERROR_SUCCESS; +} + +static int reg_add( const WCHAR *key_name, const WCHAR *value_name, const BOOL value_empty, + const WCHAR *type, const WCHAR separator, const WCHAR *data, + const BOOL force) +{ + HKEY key = NULL; + LONG err = sane_path(key_name); + if (err != ERROR_SUCCESS) + goto error; + + if (value_name && value_empty) + { + err = ERROR_BAD_COMMAND; + goto error; + } + + err = path_open(key_name, &key, TRUE); + if (err != ERROR_SUCCESS) + goto error; if (value_name || data) { - DWORD reg_type; - DWORD reg_count = 0; - BYTE* reg_data = NULL; - - if (!force) - { - if (RegQueryValueW(subkey,value_name,NULL,NULL)==ERROR_SUCCESS) - { - /* FIXME: Prompt for overwrite */ - } - } - - reg_type = get_regtype(type); - if (reg_type == -1) - { - RegCloseKey(subkey); - reg_message(STRING_INVALID_CMDLINE); - return 1; - } - - if (data) - reg_data = get_regdata(data,reg_type,separator,®_count); - - RegSetValueExW(subkey,value_name,0,reg_type,reg_data,reg_count); - HeapFree(GetProcessHeap(),0,reg_data); - } - - RegCloseKey(subkey); - reg_message(STRING_SUCCESS); - - return 0; -} - -static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, - BOOL value_all, BOOL force) -{ - LPWSTR p; - HKEY root,subkey; - - static const WCHAR stubW[] = {'D','E','L','E','T','E', - ' ','-',' ','%','s',' ','%','s',' ','%','d',' ','%','d',' ','%','d','\n' - ,0}; - reg_printfW(stubW, key_name, value_name, value_empty, value_all, force); - - if (key_name[0]=='\\' && key_name[1]=='\\') - { - reg_message(STRING_NO_REMOTE); - return 1; - } - - p = strchrW(key_name,'\\'); - if (!p) - { - reg_message(STRING_INVALID_KEY); - return 1; - } - p++; - - root = get_rootkey(key_name); - if (!root) - { - reg_message(STRING_INVALID_KEY); - return 1; - } - - if (value_name && value_empty) - { - reg_message(STRING_INVALID_CMDLINE); - return 1; - } - - if (value_empty && value_all) - { - reg_message(STRING_INVALID_CMDLINE); - return 1; - } - - if (!force) - { - /* FIXME: Prompt for delete */ - } - - /* Delete subtree only if no /v* option is given */ - if (!value_name && !value_empty && !value_all) - { - if (SHDeleteKeyW(root, p) != ERROR_SUCCESS) - { - reg_message(STRING_CANNOT_FIND); - return 1; - } - reg_message(STRING_SUCCESS); - return 0; - } - - if(RegOpenKeyW(root,p,&subkey)!=ERROR_SUCCESS) - { - reg_message(STRING_CANNOT_FIND); - return 1; - } - - if (value_all) - { - LPWSTR szValue; - DWORD maxValue; - DWORD count; - LONG rc; - - rc = RegQueryInfoKeyW(subkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - &maxValue, NULL, NULL, NULL); - if (rc != ERROR_SUCCESS) - { - /* FIXME: failure */ - RegCloseKey(subkey); - return 1; - } - maxValue++; - szValue = HeapAlloc(GetProcessHeap(),0,maxValue*sizeof(WCHAR)); - - while (1) - { - count = maxValue; - rc = RegEnumValueW(subkey, 0, szValue, &count, NULL, NULL, NULL, NULL); - if (rc == ERROR_SUCCESS) - { - rc = RegDeleteValueW(subkey, szValue); - if (rc != ERROR_SUCCESS) - break; - } - else break; - } - if (rc != ERROR_SUCCESS) - { - /* FIXME delete failed */ - } - } - else if (value_name) - { - if (RegDeleteValueW(subkey,value_name) != ERROR_SUCCESS) - { - RegCloseKey(subkey); - reg_message(STRING_CANNOT_FIND); - return 1; - } - } - else if (value_empty) - { - RegSetValueExW(subkey,NULL,0,REG_SZ,NULL,0); - } - - RegCloseKey(subkey); + DWORD size, reg_type; + BYTE *data_out; + + if (value_name && !value_name[0]) + value_name = NULL; + + if (type && !type[0]) + { + data = NULL; + type = NULL; + } + + if (!force && RegQueryValueExW(key, value_name, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) + { + WINE_FIXME("Prompt for overwrite\n"); + } + + reg_type = wchar_get_type(type); + if (reg_type == ~0u) + { + err = ERROR_INVALID_DATATYPE; + goto error; + } + + err = wchar_get_data(data, reg_type, separator, &size, &data_out); + if (err != ERROR_SUCCESS) + goto error; + + err = RegSetValueExW(key, value_name, 0, reg_type, data_out, size); + HeapFree(GetProcessHeap(), 0, data_out); + if (err != ERROR_SUCCESS) + goto error; + } + + RegCloseKey(key); reg_message(STRING_SUCCESS); return 0; + +error: + RegCloseKey(key); + reg_print_error(err); + return 1; +} + +static int reg_delete(const WCHAR *key_name, const WCHAR *value_name, const BOOL value_empty, + const BOOL value_all, const BOOL force) +{ + HKEY key = NULL; + LONG err = sane_path(key_name); + if (err != ERROR_SUCCESS) + { + reg_print_error(err); + return 1; + } + + err = path_open(key_name, &key, FALSE); + if (err != ERROR_SUCCESS) + goto error; + + /* Mutually exclusive options */ + if ((!!value_name + !!value_empty + !!value_all) > 1) + { + err = ERROR_BAD_COMMAND; + goto error; + } + + if (!force) + { + WINE_FIXME("Prompt for delete\n"); + } + + if (value_empty || value_name) + { + if (value_name && value_name[0]) + err = RegDeleteValueW(key, value_name); + else + err = RegDeleteValueW(key, NULL); + + if (err != ERROR_SUCCESS) + goto error; + } + else if (value_all) + { + WCHAR *enum_v_name; + DWORD count, max_size, this_size, i = 0; + BOOL incomplete = FALSE; + + err = RegQueryInfoKeyW(key, NULL, NULL, NULL, NULL, NULL, NULL, + &count, &max_size, NULL, NULL, NULL); + if (err != ERROR_SUCCESS) + goto error; + + max_size++; + enum_v_name = HeapAlloc(GetProcessHeap(), 0, max_size * sizeof(WCHAR)); + if (!enum_v_name) + { + err = ERROR_NOT_ENOUGH_MEMORY; + goto error; + } + + while (i < count) + { + this_size = max_size; + + err = RegEnumValueW(key, i, enum_v_name, &this_size, NULL, NULL, NULL, NULL); + if (err != ERROR_SUCCESS) + { + reg_print_error(err); + incomplete = TRUE; + i++; + continue; + } + + err = RegDeleteValueW(key, enum_v_name); + if (err != ERROR_SUCCESS) + { + reg_print_error(err); + incomplete = TRUE; + i++; + continue; + } + + count--; + } + + HeapFree(GetProcessHeap(), 0, enum_v_name); + + if (incomplete) + { + RegCloseKey(key); + return 1; + } + } + /* Delete subtree only if no /v* option is given */ + else + { + if (key == path_get_rootkey(key_name)) + { + /* "This works well enough on native to make you regret you pressed enter" - stefand */ + WINE_FIXME("Deleting a root key is not implemented.\n"); + RegCloseKey(key); + return 1; + } + + err = SHDeleteKey(key, NULL); + if (err != ERROR_SUCCESS) + goto error; + err = RegDeleteKeyW(key, empty_wstr); + if (err != ERROR_SUCCESS) + goto error; + } + + RegCloseKey(key); + reg_message(STRING_SUCCESS); + return 0; + +error: + RegCloseKey(key); + reg_print_error(err); + return 1; } static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, @@ -404,7 +579,7 @@ if (argc < 3) { - reg_message(STRING_INVALID_CMDLINE); + reg_print_error(ERROR_BAD_COMMAND); return 1; } else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) || @@ -424,7 +599,14 @@ else if (!lstrcmpiW(argvW[i], slashTW)) type = argvW[++i]; else if (!lstrcmpiW(argvW[i], slashSW)) - separator = argvW[++i][0]; + { + if (!argvW[++i][0] || argvW[i][1]) + { + reg_print_error(ERROR_BAD_COMMAND); + return 1; + } + separator = argvW[i][0]; + } else if (!lstrcmpiW(argvW[i], slashDW)) data = argvW[++i]; else if (!lstrcmpiW(argvW[i], slashFW)) @@ -440,7 +622,7 @@ if (argc < 3) { - reg_message(STRING_INVALID_CMDLINE); + reg_print_error(ERROR_BAD_COMMAND); return 1; } else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) || @@ -471,7 +653,7 @@ if (argc < 3) { - reg_message(STRING_INVALID_CMDLINE); + reg_print_error(ERROR_BAD_COMMAND); return 1; } else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) || @@ -495,7 +677,7 @@ } else { - reg_message(STRING_INVALID_CMDLINE); + reg_print_error(ERROR_BAD_COMMAND); return 1; } } Modified: trunk/reactos/base/applications/cmdutils/reg/reg.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils…
============================================================================== --- trunk/reactos/base/applications/cmdutils/reg/reg.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/reg/reg.h [iso-8859-1] Sun May 3 11:30:49 2015 @@ -32,3 +32,6 @@ #define STRING_INVALID_CMDLINE 107 #define STRING_NO_REMOTE 108 #define STRING_CANNOT_FIND 109 +#define STRING_ERROR 110 +#define STRING_UNSUPPORTED_TYPE 111 +#define STRING_INVALID_DWORD 112 Modified: trunk/reactos/media/doc/README.WINE URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sun May 3 11:30:49 2015 @@ -230,7 +230,7 @@ ReactOS shares the following programs with Winehq. reactos/base/applications/cmdutils/cscript # Synced to Wine-1.7.27 -reactos/base/applications/cmdutils/reg # Synced to Wine-1.7.27 +reactos/base/applications/cmdutils/reg # Synced to WineStaging-1.7.37 reactos/base/applications/cmdutils/taskkill # Synced to Wine-1.7.27 reactos/base/applications/cmdutils/wmic # Synced to Wine-1.7.27 reactos/base/applications/cmdutils/wscript # Synced to WineStaging-1.7.37
9 years, 7 months
1
0
0
0
[aandrejevic] 67528: [FAST486] Properly check the limit for "expand down" segments.
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun May 3 03:37:06 2015 New Revision: 67528 URL:
http://svn.reactos.org/svn/reactos?rev=67528&view=rev
Log: [FAST486] Properly check the limit for "expand down" segments. Modified: trunk/reactos/lib/fast486/common.c Modified: trunk/reactos/lib/fast486/common.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=6…
============================================================================== --- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Sun May 3 03:37:06 2015 @@ -47,11 +47,23 @@ /* Get the cached descriptor */ CachedDescriptor = &State->SegmentRegs[SegmentReg]; - if ((Offset + Size - 1) > CachedDescriptor->Limit) - { - /* Read beyond limit */ - Fast486Exception(State, FAST486_EXCEPTION_GP); - return FALSE; + if (InstFetch || !CachedDescriptor->DirConf) + { + if ((Offset + Size - 1) > CachedDescriptor->Limit) + { + /* Read beyond limit */ + Fast486Exception(State, FAST486_EXCEPTION_GP); + return FALSE; + } + } + else + { + if (Offset < CachedDescriptor->Limit) + { + /* Read beyond limit */ + Fast486Exception(State, FAST486_EXCEPTION_GP); + return FALSE; + } } /* Check for protected mode */ @@ -157,11 +169,23 @@ /* Get the cached descriptor */ CachedDescriptor = &State->SegmentRegs[SegmentReg]; - if ((Offset + Size - 1) > CachedDescriptor->Limit) - { - /* Write beyond limit */ - Fast486Exception(State, FAST486_EXCEPTION_GP); - return FALSE; + if (!CachedDescriptor->DirConf) + { + if ((Offset + Size - 1) > CachedDescriptor->Limit) + { + /* Write beyond limit */ + Fast486Exception(State, FAST486_EXCEPTION_GP); + return FALSE; + } + } + else + { + if (Offset < CachedDescriptor->Limit) + { + /* Read beyond limit */ + Fast486Exception(State, FAST486_EXCEPTION_GP); + return FALSE; + } } /* Check for protected mode */
9 years, 7 months
1
0
0
0
[aandrejevic] 67527: [NTVDM] - Fix a typo. - Use a #define for the device flag. - In r67526, the following change was committed but not described in the commit message: - Enable opening devices in ...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun May 3 02:11:32 2015 New Revision: 67527 URL:
http://svn.reactos.org/svn/reactos?rev=67527&view=rev
Log: [NTVDM] - Fix a typo. - Use a #define for the device flag. - In r67526, the following change was committed but not described in the commit message: - Enable opening devices in DosCreateFile and DosCreateFileEx. Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c trunk/reactos/subsystems/mvdm/ntvdm/emulator.c Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Sun May 3 02:11:32 2015 @@ -62,7 +62,7 @@ for (i = 0; i < Sft->NumDescriptors; i++) { if ((Sft->FileDescriptors[i].RefCount > 0) - && !(Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && !(Sft->FileDescriptors[i].DeviceInfo & FILE_INFO_DEVICE) && (Sft->FileDescriptors[i].Win32Handle == Win32Handle)) { return Count; @@ -92,7 +92,7 @@ for (i = 0; i < Sft->NumDescriptors; i++) { if ((Sft->FileDescriptors[i].RefCount > 0) - && (Sft->FileDescriptors[i].DeviceInfo & (1 << 7)) + && (Sft->FileDescriptors[i].DeviceInfo & FILE_INFO_DEVICE) && (Sft->FileDescriptors[i].DevicePointer == DevicePointer)) { return Count; @@ -369,7 +369,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -445,7 +445,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -593,7 +593,7 @@ if (Node != NULL) { Descriptor->DevicePointer = Node->Driver; - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; } else { @@ -634,7 +634,7 @@ return ERROR_INVALID_HANDLE; } - if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); if (!Node->ReadRoutine) return ERROR_INVALID_FUNCTION; @@ -689,7 +689,7 @@ return ERROR_INVALID_HANDLE; } - if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); if (!Node->WriteRoutine) return ERROR_INVALID_FUNCTION; @@ -749,7 +749,7 @@ return ERROR_INVALID_HANDLE; } - if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { /* For character devices, always return success */ return ERROR_SUCCESS; @@ -797,7 +797,7 @@ return FALSE; } - if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { PDOS_DEVICE_NODE Node = DosGetDriverNode(Descriptor->DevicePointer); @@ -824,7 +824,7 @@ } /* Always succeed for character devices */ - if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) return TRUE; if (!LockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) { @@ -847,7 +847,7 @@ } /* Always succeed for character devices */ - if (Descriptor->DeviceInfo & (1 << 7)) return TRUE; + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) return TRUE; if (!UnlockFile(Descriptor->Win32Handle, Offset, 0, Size, 0)) { @@ -869,7 +869,7 @@ return FALSE; } - if (Descriptor->DeviceInfo & (1 << 7)) + if (Descriptor->DeviceInfo & FILE_INFO_DEVICE) { Node = DosGetDriverNode(Descriptor->DevicePointer); } Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.h [iso-8859-1] Sun May 3 02:11:32 2015 @@ -7,6 +7,8 @@ */ /* DEFINES ********************************************************************/ + +#define FILE_INFO_DEVICE (1 << 7) #pragma pack(push, 1) Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/handle.c [iso-8859-1] Sun May 3 02:11:32 2015 @@ -103,7 +103,7 @@ { PDOS_DEVICE_NODE Node = DosGetDriverNode(SysVars->ActiveCon); - Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + Descriptor->DeviceInfo = Node->DeviceAttributes | FILE_INFO_DEVICE; Descriptor->DevicePointer = SysVars->ActiveCon; /* Call the open routine */ Modified: trunk/reactos/subsystems/mvdm/ntvdm/emulator.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/emul…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/emulator.c [iso-8859-1] Sun May 3 02:11:32 2015 @@ -121,7 +121,7 @@ Opcode = (PBYTE)SEG_OFF_TO_PTR(CodeSegment, InstructionPointer); /* Display a message to the user */ - DisplayMessage(L"Exception: %s occured at %04X:%04X\n" + DisplayMessage(L"Exception: %s occurred at %04X:%04X\n" L"Opcode: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", ExceptionName[ExceptionNumber], CodeSegment,
9 years, 7 months
1
0
0
0
[aandrejevic] 67526: [FAST486] Update the copyright year (better late than never). Push the error code inside Fast486InterruptInternal, to make the size of the pushed value on the stack correct. Up...
by aandrejevic@svn.reactos.org
Author: aandrejevic Date: Sun May 3 01:45:57 2015 New Revision: 67526 URL:
http://svn.reactos.org/svn/reactos?rev=67526&view=rev
Log: [FAST486] Update the copyright year (better late than never). Push the error code inside Fast486InterruptInternal, to make the size of the pushed value on the stack correct. Update the CPL in Fast486TaskSwitch. Modified: trunk/reactos/include/reactos/libs/fast486/fast486.h trunk/reactos/lib/fast486/common.c trunk/reactos/lib/fast486/common.h trunk/reactos/lib/fast486/common.inl trunk/reactos/lib/fast486/debug.c trunk/reactos/lib/fast486/extraops.c trunk/reactos/lib/fast486/extraops.h trunk/reactos/lib/fast486/fast486.c trunk/reactos/lib/fast486/fpu.c trunk/reactos/lib/fast486/fpu.h trunk/reactos/lib/fast486/opcodes.c trunk/reactos/lib/fast486/opcodes.h trunk/reactos/lib/fast486/opgroups.c trunk/reactos/lib/fast486/opgroups.h trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c Modified: trunk/reactos/include/reactos/libs/fast486/fast486.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/libs/fast4…
============================================================================== --- trunk/reactos/include/reactos/libs/fast486/fast486.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/libs/fast486/fast486.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * fast486.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/common.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.c?rev=6…
============================================================================== --- trunk/reactos/lib/fast486/common.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * common.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -264,7 +264,9 @@ static inline BOOLEAN FASTCALL Fast486InterruptInternal(PFAST486_STATE State, - PFAST486_IDT_ENTRY IdtEntry) + PFAST486_IDT_ENTRY IdtEntry, + BOOLEAN PushErrorCode, + ULONG ErrorCode) { USHORT SegmentSelector = IdtEntry->Selector; ULONG Offset = MAKELONG(IdtEntry->Offset, IdtEntry->OffsetHigh); @@ -400,6 +402,16 @@ /* Push the instruction pointer */ if (!Fast486StackPush(State, State->InstPtr.Long)) goto Cleanup; + if (PushErrorCode) + { + /* Push the error code */ + if (!Fast486StackPush(State, ErrorCode)) + { + /* An exception occurred */ + goto Cleanup; + } + } + if ((GateType == FAST486_IDT_INT_GATE) || (GateType == FAST486_IDT_INT_GATE_32)) { /* Disable interrupts after a jump to an interrupt gate handler */ @@ -448,7 +460,7 @@ } /* Perform the interrupt */ - if (!Fast486InterruptInternal(State, &IdtEntry)) + if (!Fast486InterruptInternal(State, &IdtEntry, FALSE, 0)) { /* Exception occurred */ return FALSE; @@ -463,6 +475,8 @@ FAST486_EXCEPTIONS ExceptionCode, ULONG ErrorCode) { + FAST486_IDT_ENTRY IdtEntry; + /* Increment the exception count */ State->ExceptionCount++; @@ -491,8 +505,8 @@ /* Restore the IP to the saved IP */ State->InstPtr = State->SavedInstPtr; - /* Perform the interrupt */ - if (!Fast486PerformInterrupt(State, ExceptionCode)) + /* Get the interrupt vector */ + if (!Fast486GetIntVector(State, ExceptionCode, &IdtEntry)) { /* * If this function failed, that means Fast486Exception @@ -501,18 +515,18 @@ return; } - if (EXCEPTION_HAS_ERROR_CODE(ExceptionCode) - && (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)) - { - /* Push the error code */ - if (!Fast486StackPush(State, ErrorCode)) - { - /* - * If this function failed, that means Fast486Exception - * was called again, so just return in this case. - */ - return; - } + /* Perform the interrupt */ + if (!Fast486InterruptInternal(State, + &IdtEntry, + EXCEPTION_HAS_ERROR_CODE(ExceptionCode) + && (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE), + ErrorCode)) + { + /* + * If this function failed, that means Fast486Exception + * was called again, so just return in this case. + */ + return; } /* Reset the exception count */ @@ -702,10 +716,16 @@ /* Flush the TLB */ if (State->Tlb) RtlZeroMemory(State->Tlb, NUM_TLB_ENTRIES * sizeof(ULONG)); + /* Update the CPL */ + State->Cpl = GET_SEGMENT_RPL(NewTss.Cs); + #ifndef FAST486_NO_PREFETCH /* Context switching invalidates the prefetch */ State->PrefetchValid = FALSE; #endif + + /* Update the CPL */ + State->Cpl = GET_SEGMENT_RPL(NewTss.Cs); /* Load the registers */ State->InstPtr.Long = State->SavedInstPtr.Long = NewTss.Eip; Modified: trunk/reactos/lib/fast486/common.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.h?rev=6…
============================================================================== --- trunk/reactos/lib/fast486/common.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * common.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/common.inl URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev…
============================================================================== --- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * common.inl * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -782,6 +782,9 @@ { // TODO: NOT IMPLEMENTED UNIMPLEMENTED; + + Fast486Exception(State, FAST486_EXCEPTION_UD); + return FALSE; } default: Modified: trunk/reactos/lib/fast486/debug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/debug.c?rev=67…
============================================================================== --- trunk/reactos/lib/fast486/debug.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/debug.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * fast486dbg.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/extraops.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.c?rev…
============================================================================== --- trunk/reactos/lib/fast486/extraops.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/extraops.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * extraops.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/extraops.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/extraops.h?rev…
============================================================================== --- trunk/reactos/lib/fast486/extraops.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/extraops.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * extraops.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/fast486.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fast486.c?rev=…
============================================================================== --- trunk/reactos/lib/fast486/fast486.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fast486.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * fast486.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/fpu.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.c?rev=6752…
============================================================================== --- trunk/reactos/lib/fast486/fpu.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fpu.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * fpu.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/fpu.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.h?rev=6752…
============================================================================== --- trunk/reactos/lib/fast486/fpu.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fpu.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * fpu.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/opcodes.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=…
============================================================================== --- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * opcodes.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/opcodes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.h?rev=…
============================================================================== --- trunk/reactos/lib/fast486/opcodes.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opcodes.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * opcodes.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/opgroups.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.c?rev…
============================================================================== --- trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opgroups.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * opgroups.c * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/lib/fast486/opgroups.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opgroups.h?rev…
============================================================================== --- trunk/reactos/lib/fast486/opgroups.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opgroups.h [iso-8859-1] Sun May 3 01:45:57 2015 @@ -2,7 +2,7 @@ * Fast486 386/486 CPU Emulation Library * opgroups.h * - * Copyright (C) 2014 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> + * Copyright (C) 2015 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
============================================================================== --- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/dosfiles.c [iso-8859-1] Sun May 3 01:45:57 2015 @@ -146,6 +146,7 @@ { WORD LastError; HANDLE FileHandle; + PDOS_DEVICE_NODE Node; WORD DosHandle; ACCESS_MASK AccessMode = 0; DWORD ShareMode = 0; @@ -163,185 +164,193 @@ // explains what those AccessShareModes are (see the uStyle flag). // - /* Parse the access mode */ - switch (AccessShareModes & 0x03) - { - /* Read-only */ - case 0: - AccessMode = GENERIC_READ; - break; - - /* Write only */ - case 1: - AccessMode = GENERIC_WRITE; - break; - - /* Read and write */ - case 2: - AccessMode = GENERIC_READ | GENERIC_WRITE; - break; - - /* Invalid */ - default: - return ERROR_INVALID_PARAMETER; - } - - /* Parse the share mode */ - switch ((AccessShareModes >> 4) & 0x07) - { - /* Compatibility mode */ - case 0: - ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; - break; - - /* No sharing "DenyAll" */ - case 1: - ShareMode = 0; - break; - - /* No write share "DenyWrite" */ - case 2: - ShareMode = FILE_SHARE_READ; - break; - - /* No read share "DenyRead" */ - case 3: - ShareMode = FILE_SHARE_WRITE; - break; - - /* Full share "DenyNone" */ - case 4: - ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; - break; - - /* Invalid */ - default: - return ERROR_INVALID_PARAMETER; - } - - /* - * Parse the creation action flags: - * - * Bitfields for action: - * Bit(s) Description - * - * 7-4 Action if file does not exist. - * 0000 Fail - * 0001 Create - * - * 3-0 Action if file exists. - * 0000 Fail - * 0001 Open - * 0010 Replace/open - */ - switch (CreateActionFlags) - { - /* If the file exists, fail, otherwise, fail also */ - case 0x00: - // A special case is used after the call to CreateFileA if it succeeds, - // in order to close the opened handle and return an adequate error. - CreationDisposition = OPEN_EXISTING; - break; - - /* If the file exists, open it, otherwise, fail */ - case 0x01: - CreationDisposition = OPEN_EXISTING; - break; - - /* If the file exists, replace it, otherwise, fail */ - case 0x02: - CreationDisposition = TRUNCATE_EXISTING; - break; - - /* If the file exists, fail, otherwise, create it */ - case 0x10: - CreationDisposition = CREATE_NEW; - break; - - /* If the file exists, open it, otherwise, create it */ - case 0x11: - CreationDisposition = OPEN_ALWAYS; - break; - - /* If the file exists, replace it, otherwise, create it */ - case 0x12: - CreationDisposition = CREATE_ALWAYS; - break; - - /* Invalid */ - default: - return ERROR_INVALID_PARAMETER; - } - - /* Check for inheritance */ - InheritableFile = ((AccessShareModes & 0x80) == 0); - - /* Assign default security attributes to the file, and set the inheritance flag */ - SecurityAttributes.nLength = sizeof(SecurityAttributes); - SecurityAttributes.lpSecurityDescriptor = NULL; - SecurityAttributes.bInheritHandle = InheritableFile; - - /* Open the file */ - FileHandle = CreateFileA(FilePath, - AccessMode, - ShareMode, - &SecurityAttributes, - CreationDisposition, - Attributes, - NULL); - - LastError = (WORD)GetLastError(); - - if (FileHandle == INVALID_HANDLE_VALUE) - { - /* Return the error code */ - return LastError; - } - - /* - * Special case: CreateActionFlags == 0, we must fail because - * the file exists (if it didn't exist we already failed). - */ - if (CreateActionFlags == 0) - { - /* Close the file and return the error code */ - CloseHandle(FileHandle); - return ERROR_FILE_EXISTS; - } - - /* Set the creation status */ - switch (CreateActionFlags) - { - case 0x01: - *CreationStatus = 0x01; // The file was opened - break; - - case 0x02: - *CreationStatus = 0x03; // The file was replaced - break; - - case 0x10: - *CreationStatus = 0x02; // The file was created - break; - - case 0x11: - { - if (LastError == ERROR_ALREADY_EXISTS) + Node = DosGetDevice(FilePath); + if (Node != NULL) + { + if (Node->OpenRoutine) Node->OpenRoutine(Node); + } + else + { + /* Parse the access mode */ + switch (AccessShareModes & 0x03) + { + /* Read-only */ + case 0: + AccessMode = GENERIC_READ; + break; + + /* Write only */ + case 1: + AccessMode = GENERIC_WRITE; + break; + + /* Read and write */ + case 2: + AccessMode = GENERIC_READ | GENERIC_WRITE; + break; + + /* Invalid */ + default: + return ERROR_INVALID_PARAMETER; + } + + /* Parse the share mode */ + switch ((AccessShareModes >> 4) & 0x07) + { + /* Compatibility mode */ + case 0: + ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE; + break; + + /* No sharing "DenyAll" */ + case 1: + ShareMode = 0; + break; + + /* No write share "DenyWrite" */ + case 2: + ShareMode = FILE_SHARE_READ; + break; + + /* No read share "DenyRead" */ + case 3: + ShareMode = FILE_SHARE_WRITE; + break; + + /* Full share "DenyNone" */ + case 4: + ShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE; + break; + + /* Invalid */ + default: + return ERROR_INVALID_PARAMETER; + } + + /* + * Parse the creation action flags: + * + * Bitfields for action: + * Bit(s) Description + * + * 7-4 Action if file does not exist. + * 0000 Fail + * 0001 Create + * + * 3-0 Action if file exists. + * 0000 Fail + * 0001 Open + * 0010 Replace/open + */ + switch (CreateActionFlags) + { + /* If the file exists, fail, otherwise, fail also */ + case 0x00: + // A special case is used after the call to CreateFileA if it succeeds, + // in order to close the opened handle and return an adequate error. + CreationDisposition = OPEN_EXISTING; + break; + + /* If the file exists, open it, otherwise, fail */ + case 0x01: + CreationDisposition = OPEN_EXISTING; + break; + + /* If the file exists, replace it, otherwise, fail */ + case 0x02: + CreationDisposition = TRUNCATE_EXISTING; + break; + + /* If the file exists, fail, otherwise, create it */ + case 0x10: + CreationDisposition = CREATE_NEW; + break; + + /* If the file exists, open it, otherwise, create it */ + case 0x11: + CreationDisposition = OPEN_ALWAYS; + break; + + /* If the file exists, replace it, otherwise, create it */ + case 0x12: + CreationDisposition = CREATE_ALWAYS; + break; + + /* Invalid */ + default: + return ERROR_INVALID_PARAMETER; + } + + /* Check for inheritance */ + InheritableFile = ((AccessShareModes & 0x80) == 0); + + /* Assign default security attributes to the file, and set the inheritance flag */ + SecurityAttributes.nLength = sizeof(SecurityAttributes); + SecurityAttributes.lpSecurityDescriptor = NULL; + SecurityAttributes.bInheritHandle = InheritableFile; + + /* Open the file */ + FileHandle = CreateFileA(FilePath, + AccessMode, + ShareMode, + &SecurityAttributes, + CreationDisposition, + Attributes, + NULL); + + LastError = (WORD)GetLastError(); + + if (FileHandle == INVALID_HANDLE_VALUE) + { + /* Return the error code */ + return LastError; + } + + /* + * Special case: CreateActionFlags == 0, we must fail because + * the file exists (if it didn't exist we already failed). + */ + if (CreateActionFlags == 0) + { + /* Close the file and return the error code */ + CloseHandle(FileHandle); + return ERROR_FILE_EXISTS; + } + + /* Set the creation status */ + switch (CreateActionFlags) + { + case 0x01: *CreationStatus = 0x01; // The file was opened - else + break; + + case 0x02: + *CreationStatus = 0x03; // The file was replaced + break; + + case 0x10: *CreationStatus = 0x02; // The file was created - - break; - } - - case 0x12: - { - if (LastError == ERROR_ALREADY_EXISTS) - *CreationStatus = 0x03; // The file was replaced - else - *CreationStatus = 0x02; // The file was created - - break; + break; + + case 0x11: + { + if (LastError == ERROR_ALREADY_EXISTS) + *CreationStatus = 0x01; // The file was opened + else + *CreationStatus = 0x02; // The file was created + + break; + } + + case 0x12: + { + if (LastError == ERROR_ALREADY_EXISTS) + *CreationStatus = 0x03; // The file was replaced + else + *CreationStatus = 0x02; // The file was created + + break; + } } } @@ -357,11 +366,19 @@ Descriptor = DosGetFileDescriptor(DescriptorId); RtlZeroMemory(Descriptor, sizeof(*Descriptor)); - Descriptor->OpenMode = AccessShareModes; - Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); - Descriptor->Size = GetFileSize(FileHandle, NULL); - Descriptor->OwnerPsp = CurrentPsp; - Descriptor->Win32Handle = FileHandle; + if (Node != NULL) + { + Descriptor->DevicePointer = Node->Driver; + Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + } + else + { + Descriptor->OpenMode = AccessShareModes; + Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); + Descriptor->Size = GetFileSize(FileHandle, NULL); + Descriptor->OwnerPsp = CurrentPsp; + Descriptor->Win32Handle = FileHandle; + } /* Open the DOS handle */ DosHandle = DosOpenHandle(DescriptorId); @@ -383,6 +400,7 @@ WORD Attributes) { HANDLE FileHandle; + PDOS_DEVICE_NODE Node; WORD DosHandle; BYTE DescriptorId; PDOS_FILE_DESCRIPTOR Descriptor; @@ -390,18 +408,26 @@ DPRINT("DosCreateFile: FilePath \"%s\", CreationDisposition 0x%04X, Attributes 0x%04X\n", FilePath, CreationDisposition, Attributes); - /* Create the file */ - FileHandle = CreateFileA(FilePath, - GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, - NULL, - CreationDisposition, - Attributes, - NULL); - if (FileHandle == INVALID_HANDLE_VALUE) - { - /* Return the error code */ - return (WORD)GetLastError(); + Node = DosGetDevice(FilePath); + if (Node != NULL) + { + if (Node->OpenRoutine) Node->OpenRoutine(Node); + } + else + { + /* Create the file */ + FileHandle = CreateFileA(FilePath, + GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + CreationDisposition, + Attributes, + NULL); + if (FileHandle == INVALID_HANDLE_VALUE) + { + /* Return the error code */ + return (WORD)GetLastError(); + } } DescriptorId = DosFindFreeDescriptor(); @@ -416,10 +442,18 @@ Descriptor = DosGetFileDescriptor(DescriptorId); RtlZeroMemory(Descriptor, sizeof(*Descriptor)); - Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); - Descriptor->Size = GetFileSize(FileHandle, NULL); - Descriptor->OwnerPsp = CurrentPsp; - Descriptor->Win32Handle = FileHandle; + if (Node != NULL) + { + Descriptor->DevicePointer = Node->Driver; + Descriptor->DeviceInfo = Node->DeviceAttributes | (1 << 7); + } + else + { + Descriptor->Attributes = LOBYTE(GetFileAttributesA(FilePath)); + Descriptor->Size = GetFileSize(FileHandle, NULL); + Descriptor->OwnerPsp = CurrentPsp; + Descriptor->Win32Handle = FileHandle; + } /* Open the DOS handle */ DosHandle = DosOpenHandle(DescriptorId);
9 years, 7 months
1
0
0
0
[tkreuzer] 67525: [NDK] Add a few definitions based on (Windows RT 8.1) symbol files, ks386.inc, ksamd64.inc, ksarm.inc and Windows 10 WDK (ntosp.h ftw!)
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Sat May 2 23:12:19 2015 New Revision: 67525 URL:
http://svn.reactos.org/svn/reactos?rev=67525&view=rev
Log: [NDK] Add a few definitions based on (Windows RT 8.1) symbol files, ks386.inc, ksamd64.inc, ksarm.inc and Windows 10 WDK (ntosp.h ftw!) Modified: trunk/reactos/include/ndk/amd64/asm.h trunk/reactos/include/ndk/amd64/ketypes.h trunk/reactos/include/ndk/arm/ketypes.h trunk/reactos/include/ndk/i386/asm.h trunk/reactos/include/ndk/i386/ketypes.h trunk/reactos/include/ndk/ketypes.h trunk/reactos/include/ndk/rtltypes.h trunk/reactos/ntoskrnl/kd64/kddata.c trunk/reactos/ntoskrnl/ke/amd64/thrdini.c Modified: trunk/reactos/include/ndk/amd64/asm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/asm.h?re…
============================================================================== --- trunk/reactos/include/ndk/amd64/asm.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/amd64/asm.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -33,12 +33,6 @@ // #define KernelMode HEX(0) #define UserMode HEX(1) - -// -// CPU Types -// -#define CPU_INTEL HEX(1) -#define CPU_AMD HEX(2) // // KTSS Offsets Modified: trunk/reactos/include/ndk/amd64/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/ketypes.…
============================================================================== --- trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -34,6 +34,17 @@ //#undef KeGetPcr //#define KeGetPcr() ((volatile KPCR * const)__readfsdword(0x1C)) //#endif + +// +// CPU Vendors +// +typedef enum +{ + CPU_UNKNOWN, + CPU_AMD, + CPU_INTEL, + CPU_VIA +} CPU_VENDORS; // // Machine Types @@ -65,7 +76,7 @@ #define KGDT64_R3_CODE 0x0030 #define KGDT64_SYS_TSS 0x0040 #define KGDT64_R3_CMTEB 0x0050 - +#define KGDT64_R0_LDT 0x0060 // // CR4 @@ -81,6 +92,30 @@ #define CR4_FXSR 0x200 #define CR4_XMMEXCPT 0x400 #define CR4_CHANNELS 0x800 +#define CR4_XSAVE 0x40000 + +// +// DR7 +// +#define DR7_LEGAL 0xFFFF0355 +#define DR7_ACTIVE 0x00000355 +#define DR7_TRACE_BRANCH 0x00000200 +#define DR7_LAST_BRANCH 0x00000100 + +// +// Debug flags +// +#define DEBUG_ACTIVE_DR7 0x0001 +#define DEBUG_ACTIVE_INSTRUMENTED 0x0002 +#define DEBUG_ACTIVE_DBG_INSTRUMENTED 0x0003 +#define DEBUG_ACTIVE_MINIMAL_THREAD 0x0004 +#define DEBUG_ACTIVE_PRIMARY_THREAD 0x0080 +#define DEBUG_ACTIVE_PRIMARY_THREAD_BIT 0x0007 +#define DEBUG_ACTIVE_PRIMARY_THREAD_LOCK_BIT 0x001F +#define DEBUG_ACTIVE_SCHEDULED_THREAD 0x0040 +#define DEBUG_ACTIVE_SCHEDULED_THREAD_BIT 0x0006 +#define DEBUG_ACTIVE_SCHEDULED_THREAD_LOCK_BIT 0x001E +#define DEBUG_ACTIVE_SCHEDULED_THREAD_LOCK 0x40000000 // // EFlags @@ -105,24 +140,60 @@ #define EFLAGS_IF_SHIFT 0x0009 // +// MXCSR Floating Control/Status Bit Masks +// +#define XSW_INVALID_OPERATION 0x0001 +#define XSW_DENORMAL 0x0002 +#define XSW_ZERO_DIVIDE 0x0004 +#define XSW_OVERFLOW 0x0008 +#define XSW_UNDERFLOW 0x0010 +#define XSW_PRECISION 0x0020 +#define XCW_INVALID_OPERATION 0x0080 +#define XCW_DENORMAL 0x0100 +#define XCW_ZERO_DIVIDE 0x0200 +#define XCW_OVERFLOW 0x0400 +#define XCW_UNDERFLOW 0x0800 +#define XCW_PRECISION 0x1000 +#define XCW_ROUND_CONTROL 0x6000 +#define XCW_FLUSH_ZERO 0x8000 +#define XSW_ERROR_MASK 0x003F +#define XSW_ERROR_SHIFT 7 + +// +// Legacy floating status word bit masks. +// +#define FSW_INVALID_OPERATION 0x0001 +#define FSW_DENORMAL 0x0002 +#define FSW_ZERO_DIVIDE 0x0004 +#define FSW_OVERFLOW 0x0008 +#define FSW_UNDERFLOW 0x0010 +#define FSW_PRECISION 0x0020 +#define FSW_STACK_FAULT 0x0040 +#define FSW_ERROR_SUMMARY 0x0080 +#define FSW_CONDITION_CODE_0 0x0100 +#define FSW_CONDITION_CODE_1 0x0200 +#define FSW_CONDITION_CODE_2 0x0400 +#define FSW_CONDITION_CODE_3 0x4000 +#define FSW_ERROR_MASK 0x003F + +// // Machine Specific Registers // +#define MSR_EFER 0xC0000080 +#define MSR_STAR 0xC0000081 +#define MSR_LSTAR 0xC0000082 +#define MSR_CSTAR 0xC0000083 +#define MSR_SYSCALL_MASK 0xC0000084 +#define MSR_FS_BASE 0xC0000100 +#define MSR_GS_BASE 0xC0000101 +#define MSR_GS_SWAP 0xC0000102 #define MSR_MCG_STATUS 0x017A -#define MSR_DEGUG_CTL 0x01D9 +#define MSR_AMD_ACCESS 0x9C5A203A +#define MSR_IA32_MISC_ENABLE 0x01A0 #define MSR_LAST_BRANCH_FROM 0x01DB #define MSR_LAST_BRANCH_TO 0x01DC #define MSR_LAST_EXCEPTION_FROM 0x01DD #define MSR_LAST_EXCEPTION_TO 0x01DE -#define MSR_PAT 0x0277 -#define MSR_AMD_ACCESS 0x9C5A203A -#define MSR_EFER 0xC0000080 -#define MSR_STAR 0xC0000081 -#define MSR_LSTAR 0xC0000082 -#define MSR_CSTAR 0xC0000083 -#define MSR_SYSCALL_MASK 0xC0000084 -#define MSR_FS_BASE 0xC0000100 -#define MSR_GS_BASE 0xC0000101 -#define MSR_GS_SWAP 0xC0000102 // // Caching values for the PAT MSR @@ -137,10 +208,23 @@ // // Flags in MSR_EFER // +#define MSR_SCE 0x0001 +#define MSR_LME 0x0100 #define MSR_LMA 0x0400 -#define MSR_LME 0x0100 -#define MSR_SCE 0x0001 #define MSR_NXE 0x0800 +#define MSR_PAT 0x0277 +#define MSR_DEBUG_CTL 0x01D9 + +// +// Flags in MSR_IA32_MISC_ENABLE +// +#define MSR_XD_ENABLE_MASK 0xFFFFFFFB + +// +// Flags in MSR_DEBUG_CTL +// +#define MSR_DEBUG_CTL_LBR equ 0x0001 +#define MSR_DEBUG_CTL_BTF equ 0x0002 // // IPI Types @@ -157,6 +241,13 @@ #define PRCB_MAJOR_VERSION 1 #define PRCB_BUILD_DEBUG 1 #define PRCB_BUILD_UNIPROCESSOR 2 + +// +// Exception active flags +// +#define KEXCEPTION_ACTIVE_INTERRUPT_FRAME 0x0000 +#define KEXCEPTION_ACTIVE_EXCEPTION_FRAME 0x0001 +#define KEXCEPTION_ACTIVE_SERVICE_FRAME 0x0002 // // HAL Variables @@ -188,11 +279,27 @@ #define SYNCH_LEVEL 12 #define NMI_STACK_SIZE 0x2000 +#define ISR_STACK_SIZE 0x6000 // // Number of pool lookaside lists per pool in the PRCB // #define NUMBER_POOL_LOOKASIDE_LISTS 32 + +// +// Structure for CPUID +// +typedef union _CPU_INFO +{ + UINT32 AsUINT32[4]; + struct + { + ULONG Eax; + ULONG Ebx; + ULONG Ecx; + ULONG Edx; + }; +} CPU_INFO, *PCPU_INFO; // // Trap Frame Definition @@ -284,23 +391,6 @@ } KTRAP_FRAME, *PKTRAP_FRAME; // -// Defines the Callback Stack Layout for User Mode Callbacks -// -typedef struct _KCALLOUT_FRAME -{ - ULONG64 InitialStack; - ULONG64 TrapFrame; - ULONG64 CallbackStack; - ULONG64 Rdi; - ULONG64 Rsi; - ULONG64 Rbx; - ULONG64 Rbp; - ULONG64 ReturnAddress; - ULONG64 Result; - ULONG64 ResultLength; -} KCALLOUT_FRAME, *PKCALLOUT_FRAME; - -// // Dummy LDT_ENTRY // #ifndef _LDT_ENTRY_DEFINED @@ -404,33 +494,33 @@ // typedef struct _KSPECIAL_REGISTERS { - UINT64 Cr0; - UINT64 Cr2; - UINT64 Cr3; - UINT64 Cr4; - UINT64 KernelDr0; - UINT64 KernelDr1; - UINT64 KernelDr2; - UINT64 KernelDr3; - UINT64 KernelDr6; - UINT64 KernelDr7; - struct _KDESCRIPTOR Gdtr; - struct _KDESCRIPTOR Idtr; + ULONG64 Cr0; + ULONG64 Cr2; + ULONG64 Cr3; + ULONG64 Cr4; + ULONG64 KernelDr0; + ULONG64 KernelDr1; + ULONG64 KernelDr2; + ULONG64 KernelDr3; + ULONG64 KernelDr6; + ULONG64 KernelDr7; + KDESCRIPTOR Gdtr; + KDESCRIPTOR Idtr; USHORT Tr; USHORT Ldtr; ULONG MxCsr; - UINT64 DebugControl; - UINT64 LastBranchToRip; - UINT64 LastBranchFromRip; - UINT64 LastExceptionToRip; - UINT64 LastExceptionFromRip; - UINT64 Cr8; - UINT64 MsrGsBase; - UINT64 MsrGsSwap; - UINT64 MsrStar; - UINT64 MsrLStar; - UINT64 MsrCStar; - UINT64 MsrSyscallMask; + ULONG64 DebugControl; + ULONG64 LastBranchToRip; + ULONG64 LastBranchFromRip; + ULONG64 LastExceptionToRip; + ULONG64 LastExceptionFromRip; + ULONG64 Cr8; + ULONG64 MsrGsBase; + ULONG64 MsrGsSwap; + ULONG64 MsrStar; + ULONG64 MsrLStar; + ULONG64 MsrCStar; + ULONG64 MsrSyscallMask; } KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS; // @@ -756,8 +846,7 @@ CACHE_DESCRIPTOR Cache[5]; ULONG CacheCount; #endif -} - KPRCB, *PKPRCB; +} KPRCB, *PKPRCB; // // Processor Control Region @@ -837,12 +926,12 @@ // typedef struct _KEXCEPTION_FRAME { - UINT64 P1Home; - UINT64 P2Home; - UINT64 P3Home; - UINT64 P4Home; - UINT64 P5; - UINT64 InitialStack; + ULONG64 P1Home; + ULONG64 P2Home; + ULONG64 P3Home; + ULONG64 P4Home; + ULONG64 P5; + ULONG64 Spare1; M128A Xmm6; M128A Xmm7; M128A Xmm8; @@ -853,21 +942,54 @@ M128A Xmm13; M128A Xmm14; M128A Xmm15; - UINT64 TrapFrame; - UINT64 CallbackStack; - UINT64 OutputBuffer; - UINT64 OutputLength; - UINT64 MxCsr; - UINT64 Rbp; - UINT64 Rbx; - UINT64 Rdi; - UINT64 Rsi; - UINT64 R12; - UINT64 R13; - UINT64 R14; - UINT64 R15; - UINT64 Return; + ULONG64 TrapFrame; + //ULONG64 CallbackStack; + ULONG64 OutputBuffer; + ULONG64 OutputLength; + ULONG64 Spare2; + ULONG64 MxCsr; + ULONG64 Rbp; + ULONG64 Rbx; + ULONG64 Rdi; + ULONG64 Rsi; + ULONG64 R12; + ULONG64 R13; + ULONG64 R14; + ULONG64 R15; + ULONG64 Return; } KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; + +typedef struct _MACHINE_FRAME +{ + ULONG64 Rip; + USHORT SegCs; + USHORT Fill1[3]; + ULONG EFlags; + ULONG Fill2; + ULONG64 Rsp; + USHORT SegSs; + USHORT Fill3[3]; +} MACHINE_FRAME, *PMACHINE_FRAME; + +// +// Defines the Callback Stack Layout for User Mode Callbacks +// +typedef KEXCEPTION_FRAME KCALLOUT_FRAME, PKCALLOUT_FRAME; + +// +// User side callout frame +// +typedef struct _UCALLOUT_FRAME +{ + ULONG64 P1Home; + ULONG64 P2Home; + ULONG64 P3Home; + ULONG64 P4Home; + PVOID Buffer; + ULONG Length; + ULONG ApiNumber; + MACHINE_FRAME MachineFrame; +} UCALLOUT_FRAME, *PUCALLOUT_FRAME; // size = 0x0058 typedef struct _DISPATCHER_CONTEXT { @@ -883,29 +1005,48 @@ ULONG ScopeIndex; } DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; - typedef struct _KSTART_FRAME +{ + ULONG64 P1Home; + ULONG64 P2Home; + ULONG64 P3Home; + ULONG64 P4Home; + ULONG64 Reserved; + ULONG64 Return; +} KSTART_FRAME, *PKSTART_FRAME; + +typedef struct _KSWITCH_FRAME { ULONG64 P1Home; ULONG64 P2Home; ULONG64 P3Home; ULONG64 P4Home; ULONG64 P5Home; - ULONG64 Return; -} KSTART_FRAME, *PKSTART_FRAME; - -typedef struct _KSWITCH_FRAME -{ - ULONG64 P1Home; - ULONG64 P2Home; - ULONG64 P3Home; - ULONG64 P4Home; - ULONG64 P5Home; - ULONG64 ApcBypass; + KIRQL ApcBypass; + UCHAR Fill1[7]; ULONG64 Rbp; ULONG64 Return; } KSWITCH_FRAME, *PKSWITCH_FRAME; +#define PROCESSOR_START_FLAG_FORCE_ENABLE_NX 0x0001 +typedef struct _KPROCESSOR_START_BLOCK +{ + ULONG CompletionFlag; // 0x0004 + ULONG Flags; // 0x0008 + ULONG Gdt32; // 0x000C + ULONG Idt32; // 0x0012 + PVOID Gdt; // 0x0018 + // ??? + ULONG64 TiledMemoryMap; // 0x0058 + UCHAR PmTarget[6]; // 0x0060 + UCHAR LmIdentityTarget[6]; // 0x0066 + ULONG64 LmTarget; // 0x0070 + struct _KPROCESSOR_START_BLOCK *SelfMap; // 0x0078 + ULONG64 MsrPat; // 0x0080 + ULONG64 MsrEFER; // 0x0088 + KPROCESSOR_STATE ProcessorState; // 0x0090 +} KPROCESSOR_START_BLOCK, *PKPROCESSOR_START_BLOCK; // size 00640 + // // Inline function to get current KPRCB // Modified: trunk/reactos/include/ndk/arm/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/ketypes.h?…
============================================================================== --- trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -13,6 +13,7 @@ Author: Alex Ionescu (alexi(a)tinykrnl.org) - Updated - 27-Feb-2006 + Timo Kreuzer (timo.kreuzer(a)reactos.org) - Updated 19-Apr-2015 --*/ @@ -27,19 +28,85 @@ // Dependencies // + +#define SYNCH_LEVEL DISPATCH_LEVEL + // // CPSR Values // -#define CPSR_THUMB_ENABLE 0x20 -#define CPSR_FIQ_DISABLE 0x40 -#define CPSR_IRQ_DISABLE 0x80 -#define CPSR_USER_MODE 0x10 -#define CPSR_FIQ_MODE 0x11 -#define CPSR_IRQ_MODE 0x12 -#define CPSR_SVC_MODE 0x13 -#define CPSR_ABORT_MODE 0x17 -#define CPSR_UND_MODE 0x1B -#define CPSR_MODES 0x1F +#define CPSRM_USER 0x10 +#define CPSRM_FIQ 0x11 +#define CPSRM_INT 0x12 +#define CPSRM_SVC 0x13 +#define CPSRM_ABT 0x17 +#define CPSRM_UDF 0x1b +#define CPSRM_SYS 0x1f +#define CPSRM_MASK 0x1f +#define SYSCALL_PSR 0x30 + +#define CPSRF_N 0x80000000 +#define CPSRF_Z 0x40000000 +#define CPSRF_C 0x20000000 +#define CPSRF_V 0x10000000 +#define CPSRF_Q 0x08000000 +#define CPSR_IT_MASK 0x600fc00 + +#define FPSCRF_N 0x80000000 +#define FPSCRF_Z 0x40000000 +#define FPSCRF_C 0x20000000 +#define FPSCRF_V 0x10000000 +#define FPSCRF_QC 0x08000000 + +#define FPSCRM_AHP 0x4000000 +#define FPSCRM_DN 0x2000000 +#define FPSCRM_FZ 0x1000000 +#define FPSCRM_RMODE_MASK 0xc00000 +#define FPSCRM_RMODE_RN 0x0 +#define FPSCRM_RMODE_RP 0x400000 +#define FPSCRM_RMODE_RM 0x800000 +#define FPSCRM_RMODE_RZ 0xc00000 +#define FPSCRM_DEPRECATED 0x370000 + +#define FPSCR_IDE 0x8000 +#define FPSCR_IXE 0x1000 +#define FPSCR_UFE 0x800 +#define FPSCR_OFE 0x400 +#define FPSCR_DZE 0x200 +#define FPSCR_IOE 0x100 +#define FPSCR_IDC 0x80 +#define FPSCR_IXC 0x10 +#define FPSCR_UFC 0x8 +#define FPSCR_OFC 0x4 +#define FPSCR_DZC 0x2 +#define FPSCR_IOC 0x1 + +#define CPSRC_INT 0x80 +#define CPSRC_ABORT 0x100 +#define CPSRC_THUMB 0x20 + +#define SWFS_PAGE_FAULT 0x10 +#define SWFS_ALIGN_FAULT 0x20 +#define SWFS_HWERR_FAULT 0x40 +#define SWFS_DEBUG_FAULT 0x80 +#define SWFS_EXECUTE 0x8 +#define SWFS_WRITE 0x1 + +#define CP14_DBGDSCR_MOE_MASK 0x3c +#define CP14_DBGDSCR_MOE_SHIFT 0x2 +#define CP14_DBGDSCR_MOE_HALT 0x0 +#define CP14_DBGDSCR_MOE_BP 0x1 +#define CP14_DBGDSCR_MOE_WPASYNC 0x2 +#define CP14_DBGDSCR_MOE_BKPT 0x3 +#define CP14_DBGDSCR_MOE_EXTERNAL 0x4 +#define CP14_DBGDSCR_MOE_VECTOR 0x5 +#define CP14_DBGDSCR_MOE_WPSYNC 0xa + +#define CP15_PMCR_DP 0x20 +#define CP15_PMCR_X 0x10 +#define CP15_PMCR_CLKCNT_DIV 0x8 +#define CP15_PMCR_CLKCNT_RST 0x4 +#define CP15_PMCR_CNT_RST 0x2 +#define CP15_PMCR_ENABLE 0x1 // // C1 Register Values @@ -56,7 +123,7 @@ #define IPI_APC 1 #define IPI_DPC 2 #define IPI_FREEZE 4 -#define IPI_PACKET_READY 8 +#define IPI_PACKET_READY 6 #define IPI_SYNCH_REQUEST 16 // @@ -87,69 +154,117 @@ #define NUMBER_POOL_LOOKASIDE_LISTS 32 // +// ARM VFP State +// Based on Windows RT 8.1 symbols and ksarm.h +// +typedef struct _KARM_VFP_STATE +{ + struct _KARM_VFP_STATE* Link; // 0x00 + ULONG Fpscr; // 0x04 + ULONG Reserved; // 0x08 + ULONG Reserved2; // 0x0c + ULONGLONG VfpD[32]; // 0x10 +} KARM_VFP_STATE, *PKARM_VFP_STATE; // size = 0x110 + +// // Trap Frame Definition +// Based on Windows RT 8.1 symbols and ksarm.h // typedef struct _KTRAP_FRAME { - ULONG DbgArgMark; + ULONG Arg3; + ULONG FaultStatus; + union + { + ULONG FaultAddress; + ULONG TrapFrame; + }; + ULONG Reserved; + BOOLEAN ExceptionActive; + BOOLEAN ContextFromKFramesUnwound; + BOOLEAN DebugRegistersValid; + union + { + CHAR PreviousMode; + KIRQL PreviousIrql; + }; + PKARM_VFP_STATE VfpState; + ULONG Bvr[8]; + ULONG Bcr[8]; + ULONG Wvr[1]; + ULONG Wcr[1]; ULONG R0; ULONG R1; ULONG R2; ULONG R3; - ULONG R4; - ULONG R5; - ULONG R6; - ULONG R7; - ULONG R8; - ULONG R9; - ULONG R10; + ULONG R12; + ULONG Sp; + ULONG Lr; ULONG R11; - ULONG R12; - ULONG UserSp; - ULONG UserLr; - ULONG SvcSp; - ULONG SvcLr; ULONG Pc; - ULONG Spsr; - ULONG OldIrql; - ULONG PreviousMode; - ULONG PreviousTrapFrame; + ULONG Cpsr; } KTRAP_FRAME, *PKTRAP_FRAME; -// -// Defines the Callback Stack Layout for User Mode Callbacks -// -// Just a stub with some required members for now -// -typedef struct _KCALLOUT_FRAME -{ - ULONG CallbackStack; - ULONG DummyFramePointer; -} KCALLOUT_FRAME, *PKCALLOUT_FRAME; - #ifndef NTOS_MODE_USER // // Exception Frame Definition +// FIXME: this should go into ntddk.h // typedef struct _KEXCEPTION_FRAME { - // ULONG R0; -// ULONG R1; -// ULONG R2; -// ULONG R3; - ULONG R4; - ULONG R5; - ULONG R6; - ULONG R7; - ULONG R8; - ULONG R9; - ULONG R10; - ULONG R11; -// ULONG R12; - ULONG Lr; - ULONG Psr; -} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; + ULONG Param5; // 0x00 + ULONG TrapFrame; // 0x04 + ULONG OutputBuffer; // 0x08 + ULONG OutputLength; // 0x0c + ULONG Pad; // 0x04 + ULONG R4; // 0x14 + ULONG R5; // 0x18 + ULONG R6; // 0x1c + ULONG R7; // 0x20 + ULONG R8; // 0x24 + ULONG R9; // 0x28 + ULONG R10; // 0x2c + ULONG R11; // 0x30 + ULONG Return; // 0x34 +} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; // size = 0x38 + +// +// ARM Architecture State +// Based on Windows RT 8.1 symbols and ksarm.h +// +typedef struct _KARM_ARCH_STATE +{ + ULONG Cp15_Cr0_CpuId; + ULONG Cp15_Cr1_Control; + ULONG Cp15_Cr1_AuxControl; + ULONG Cp15_Cr1_Cpacr; + ULONG Cp15_Cr2_TtbControl; + ULONG Cp15_Cr2_Ttb0; + ULONG Cp15_Cr2_Ttb1; + ULONG Cp15_Cr3_Dacr; + ULONG Cp15_Cr5_Dfsr; + ULONG Cp15_Cr5_Ifsr; + ULONG Cp15_Cr6_Dfar; + ULONG Cp15_Cr6_Ifar; + ULONG Cp15_Cr9_PmControl; + ULONG Cp15_Cr9_PmCountEnableSet; + ULONG Cp15_Cr9_PmCycleCounter; + ULONG Cp15_Cr9_PmEventCounter[31]; + ULONG Cp15_Cr9_PmEventType[31]; + ULONG Cp15_Cr9_PmInterruptSelect; + ULONG Cp15_Cr9_PmOverflowStatus; + ULONG Cp15_Cr9_PmSelect; + ULONG Cp15_Cr9_PmUserEnable; + ULONG Cp15_Cr10_PrimaryMemoryRemap; + ULONG Cp15_Cr10_NormalMemoryRemap; + ULONG Cp15_Cr12_VBARns; + ULONG Cp15_Cr13_ContextId; +} KARM_ARCH_STATE, *PKARM_ARCH_STATE; + +/// +/// "Custom" definition start +/// // // ARM Internal Registers @@ -314,164 +429,442 @@ Domain15 } ARM_DOMAINS; +/// +/// "Custom" definition end +/// + // // Special Registers Structure (outside of CONTEXT) +// Based on Windows RT 8.1 symbols and ksarm.h // typedef struct _KSPECIAL_REGISTERS { - ARM_CONTROL_REGISTER ControlRegister; - ARM_LOCKDOWN_REGISTER LockdownRegister; - ARM_CACHE_REGISTER CacheRegister; - ARM_STATUS_REGISTER StatusRegister; + ULONG Reserved[7]; // 0x00 + ULONG Cp15_Cr13_UsrRW; // 0x1c + ULONG Cp15_Cr13_UsrRO; // 0x20 + ULONG Cp15_Cr13_SvcRW; // 0x24 + ULONG KernelBvr[8]; // 0x28 + ULONG KernelBcr[8]; // 0x48 + ULONG KernelWvr[1]; // 0x68 + ULONG KernelWcr[1]; // 0x6c + ULONG Fpexc; // 0x70 + ULONG Fpinst; // 0x74 + ULONG Fpinst2; // 0x78 + ULONG UserSp; // 0x7c + ULONG UserLr; // 0x80 + ULONG AbortSp; // 0x84 + ULONG AbortLr; // 0x88 + ULONG AbortSpsr; // 0x8c + ULONG UdfSp; // 0x90 + ULONG UdfLr; // 0x94 + ULONG UdfSpsr; // 0x98 + ULONG IrqSp; // 0x9c + ULONG IrqLr; // 0xa0 + ULONG IrqSpsr; // 0xa4 } KSPECIAL_REGISTERS, *PKSPECIAL_REGISTERS; // // Processor State +// Based on Windows RT 8.1 symbols and ksarm.h // typedef struct _KPROCESSOR_STATE { - struct _CONTEXT ContextFrame; - struct _KSPECIAL_REGISTERS SpecialRegisters; + KSPECIAL_REGISTERS SpecialRegisters; // 0x000 + KARM_ARCH_STATE ArchState; // 0x0a8 + CONTEXT ContextFrame; // 0x200 } KPROCESSOR_STATE, *PKPROCESSOR_STATE; +C_ASSERT(sizeof(KPROCESSOR_STATE) == 0x3a0); + +// +// ARM Mini Stack +// Based on Windows RT 8.1 symbols and ksarm.h +// +typedef struct _KARM_MINI_STACK +{ + ULONG Pc; + ULONG Cpsr; + ULONG R4; + ULONG R5; + ULONG R6; + ULONG R7; + ULONG Reserved[2]; +} KARM_MINI_STACK, *PKARM_MINI_STACK; // size = 0x20 + +typedef struct _DISPATCHER_CONTEXT +{ + ULONG ControlPc; // 0x0 + PVOID ImageBase; // 0x4 + PVOID FunctionEntry; // 0x8 + PVOID EstablisherFrame; // 0xc + ULONG TargetPc; // 0x10 + PVOID ContextRecord; // 0x14 + PVOID LanguageHandler; // 0x18 + PVOID HandlerData; // 0x1c + PVOID HistoryTable; // 0x20 + ULONG ScopeIndex; // 0x24 + ULONG ControlPcIsUnwound; // 0x28 + PVOID NonVolatileRegisters; // 0x2c + ULONG Reserved; // 0x30 +} DISPATCHER_CONTEXT, *PDISPATCHER_CONTEXT; + +// +// Machine Frame +// Based on ksarm.h +// +typedef struct _MACHINE_FRAME +{ + ULONG Sp; + ULONG Pc; +} MACHINE_FRAME, *PMACHINE_FRAME; + +// +// Defines the Callback Stack Layout for User Mode Callbacks +// +typedef KEXCEPTION_FRAME KCALLOUT_FRAME, PKCALLOUT_FRAME; + +// +// User mode callout frame +// +typedef struct _UCALLOUT_FRAME +{ + PVOID Buffer; + ULONG Length; + ULONG ApiNumber; + ULONG OriginalLr; + MACHINE_FRAME MachineFrame; +} UCALLOUT_FRAME, *PUCALLOUT_FRAME; + +typedef struct _KSTART_FRAME +{ + ULONG R0; + ULONG R1; + ULONG R2; + ULONG Return; +} KSTART_FRAME, *PKSTART_FRAME; + +typedef struct _KSWITCH_FRAME +{ + KIRQL ApcBypass; + UCHAR Fill[7]; + ULONG R11; + ULONG Return; +} KSWITCH_FRAME, *PKSWITCH_FRAME; + +// +// Cache types +// (These are made up constants!) +// +enum _ARM_CACHE_TYPES +{ + FirstLevelDcache = 0, + SecondLevelDcache = 1, + FirstLevelIcache = 2, + SecondLevelIcache = 3, + GlobalDcache = 4, + GlobalIcache = 5 +}; + +#if (NTDDI_VERSION < NTDDI_LONGHORN) +#define GENERAL_LOOKASIDE_POOL PP_LOOKASIDE_LIST +#endif // // Processor Region Control Block +// Based on Windows RT 8.1 symbols // typedef struct _KPRCB { + UCHAR LegacyNumber; + UCHAR ReservedMustBeZero; + UCHAR IdleHalt; + PKTHREAD CurrentThread; + PKTHREAD NextThread; + PKTHREAD IdleThread; + UCHAR NestingLevel; + UCHAR ClockOwner; + union + { + UCHAR PendingTickFlags; + struct + { + UCHAR PendingTick : 1; + UCHAR PendingBackupTick : 1; + }; + }; + UCHAR PrcbPad00[1]; + ULONG Number; + ULONG PrcbLock; + PCHAR PriorityState; + KPROCESSOR_STATE ProcessorState; + USHORT ProcessorModel; + USHORT ProcessorRevision; + ULONG MHz; + UINT64 CycleCounterFrequency; + ULONG HalReserved[15]; USHORT MinorVersion; USHORT MajorVersion; - struct _KTHREAD *CurrentThread; - struct _KTHREAD *NextThread; - struct _KTHREAD *IdleThread; - UCHAR Number; - UCHAR Reserved; - USHORT BuildType; - KAFFINITY SetMember; - UCHAR CpuType; - UCHAR CpuID; - USHORT CpuStep; - KPROCESSOR_STATE ProcessorState; - ULONG KernelReserved[16]; - ULONG HalReserved[16]; - UCHAR PrcbPad0[92]; - KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; - struct _KTHREAD *NpxThread; - ULONG InterruptCount; - ULONG KernelTime; - ULONG UserTime; - ULONG DpcTime; - ULONG DebugDpcTime; - ULONG InterruptTime; - ULONG AdjustDpcThreshold; - ULONG PageColor; - UCHAR SkipTick; - UCHAR DebuggerSavedIRQL; - UCHAR NodeColor; - UCHAR Spare1; - ULONG NodeShiftedColor; - struct _KNODE *ParentNode; - ULONG MultiThreadProcessorSet; - struct _KPRCB *MultiThreadSetMaster; - ULONG SecondaryColorMask; - LONG Sleeping; + UCHAR BuildType; + UCHAR CpuVendor; + UCHAR CoresPerPhysicalProcessor; + UCHAR LogicalProcessorsPerCore; + PVOID AcpiReserved; + ULONG GroupSetMember; + UCHAR Group; + UCHAR GroupIndex; + //UCHAR _PADDING1_[0x62]; + KSPIN_LOCK_QUEUE DECLSPEC_ALIGN(128) LockQueue[17]; + UCHAR ProcessorVendorString[2]; + UCHAR _PADDING2_[0x2]; + ULONG FeatureBits; + ULONG MaxBreakpoints; + ULONG MaxWatchpoints; + PCONTEXT Context; + ULONG ContextFlagsInit; + //UCHAR _PADDING3_[0x60]; + PP_LOOKASIDE_LIST DECLSPEC_ALIGN(128) PPLookasideList[16]; + LONG PacketBarrier; + SINGLE_LIST_ENTRY DeferredReadyListHead; + LONG MmPageFaultCount; + LONG MmCopyOnWriteCount; + LONG MmTransitionCount; + LONG MmDemandZeroCount; + LONG MmPageReadCount; + LONG MmPageReadIoCount; + LONG MmDirtyPagesWriteCount; + LONG MmDirtyWriteIoCount; + LONG MmMappedPagesWriteCount; + LONG MmMappedWriteIoCount; + ULONG KeSystemCalls; + ULONG KeContextSwitches; ULONG CcFastReadNoWait; ULONG CcFastReadWait; ULONG CcFastReadNotPossible; ULONG CcCopyReadNoWait; ULONG CcCopyReadWait; ULONG CcCopyReadNoWaitMiss; - ULONG KeAlignmentFixupCount; - ULONG SpareCounter0; - ULONG KeDcacheFlushCount; - ULONG KeExceptionDispatchCount; - ULONG KeFirstLevelTbFills; - ULONG KeFloatingEmulationCount; - ULONG KeIcacheFlushCount; - ULONG KeSecondLevelTbFills; - ULONG KeSystemCalls; - volatile ULONG IoReadOperationCount; - volatile ULONG IoWriteOperationCount; - volatile ULONG IoOtherOperationCount; + LONG LookasideIrpFloat; + LONG IoReadOperationCount; + LONG IoWriteOperationCount; + LONG IoOtherOperationCount; LARGE_INTEGER IoReadTransferCount; LARGE_INTEGER IoWriteTransferCount; LARGE_INTEGER IoOtherTransferCount; - ULONG SpareCounter1[8]; - PP_LOOKASIDE_LIST PPLookasideList[16]; - PP_LOOKASIDE_LIST PPNPagedLookasideList[32]; - PP_LOOKASIDE_LIST PPPagedLookasideList[32]; - volatile ULONG PacketBarrier; - volatile ULONG ReverseStall; - PVOID IpiFrame; - UCHAR PrcbPad2[52]; - volatile PVOID CurrentPacket[3]; - volatile ULONG TargetSet; - volatile PKIPI_WORKER WorkerRoutine; - volatile ULONG IpiFrozen; - UCHAR PrcbPad3[40]; - volatile ULONG RequestSummary; - volatile struct _KPRCB *SignalDone; - UCHAR PrcbPad4[56]; - struct _KDPC_DATA DpcData[2]; + UCHAR _PADDING4_[0x8]; + struct _REQUEST_MAILBOX* Mailbox; + LONG TargetCount; + ULONG IpiFrozen; + ULONG RequestSummary; + KDPC_DATA DpcData[2]; PVOID DpcStack; - ULONG MaximumDpcQueueDepth; + PVOID SpBase; + LONG MaximumDpcQueueDepth; ULONG DpcRequestRate; ULONG MinimumDpcRate; + ULONG DpcLastCount; + UCHAR ThreadDpcEnable; + UCHAR QuantumEnd; + UCHAR DpcRoutineActive; + UCHAR IdleSchedule; +#if (NTDDI_VERSION >= NTDDI_WIN8) + union + { + LONG DpcRequestSummary; + SHORT DpcRequestSlot[2]; + struct + { + SHORT NormalDpcState; + SHORT ThreadDpcState; + }; + struct + { + ULONG DpcNormalProcessingActive : 1; + ULONG DpcNormalProcessingRequested : 1; + ULONG DpcNormalThreadSignal : 1; + ULONG DpcNormalTimerExpiration : 1; + ULONG DpcNormalDpcPresent : 1; + ULONG DpcNormalLocalInterrupt : 1; + ULONG DpcNormalSpare : 10; + ULONG DpcThreadActive : 1; + ULONG DpcThreadRequested : 1; + ULONG DpcThreadSpare : 14; + }; + }; +#else + LONG DpcSetEventRequest; +#endif + ULONG LastTimerHand; + ULONG LastTick; + ULONG ClockInterrupts; + ULONG ReadyScanTick; + ULONG PrcbPad10[1]; + ULONG InterruptLastCount; + ULONG InterruptRate; + UCHAR _PADDING5_[0x4]; +#if (NTDDI_VERSION >= NTDDI_LONGHORN) + KGATE DpcGate; +#else + KEVENT DpcEvent; +#endif + ULONG MPAffinity; + KDPC CallDpc; + LONG ClockKeepAlive; + UCHAR ClockCheckSlot; + UCHAR ClockPollCycle; + //UCHAR _PADDING6_[0x2]; + LONG DpcWatchdogPeriod; + LONG DpcWatchdogCount; + LONG KeSpinLockOrdering; + UCHAR _PADDING7_[0x38]; + LIST_ENTRY WaitListHead; + ULONG WaitLock; + ULONG ReadySummary; + LONG AffinitizedSelectionMask; + ULONG QueueIndex; + KDPC TimerExpirationDpc; + //RTL_RB_TREE ScbQueue; + LIST_ENTRY ScbList; + UCHAR _PADDING8_[0x38]; + LIST_ENTRY DispatcherReadyListHead[32]; + ULONG InterruptCount; + ULONG KernelTime; + ULONG UserTime; + ULONG DpcTime; + ULONG InterruptTime; + ULONG AdjustDpcThreshold; + UCHAR SkipTick; + UCHAR DebuggerSavedIRQL; + UCHAR PollSlot; + UCHAR GroupSchedulingOverQuota; + ULONG DpcTimeCount; + ULONG DpcTimeLimit; + ULONG PeriodicCount; + ULONG PeriodicBias; + ULONG AvailableTime; + ULONG ScbOffset; + ULONG KeExceptionDispatchCount; + struct _KNODE* ParentNode; + UCHAR _PADDING9_[0x4]; + ULONG64 AffinitizedCycles; + ULONG64 StartCycles; + ULONG64 GenerationTarget; + ULONG64 CycleCounterHigh; +#if (NTDDI_VERSION >= NTDDI_WIN8) + KENTROPY_TIMING_STATE EntropyTimingState; +#endif /* (NTDDI_VERSION >= NTDDI_WIN8) */ + LONG MmSpinLockOrdering; + ULONG PageColor; + ULONG NodeColor; + ULONG NodeShiftedColor; + ULONG SecondaryColorMask; + ULONG64 CycleTime; + UCHAR _PADDING10_[0x58]; + ULONG CcFastMdlReadNoWait; + ULONG CcFastMdlReadWait; + ULONG CcFastMdlReadNotPossible; + ULONG CcMapDataNoWait; + ULONG CcMapDataWait; + ULONG CcPinMappedDataCount; + ULONG CcPinReadNoWait; + ULONG CcPinReadWait; + ULONG CcMdlReadNoWait; + ULONG CcMdlReadWait; + ULONG CcLazyWriteHotSpots; + ULONG CcLazyWriteIos; + ULONG CcLazyWritePages; + ULONG CcDataFlushes; + ULONG CcDataPages; + ULONG CcLostDelayedWrites; + ULONG CcFastReadResourceMiss; + ULONG CcCopyReadWaitMiss; + ULONG CcFastMdlReadResourceMiss; + ULONG CcMapDataNoWaitMiss; + ULONG CcMapDataWaitMiss; + ULONG CcPinReadNoWaitMiss; + ULONG CcPinReadWaitMiss; + ULONG CcMdlReadNoWaitMiss; + ULONG CcMdlReadWaitMiss; + ULONG CcReadAheadIos; + LONG MmCacheTransitionCount; + LONG MmCacheReadCount; + LONG MmCacheIoCount; + UCHAR _PADDING11_[0xC]; + PROCESSOR_POWER_STATE PowerState; + ULONG SharedReadyQueueOffset; + ULONG PrcbPad15[2]; + ULONG DeviceInterrupts; + PVOID IsrDpcStats; + ULONG KeAlignmentFixupCount; + KDPC DpcWatchdogDpc; + KTIMER DpcWatchdogTimer; + SLIST_HEADER InterruptObjectPool; + //KAFFINITY_EX PackageProcessorSet; + UCHAR _PADDING12_[0x4]; + ULONG SharedReadyQueueMask; + struct _KSHARED_READY_QUEUE* SharedReadyQueue; + ULONG CoreProcessorSet; + ULONG ScanSiblingMask; + ULONG LLCMask; + ULONG CacheProcessorMask[5]; + ULONG ScanSiblingIndex; + CACHE_DESCRIPTOR Cache[6]; + UCHAR CacheCount; + UCHAR PrcbPad20[3]; + ULONG CachedCommit; + ULONG CachedResidentAvailable; + PVOID HyperPte; + PVOID WheaInfo; + PVOID EtwSupport; + UCHAR _PADDING13_[0x74]; + SYNCH_COUNTERS SynchCounters; + //FILESYSTEM_DISK_COUNTERS FsCounters; + UCHAR _PADDING14_[0x8]; + KARM_MINI_STACK FiqMiniStack; + KARM_MINI_STACK IrqMiniStack; + KARM_MINI_STACK UdfMiniStack; + KARM_MINI_STACK AbtMiniStack; + KARM_MINI_STACK PanicMiniStack; + ULONG PanicStackBase; + PVOID IsrStack; + ULONG PteBitCache; + ULONG PteBitOffset; + KTIMER_TABLE TimerTable; + GENERAL_LOOKASIDE_POOL PPNxPagedLookasideList[32]; + GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[32]; + GENERAL_LOOKASIDE_POOL PPPagedLookasideList[32]; + SINGLE_LIST_ENTRY AbSelfIoBoostsList; + SINGLE_LIST_ENTRY AbPropagateBoostsList; + KDPC AbDpc; + UCHAR _PADDING15_[0x58]; + //REQUEST_MAILBOX RequestMailbox[1]; + + // FIXME: Oldstyle stuff +#if (NTDDI_VERSION < NTDDI_WIN8) // FIXME + UCHAR CpuType; volatile UCHAR DpcInterruptRequested; volatile UCHAR DpcThreadRequested; - volatile UCHAR DpcRoutineActive; volatile UCHAR DpcThreadActive; - ULONG PrcbLock; - ULONG DpcLastCount; volatile ULONG TimerHand; volatile ULONG TimerRequest; - PVOID DpcThread; - KEVENT DpcEvent; - UCHAR ThreadDpcEnable; - volatile BOOLEAN QuantumEnd; - UCHAR PrcbPad50; - volatile UCHAR IdleSchedule; - LONG DpcSetEventRequest; - UCHAR PrcbPad5[18]; - LONG TickOffset; - KDPC CallDpc; - ULONG PrcbPad7[8]; - LIST_ENTRY WaitListHead; - ULONG ReadySummary; - ULONG QueueIndex; - LIST_ENTRY DispatcherReadyListHead[32]; - SINGLE_LIST_ENTRY DeferredReadyListHead; - ULONG PrcbPad72[11]; - PVOID ChainedInterruptList; - LONG LookasideIrpFloat; - volatile LONG MmPageFaultCount; - volatile LONG MmCopyOnWriteCount; - volatile LONG MmTransitionCount; - volatile LONG MmCacheTransitionCount; - volatile LONG MmDemandZeroCount; - volatile LONG MmPageReadCount; - volatile LONG MmPageReadIoCount; - volatile LONG MmCacheReadCount; - volatile LONG MmCacheIoCount; - volatile LONG MmDirtyPagesWriteCount; - volatile LONG MmDirtyWriteIoCount; - volatile LONG MmMappedPagesWriteCount; - volatile LONG MmMappedWriteIoCount; - ULONG SpareFields0[1]; + ULONG DebugDpcTime; + LONG Sleeping; + KAFFINITY SetMember; CHAR VendorString[13]; - UCHAR InitialApicId; - UCHAR LogicalProcessorsPerPhysicalProcessor; - ULONG MHz; - ULONG FeatureBits; - LARGE_INTEGER UpdateSignature; - volatile LARGE_INTEGER IsrTime; - LARGE_INTEGER SpareField1; - //FX_SAVE_AREA NpxSaveArea; - PROCESSOR_POWER_STATE PowerState; +#endif + } KPRCB, *PKPRCB; +C_ASSERT(FIELD_OFFSET(KPRCB, ProcessorState) == 0x20); +C_ASSERT(FIELD_OFFSET(KPRCB, ProcessorModel) == 0x3C0); +C_ASSERT(FIELD_OFFSET(KPRCB, LockQueue) == 0x480); +C_ASSERT(FIELD_OFFSET(KPRCB, PacketBarrier) == 0x600); +C_ASSERT(FIELD_OFFSET(KPRCB, Mailbox) == 0x680); +C_ASSERT(FIELD_OFFSET(KPRCB, DpcData) == 0x690); +C_ASSERT(FIELD_OFFSET(KPRCB, DpcStack) == 0x6c0); +//C_ASSERT(FIELD_OFFSET(KPRCB, CallDpc) == 0x714); + // // Processor Control Region +// Based on Windows RT 8.1 symbols // typedef struct _KIPCR { @@ -480,60 +873,47 @@ NT_TIB NtTib; struct { - struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; // Unused - PVOID Used_StackBase; // Unused - PVOID PerfGlobalGroupMask; - PVOID TssCopy; // Unused - ULONG ContextSwitches; - KAFFINITY SetMemberCopy; // Unused + ULONG TibPad0[2]; + PVOID Spare1; + struct _KPCR *Self; + struct _KPRCB *CurrentPrcb; + struct _KSPIN_LOCK_QUEUE* LockArray; PVOID Used_Self; }; }; - struct _KPCR *Self; - struct _KPRCB *Prcb; - KIRQL Irql; - ULONG IRR; // Unused - ULONG IrrActive; // Unused - ULONG IDR; // Unused - PVOID KdVersionBlock; - PVOID IDT; // Unused - PVOID GDT; // Unused - PVOID TSS; // Unused + KIRQL CurrentIrql; + UCHAR SecondLevelCacheAssociativity; + ULONG Unused0[3]; USHORT MajorVersion; USHORT MinorVersion; - KAFFINITY SetMember; ULONG StallScaleFactor; - UCHAR SpareUnused; - UCHAR Number; - UCHAR Spare0; - UCHAR SecondLevelCacheAssociativity; - ULONG VdmAlert; - ULONG KernelReserved[14]; + PVOID Unused1[3]; + ULONG KernelReserved[15]; ULONG SecondLevelCacheSize; - ULONG HalReserved[16]; - // arm part - UCHAR IrqlMask[32]; - ULONG IrqlTable[32]; - PKINTERRUPT_ROUTINE InterruptRoutine[32]; - ULONG ReservedVectors; - ULONG FirstLevelDcacheSize; - ULONG FirstLevelDcacheFillSize; - ULONG FirstLevelIcacheSize; - ULONG FirstLevelIcacheFillSize; - ULONG SecondLevelDcacheSize; - ULONG SecondLevelDcacheFillSize; - ULONG SecondLevelIcacheSize; - ULONG SecondLevelIcacheFillSize; - ULONG DcacheFillSize; - ULONG DcacheAlignment; - ULONG IcacheAlignment; - ULONG IcacheFillSize; - ULONG ProcessorId; - PVOID InterruptStack; - PVOID PanicStack; - PVOID InitialStack; - KPRCB PrcbData; + union + { + USHORT SoftwareInterruptPending; + struct + { + UCHAR ApcInterrupt; + UCHAR DispatchInterrupt; + }; + }; + USHORT InterruptPad; + ULONG HalReserved[32]; + PVOID KdVersionBlock; + PVOID Unused3; + ULONG PcrAlign1[8]; + + /* Private members, not in ntddk.h */ + PVOID Idt[256]; + PVOID* IdtExt; + ULONG PcrAlign2[19]; + UCHAR _PADDING1_[0x4]; + KPRCB Prcb; } KIPCR, *PKIPCR; + +C_ASSERT(FIELD_OFFSET(KIPCR, Prcb.LegacyNumber) == 0x580); // // Macro to get current KPRCB @@ -542,20 +922,19 @@ struct _KPRCB * KeGetCurrentPrcb(VOID) { - return PCR->Prcb; + return KeGetPcr()->CurrentPrcb; } // // Just read it from the PCR // -#define KeGetCurrentProcessorNumber() (int)PCR->Number -#define KeGetCurrentIrql() PCR->Irql +#define KeGetCurrentIrql() KeGetPcr()->CurrentIrql #define _KeGetCurrentThread() KeGetCurrentPrcb()->CurrentThread #define _KeGetPreviousMode() KeGetCurrentPrcb()->CurrentThread->PreviousMode #define _KeIsExecutingDpc() (KeGetCurrentPrcb()->DpcRoutineActive != 0) #define KeGetCurrentThread() _KeGetCurrentThread() #define KeGetPreviousMode() _KeGetPreviousMode() -#define KeGetDcacheFillSize() PCR->DcacheFillSize +//#define KeGetDcacheFillSize() PCR->DcacheFillSize #endif // !NTOS_MODE_USER Modified: trunk/reactos/include/ndk/i386/asm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/asm.h?rev…
============================================================================== --- trunk/reactos/include/ndk/i386/asm.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/i386/asm.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -36,18 +36,6 @@ // #define KernelMode 0x0 #define UserMode 0x1 - -// -// CPU Types -// -#define CPU_NONE 0x0 -#define CPU_INTEL 0x1 -#define CPU_AMD 0x2 -#define CPU_CYRIX 0x3 -#define CPU_TRANSMETA 0x4 -#define CPU_CENTAUR 0x5 -#define CPU_RISE 0x6 -#define CPU_UNKNOWN 0x7 // // Selector Names Modified: trunk/reactos/include/ndk/i386/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/ketypes.h…
============================================================================== --- trunk/reactos/include/ndk/i386/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/i386/ketypes.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -32,6 +32,22 @@ #undef KeGetPcr #define KeGetPcr() ((KPCR *)__readfsdword(FIELD_OFFSET(KPCR, SelfPcr))) #endif + +// +// CPU Vendors +// +typedef enum +{ + CPU_NONE = 0, + CPU_INTEL = 1, + CPU_AMD = 2, + CPU_CYRIX = 3, + CPU_TRANSMETA = 4, + CPU_VIA = 5, + CPU_CENTAUR = CPU_VIA, + CPU_RISE = 6, + CPU_UNKNOWN = 7 +} CPU_VENDORS; // // Machine Types @@ -115,6 +131,20 @@ #define FSW_UNDERFLOW 0x10 #define FSW_PRECISION 0x20 #define FSW_STACK_FAULT 0x40 + +// +// Machine Specific Registers +// +#define MSR_AMD_ACCESS 0x9C5A203A +#define MSR_IA32_MISC_ENABLE 0x01A0 +#define MSR_EFER 0xC0000080 + +// +// MSR internal Values +// +#define MSR_NXE 0x0800 +#define XHF_NOEXECUTE 0x100000 +#define MSR_XD_ENABLE_MASK 0xFFFFFFFB // // IPI Types @@ -802,5 +832,82 @@ // i386 CPUs don't have exception frames // typedef struct _KEXCEPTION_FRAME KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; -#endif -#endif + +#endif /* NTOS_MODE_USER */ + +typedef enum _WOW64_SERVICE_TYPES +{ + ServiceNoTurbo = 0x0000, + Service0Arg = 0x0001, + Service0ArgReloadState = 0x0002, + Service1ArgSp = 0x0003, + Service1ArgNSp = 0x0004, + Service2ArgNSpNSp = 0x0005, + Service2ArgNSpNSpReloadState = 0x0006, + Service2ArgSpNSp = 0x0007, + Service2ArgSpSp = 0x0008, + Service2ArgNSpSp = 0x0009, + Service3ArgNSpNSpNSp = 0x000A, + Service3ArgSpSpSp = 0x000B, + Service3ArgSpNSpNSp = 0x000C, + Service3ArgSpNSpNSpReloadState = 0x000D, + Service3ArgSpSpNSp = 0x000E, + Service3ArgNSpSpNSp = 0x000F, + Service3ArgSpNSpSp = 0x0010, + Service4ArgNSpNSpNSpNSp = 0x0011, + Service4ArgSpSpNSpNSp = 0x0012, + Service4ArgSpSpNSpNSpReloadState = 0x0013, + Service4ArgSpNSpNSpNSp = 0x0014, + Service4ArgSpNSpNSpNSpReloadState = 0x0015, + Service4ArgNSpSpNSpNSp = 0x0016, + Service4ArgSpSpSpNSp = 0x0017, + ServiceCpupTdQuerySystemTime = 0x0018, + ServiceCpupTdGetCurrentProcessorNumber = 0x0019, + ServiceCpupTdReadWriteFile = 0x001A, + ServiceCpupTdDeviceIoControlFile = 0x001B, + ServiceCpupTdRemoveIoCompletion = 0x001C, + ServiceCpupTdWaitForMultipleObjects = 0x001D, + ServiceCpupTdWaitForMultipleObjects32 = 0x001E, + Wow64ServiceTypesCount // = 0x001F +} WOW64_SERVICE_TYPES, *PWOW64_SERVICE_TYPES; + +typedef enum _VDM_INDEX +{ + VDM_INDEX_Invalid = 0, + VDM_INDEX_0F, + VDM_INDEX_ESPrefix, + VDM_INDEX_CSPrefix, + VDM_INDEX_SSPrefix, + VDM_INDEX_DSPrefix, + VDM_INDEX_FSPrefix, + VDM_INDEX_GSPrefix, + VDM_INDEX_OPER32Prefix, + VDM_INDEX_ADDR32Prefix, + VDM_INDEX_INSB, + VDM_INDEX_INSW, + VDM_INDEX_OUTSB, + VDM_INDEX_OUTSW, + VDM_INDEX_PUSHF, + VDM_INDEX_POPF, + VDM_INDEX_INTnn, + VDM_INDEX_INTO, + VDM_INDEX_IRET, + VDM_INDEX_NPX, + VDM_INDEX_INBimm, + VDM_INDEX_INWimm, + VDM_INDEX_OUTBimm, + VDM_INDEX_OUTWimm, + VDM_INDEX_INB, + VDM_INDEX_INW, + VDM_INDEX_OUTB, + VDM_INDEX_OUTW, + VDM_INDEX_LOCKPrefix, + VDM_INDEX_REPNEPrefix, + VDM_INDEX_REPPrefix, + VDM_INDEX_CLI, + VDM_INDEX_STI, + VDM_INDEX_HLT, + MAX_VDM_INDEX +} VDM_INDEX, *PVDM_INDEX; + +#endif /* _I386_KETYPES_H */ Modified: trunk/reactos/include/ndk/ketypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/ketypes.h?rev=…
============================================================================== --- trunk/reactos/include/ndk/ketypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/ketypes.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -158,9 +158,17 @@ #define KF_AMDK6MTRR 0x00008000 #define KF_XMMI64 0x00010000 #define KF_DTS 0x00020000 +#define KF_BRANCH 0x00020000 // from ksamd64.inc +#define KF_SSE3 0x00080000 +#define KF_CMPXCHG16B 0x00100000 +#define KF_XSTATE 0x00800000 // from ks386.inc, ksamd64.inc #define KF_NX_BIT 0x20000000 #define KF_NX_DISABLED 0x40000000 #define KF_NX_ENABLED 0x80000000 + +#define KF_XSAVEOPT_BIT 15 +#define KF_XSTATE_BIT 23 +#define KF_RDWRFSGSBASE_BIT 28 // // Internal Exception Codes @@ -777,6 +785,17 @@ #include <poppack.h> // +// Structure for Get/SetContext APC +// +typedef struct _GETSETCONTEXT +{ + KAPC Apc; + KEVENT Event; + KPROCESSOR_MODE Mode; + CONTEXT Context; +} GETSETCONTEXT, *PGETSETCONTEXT; + +// // Kernel Profile Object // typedef struct _KPROFILE @@ -1428,6 +1447,28 @@ PUCHAR Number; } KSERVICE_TABLE_DESCRIPTOR, *PKSERVICE_TABLE_DESCRIPTOR; +#if (NTDDI_VERSION >= NTDDI_WIN8) +// +// Entropy Timing State +// +typedef struct _KENTROPY_TIMING_STATE +{ + ULONG EntropyCount; + ULONG Buffer[64]; + KDPC Dpc; + ULONG LastDeliveredBuffer; + PULONG RawDataBuffer; +} KENTROPY_TIMING_STATE, *PKENTROPY_TIMING_STATE; + +// +// Constants from ks386.inc, ksamd64.inc and ksarm.h +// +#define KENTROPY_TIMING_INTERRUPTS_PER_BUFFER 0x400 +#define KENTROPY_TIMING_BUFFER_MASK 0x7ff +#define KENTROPY_TIMING_ANALYSIS 0x0 + +#endif /* (NTDDI_VERSION >= NTDDI_WIN8) */ + // // Exported Loader Parameter Block // Modified: trunk/reactos/include/ndk/rtltypes.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
============================================================================== --- trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] (original) +++ trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] Sat May 2 23:12:19 2015 @@ -1395,6 +1395,98 @@ SECTION_IMAGE_INFORMATION ImageInformation; } RTL_USER_PROCESS_INFORMATION, *PRTL_USER_PROCESS_INFORMATION; +#if (NTDDI_VERSION >= NTDDI_WIN7) + +typedef enum _RTL_UMS_SCHEDULER_REASON +{ + UmsSchedulerStartup = 0, + UmsSchedulerThreadBlocked = 1, + UmsSchedulerThreadYield = 2, +} RTL_UMS_SCHEDULER_REASON, *PRTL_UMS_SCHEDULER_REASON; + +enum _RTL_UMSCTX_FLAGS +{ + UMSCTX_SCHEDULED_THREAD_BIT = 0, +#if (NTDDI_VERSION < NTDDI_WIN8) + UMSCTX_HAS_QUANTUM_REQ_BIT, + UMSCTX_HAS_AFFINITY_REQ_BIT, + UMSCTX_HAS_PRIORITY_REQ_BIT, +#endif + UMSCTX_SUSPENDED_BIT, + UMSCTX_VOLATILE_CONTEXT_BIT, + UMSCTX_TERMINATED_BIT, + UMSCTX_DEBUG_ACTIVE_BIT, + UMSCTX_RUNNING_ON_SELF_THREAD_BIT + UMSCTX_DENY_RUNNING_ON_SELF_THREAD_BIT + +} RTL_UMSCTX_FLAGS, *PRTL_UMSCTX_FLAGS; + +#define UMSCTX_SCHEDULED_THREAD_MASK (1 << UMSCTX_SCHEDULED_THREAD_BIT) +#define UMSCTX_SUSPENDED_MASK (1 << UMSCTX_SUSPENDED_BIT) +#define UMSCTX_VOLATILE_CONTEXT_MASK (1 << UMSCTX_VOLATILE_CONTEXT_BIT) +#define UMSCTX_TERMINATED_MASK (1 << UMSCTX_TERMINATED_BIT) +#define UMSCTX_DEBUG_ACTIVE_MASK (1 << UMSCTX_DEBUG_ACTIVE_BIT) +#define UMSCTX_RUNNING_ON_SELF_THREAD_MASK (1 << UMSCTX_RUNNING_ON_SELF_THREAD_BIT) +#define UMSCTX_DENY_RUNNING_ON_SELF_THREAD_MASK (1 << UMSCTX_DENY_RUNNING_ON_SELF_THREAD_BIT) + +// +// UMS Context +// +typedef struct DECLSPEC_ALIGN(16) _RTL_UMS_CONTEXT +{ + SINGLE_LIST_ENTRY Link; + CONTEXT Context; + PVOID Teb; + PVOID UserContext; + union + { + struct + { + ULONG ScheduledThread : 1; +#if (NTDDI_VERSION < NTDDI_WIN8) + ULONG HasQuantumReq : 1; + ULONG HasAffinityReq : 1; + ULONG HasPriorityReq : 1; +#endif + ULONG Suspended : 1; + ULONG VolatileContext : 1; + ULONG Terminated : 1; + ULONG DebugActive : 1; + ULONG RunningOnSelfThread : 1; + ULONG DenyRunningOnSelfThread : 1; +#if (NTDDI_VERSION < NTDDI_WIN8) + ULONG ReservedFlags : 22; +#endif + }; + LONG Flags; + }; + union + { + struct + { +#if (NTDDI_VERSION >= NTDDI_WIN8) + ULONG64 KernelUpdateLock : 2; +#else + ULONG64 KernelUpdateLock : 1; + ULONG64 Reserved : 1; +#endif + ULONG64 PrimaryClientID : 62; + }; + ULONG64 ContextLock; + }; +#if (NTDDI_VERSION < NTDDI_WIN8) + ULONG64 QuantumValue; + GROUP_AFFINITY AffinityMask; + LONG Priority; +#endif + struct _RTL_UMS_CONTEXT* PrimaryUmsContext; + ULONG SwitchCount; + ULONG KernelYieldCount; + ULONG MixedYieldCount; + ULONG YieldCount; +} RTL_UMS_CONTEXT, *PRTL_UMS_CONTEXT; +#endif // #if (NTDDI_VERSION >= NTDDI_WIN7) + // // RTL Atom Table Structures // @@ -1593,7 +1685,7 @@ typedef struct _RTL_MEMORY_STREAM RTL_MEMORY_STREAM, *PRTL_MEMORY_STREAM; -typedef VOID +typedef VOID (NTAPI *PRTL_MEMORY_STREAM_FINAL_RELEASE_ROUTINE)( _In_ PRTL_MEMORY_STREAM Stream ); Modified: trunk/reactos/ntoskrnl/kd64/kddata.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/kd64/kddata.c?rev…
============================================================================== --- trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/kd64/kddata.c [iso-8859-1] Sat May 2 23:12:19 2015 @@ -396,8 +396,13 @@ {(ULONG_PTR)RtlpBreakWithStatusInstruction}, 0, FIELD_OFFSET(KTHREAD, CallbackStack), +#if defined(_M_ARM) || defined(_M_AMD64) + 0, + 0, +#else FIELD_OFFSET(KCALLOUT_FRAME, CallbackStack), FIELD_OFFSET(KCALLOUT_FRAME, CBSTACK_FRAME_POINTER), +#endif FALSE, {(ULONG_PTR)KiCallUserMode}, 0, Modified: trunk/reactos/ntoskrnl/ke/amd64/thrdini.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/amd64/thrdini.…
============================================================================== --- trunk/reactos/ntoskrnl/ke/amd64/thrdini.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ke/amd64/thrdini.c [iso-8859-1] Sat May 2 23:12:19 2015 @@ -132,8 +132,7 @@ StartFrame->P2Home = (ULONG64)StartContext; StartFrame->P3Home = 0; StartFrame->P4Home = (ULONG64)SystemRoutine; - StartFrame->P5Home = 0; - + StartFrame->Reserved = 0; } BOOLEAN
9 years, 7 months
1
0
0
0
← Newer
1
...
43
44
45
46
47
48
49
50
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Results per page:
10
25
50
100
200