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
March 2017
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
14 participants
251 discussions
Start a n
N
ew thread
[rnaumann] 74057: [DESK] Fix Font Smoothing Dropdown Field. Patch by Katayama Hirofumi MZ CORE-12568
by rnaumann@svn.reactos.org
Author: rnaumann Date: Sat Mar 4 18:12:42 2017 New Revision: 74057 URL:
http://svn.reactos.org/svn/reactos?rev=74057&view=rev
Log: [DESK] Fix Font Smoothing Dropdown Field. Patch by Katayama Hirofumi MZ CORE-12568 Modified: trunk/reactos/dll/cpl/desk/effappdlg.c Modified: trunk/reactos/dll/cpl/desk/effappdlg.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/effappdlg.c?r…
============================================================================== --- trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] (original) +++ trunk/reactos/dll/cpl/desk/effappdlg.c [iso-8859-1] Sat Mar 4 18:12:42 2017 @@ -58,16 +58,13 @@ static VOID AddToCombobox(INT Combo, HWND hwndDlg, INT From, INT To) { - INT iElement, iListIndex, i = 0; + INT iElement; TCHAR tstrText[80]; - if (Combo == IDC_EFFAPPEARANCE_SMOOTHINGTYPE) i = 1; - - for (iElement = From; iElement<=To; iElement++) + for (iElement = From; iElement <= To; iElement++) { LoadString(hApplet, iElement, (LPTSTR)tstrText, ARRAYSIZE(tstrText)); - iListIndex = SendDlgItemMessage(hwndDlg, Combo, CB_ADDSTRING, 0, (LPARAM)tstrText); - SendDlgItemMessageW(hwndDlg, Combo, CB_SETITEMDATA, (WPARAM)iListIndex, (LPARAM)i++); + SendDlgItemMessage(hwndDlg, Combo, CB_ADDSTRING, 0, (LPARAM)tstrText); } } @@ -159,10 +156,14 @@ case IDC_EFFAPPEARANCE_SMOOTHINGTYPE: if (HIWORD(wParam) == CBN_SELCHANGE) { - INT fontTypeIndex = SendDlgItemMessageW(hwndDlg, IDC_EFFAPPEARANCE_SMOOTHINGTYPE, CB_GETCURSEL, 0, 0); + INT Index = + SendDlgItemMessageW(hwndDlg, IDC_EFFAPPEARANCE_SMOOTHINGTYPE, + CB_GETCURSEL, 0, 0); - g->SchemeAdv.Effects.bMenuFade = SendDlgItemMessageW(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, CB_GETCURSEL, 0, 0); - g->SchemeAdv.Effects.uiFontSmoothingType = SendDlgItemMessageW(hwndDlg, IDC_EFFAPPEARANCE_SMOOTHINGTYPE, CB_GETITEMDATA, fontTypeIndex, 0); + g->SchemeAdv.Effects.bMenuFade = + SendDlgItemMessageW(hwndDlg, IDC_EFFAPPEARANCE_ANIMATIONTYPE, + CB_GETCURSEL, 0, 0); + g->SchemeAdv.Effects.uiFontSmoothingType = (Index == CB_ERR) ? 0 : (Index + 1); UpdateControls(hwndDlg, g); }
7 years, 9 months
1
0
0
0
[tfaber] 74056: [ACPICA] - Update to version 20170303 CORE-12885
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 16:54:26 2017 New Revision: 74056 URL:
http://svn.reactos.org/svn/reactos?rev=74056&view=rev
Log: [ACPICA] - Update to version 20170303 CORE-12885 Added: trunk/reactos/drivers/bus/acpi/acpica/include/acconvert.h (with props) Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c trunk/reactos/drivers/bus/acpi/acpica/executer/exmisc.c trunk/reactos/drivers/bus/acpi/acpica/executer/exnames.c trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c trunk/reactos/drivers/bus/acpi/acpica/executer/exresolv.c trunk/reactos/drivers/bus/acpi/acpica/executer/exstore.c trunk/reactos/drivers/bus/acpi/acpica/executer/exstoren.c trunk/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c trunk/reactos/drivers/bus/acpi/acpica/include/acconfig.h trunk/reactos/drivers/bus/acpi/acpica/include/acdisasm.h trunk/reactos/drivers/bus/acpi/acpica/include/acglobal.h trunk/reactos/drivers/bus/acpi/acpica/include/aclocal.h trunk/reactos/drivers/bus/acpi/acpica/include/acmacros.h trunk/reactos/drivers/bus/acpi/acpica/include/acopcode.h trunk/reactos/drivers/bus/acpi/acpica/include/acpixf.h trunk/reactos/drivers/bus/acpi/acpica/include/actbl2.h trunk/reactos/drivers/bus/acpi/acpica/include/amlcode.h trunk/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c trunk/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c trunk/reactos/drivers/bus/acpi/acpica/parser/psargs.c trunk/reactos/drivers/bus/acpi/acpica/parser/psloop.c trunk/reactos/drivers/bus/acpi/acpica/parser/psobject.c trunk/reactos/drivers/bus/acpi/acpica/parser/psopcode.c trunk/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c trunk/reactos/drivers/bus/acpi/acpica/parser/psparse.c trunk/reactos/drivers/bus/acpi/acpica/parser/pstree.c trunk/reactos/drivers/bus/acpi/acpica/parser/psutils.c trunk/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c trunk/reactos/drivers/bus/acpi/acpica/utilities/utcache.c trunk/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c trunk/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c trunk/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -358,7 +358,7 @@ break; - case AML_BREAK_POINT_OP: + case AML_BREAKPOINT_OP: AcpiDbSignalBreakPoint (WalkState); Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -728,7 +728,8 @@ * * FUNCTION: AcpiDsMethodDataGetType * - * PARAMETERS: Opcode - Either AML_LOCAL_OP or AML_ARG_OP + * PARAMETERS: Opcode - Either AML_FIRST LOCAL_OP or + * AML_FIRST_ARG_OP * Index - Which Local or Arg whose type to get * WalkState - Current walk state object * Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -113,7 +113,7 @@ if ((Status == AE_NOT_FOUND) && (AcpiGbl_EnableInterpreterSlack) && ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))) + (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))) { /* * We didn't find the target and we are populating elements @@ -142,7 +142,7 @@ /* Special object resolution for elements of a package */ if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) + (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) { /* * Attempt to resolve the node to a value before we insert it into @@ -411,7 +411,7 @@ Parent = Op->Common.Parent; while ((Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) + (Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) { Parent = Parent->Common.Parent; } @@ -795,9 +795,9 @@ { case AML_TYPE_LOCAL_VARIABLE: - /* Local ID (0-7) is (AML opcode - base AML_LOCAL_OP) */ - - ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_LOCAL_OP; + /* Local ID (0-7) is (AML opcode - base AML_FIRST_LOCAL_OP) */ + + ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP; ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL; #ifndef ACPI_NO_METHOD_EXECUTION @@ -810,9 +810,9 @@ case AML_TYPE_METHOD_ARGUMENT: - /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */ - - ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_ARG_OP; + /* Arg ID (0-6) is (AML opcode - base AML_FIRST_ARG_OP) */ + + ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP; ObjDesc->Reference.Class = ACPI_REFCLASS_ARG; #ifndef ACPI_NO_METHOD_EXECUTION Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -681,7 +681,7 @@ break; case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: + case AML_VARIABLE_PACKAGE_OP: Status = AcpiDsBuildInternalPackageObj ( WalkState, Op, Length, &ObjDesc); @@ -701,7 +701,7 @@ */ if ((!Op->Common.Parent) || ((Op->Common.Parent->Common.AmlOpcode != AML_PACKAGE_OP) && - (Op->Common.Parent->Common.AmlOpcode != AML_VAR_PACKAGE_OP) && + (Op->Common.Parent->Common.AmlOpcode != AML_VARIABLE_PACKAGE_OP) && (Op->Common.Parent->Common.AmlOpcode != AML_NAME_OP))) { WalkState->ResultObj = ObjDesc; Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -297,8 +297,8 @@ if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_DATA_REGION_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) || + (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_INT_EVAL_SUBTREE_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP)) { @@ -589,7 +589,7 @@ */ if (Status == AE_NOT_FOUND) { - if (ParentOp->Common.AmlOpcode == AML_COND_REF_OF_OP) + if (ParentOp->Common.AmlOpcode == AML_CONDITIONAL_REF_OF_OP) { /* * For the Conditional Reference op, it's OK if @@ -870,7 +870,7 @@ } if ((Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP) || + (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_REF_OF_OP)) { /* TBD: Should we specify this feature as a bit of OpInfo->Flags of these opcodes? */ Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -536,7 +536,7 @@ */ if ((Op->Asl.Parent) && ((Op->Asl.Parent->Asl.AmlOpcode == AML_PACKAGE_OP) || - (Op->Asl.Parent->Asl.AmlOpcode == AML_VAR_PACKAGE_OP))) + (Op->Asl.Parent->Asl.AmlOpcode == AML_VARIABLE_PACKAGE_OP))) { ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method Reference in a Package, Op=%p\n", Op)); Modified: trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/di…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -543,7 +543,7 @@ Status = AcpiExCreateProcessor (WalkState); break; - case AML_POWER_RES_OP: + case AML_POWER_RESOURCE_OP: Status = AcpiExCreatePowerResource (WalkState); break; Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exmisc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exmisc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exmisc.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -274,7 +274,7 @@ switch (Opcode) { - case AML_LAND_OP: /* LAnd (Integer0, Integer1) */ + case AML_LOGICAL_AND_OP: /* LAnd (Integer0, Integer1) */ if (Integer0 && Integer1) { @@ -282,7 +282,7 @@ } break; - case AML_LOR_OP: /* LOr (Integer0, Integer1) */ + case AML_LOGICAL_OR_OP: /* LOr (Integer0, Integer1) */ if (Integer0 || Integer1) { @@ -400,7 +400,7 @@ switch (Opcode) { - case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */ + case AML_LOGICAL_EQUAL_OP: /* LEqual (Operand0, Operand1) */ if (Integer0 == Integer1) { @@ -408,7 +408,7 @@ } break; - case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */ + case AML_LOGICAL_GREATER_OP: /* LGreater (Operand0, Operand1) */ if (Integer0 > Integer1) { @@ -416,7 +416,7 @@ } break; - case AML_LLESS_OP: /* LLess (Operand0, Operand1) */ + case AML_LOGICAL_LESS_OP: /* LLess (Operand0, Operand1) */ if (Integer0 < Integer1) { @@ -449,7 +449,7 @@ switch (Opcode) { - case AML_LEQUAL_OP: /* LEqual (Operand0, Operand1) */ + case AML_LOGICAL_EQUAL_OP: /* LEqual (Operand0, Operand1) */ /* Length and all bytes must be equal */ @@ -462,7 +462,7 @@ } break; - case AML_LGREATER_OP: /* LGreater (Operand0, Operand1) */ + case AML_LOGICAL_GREATER_OP: /* LGreater (Operand0, Operand1) */ if (Compare > 0) { @@ -482,7 +482,7 @@ } break; - case AML_LLESS_OP: /* LLess (Operand0, Operand1) */ + case AML_LOGICAL_LESS_OP: /* LLess (Operand0, Operand1) */ if (Compare > 0) { Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exnames.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exnames.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exnames.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -141,7 +141,7 @@ { /* Set up multi prefixes */ - *TempPtr++ = AML_MULTI_NAME_PREFIX_OP; + *TempPtr++ = AML_MULTI_NAME_PREFIX; *TempPtr++ = (char) NumNameSegs; } else if (2 == NumNameSegs) @@ -385,7 +385,7 @@ } break; - case AML_MULTI_NAME_PREFIX_OP: + case AML_MULTI_NAME_PREFIX: ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n", AmlAddress)); Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -304,7 +304,7 @@ case AML_FIND_SET_RIGHT_BIT_OP: case AML_FROM_BCD_OP: case AML_TO_BCD_OP: - case AML_COND_REF_OF_OP: + case AML_CONDITIONAL_REF_OF_OP: /* Create a return object of type Integer for these opcodes */ @@ -435,7 +435,7 @@ } break; - case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */ + case AML_CONDITIONAL_REF_OF_OP: /* CondRefOf (SourceObject, Result) */ /* * This op is a little strange because the internal return value is * different than the return value stored in the result descriptor @@ -507,13 +507,13 @@ /* * ACPI 2.0 Opcodes */ - case AML_COPY_OP: /* Copy (Source, Target) */ + case AML_COPY_OBJECT_OP: /* CopyObject (Source, Target) */ Status = AcpiUtCopyIobjectToIobject ( Operand[0], &ReturnDesc, WalkState); break; - case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */ + case AML_TO_DECIMAL_STRING_OP: /* ToDecimalString (Data, Result) */ Status = AcpiExConvertToString ( Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_DECIMAL); @@ -525,7 +525,7 @@ } break; - case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */ + case AML_TO_HEX_STRING_OP: /* ToHexString (Data, Result) */ Status = AcpiExConvertToString ( Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_HEX); @@ -640,7 +640,7 @@ switch (WalkState->Opcode) { - case AML_LNOT_OP: /* LNot (Operand) */ + case AML_LOGICAL_NOT_OP: /* LNot (Operand) */ ReturnDesc = AcpiUtCreateIntegerObject ((UINT64) 0); if (!ReturnDesc) @@ -691,7 +691,8 @@ * NOTE: We use LNOT_OP here in order to force resolution of the * reference operand to an actual integer. */ - Status = AcpiExResolveOperands (AML_LNOT_OP, &TempDesc, WalkState); + Status = AcpiExResolveOperands (AML_LOGICAL_NOT_OP, + &TempDesc, WalkState); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -330,7 +330,7 @@ &ReturnDesc->Integer.Value); break; - case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ + case AML_CONCATENATE_OP: /* Concatenate (Data1, Data2, Result) */ Status = AcpiExDoConcatenate ( Operand[0], Operand[1], &ReturnDesc, WalkState); @@ -376,7 +376,7 @@ Operand[0]->Buffer.Pointer, Length); break; - case AML_CONCAT_RES_OP: + case AML_CONCATENATE_TEMPLATE_OP: /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */ Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -133,7 +133,7 @@ * Change to: (M == P[i]) */ Status = AcpiExDoLogicalOp ( - AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult); + AML_LOGICAL_EQUAL_OP, MatchObj, PackageObj, &LogicalResult); if (ACPI_FAILURE (Status)) { return (FALSE); @@ -146,7 +146,7 @@ * Change to: (M >= P[i]) (M NotLess than P[i]) */ Status = AcpiExDoLogicalOp ( - AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult); + AML_LOGICAL_LESS_OP, MatchObj, PackageObj, &LogicalResult); if (ACPI_FAILURE (Status)) { return (FALSE); @@ -160,7 +160,7 @@ * Change to: (M > P[i]) */ Status = AcpiExDoLogicalOp ( - AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult); + AML_LOGICAL_GREATER_OP, MatchObj, PackageObj, &LogicalResult); if (ACPI_FAILURE (Status)) { return (FALSE); @@ -173,7 +173,7 @@ * Change to: (M <= P[i]) (M NotGreater than P[i]) */ Status = AcpiExDoLogicalOp ( - AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult); + AML_LOGICAL_GREATER_OP, MatchObj, PackageObj, &LogicalResult); if (ACPI_FAILURE (Status)) { return (FALSE); @@ -187,7 +187,7 @@ * Change to: (M < P[i]) */ Status = AcpiExDoLogicalOp ( - AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult); + AML_LOGICAL_LESS_OP, MatchObj, PackageObj, &LogicalResult); if (ACPI_FAILURE (Status)) { return (FALSE); Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exresolv.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exresolv.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exresolv.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -210,7 +210,7 @@ /* If method call or CopyObject - do not dereference */ if ((WalkState->Opcode == AML_INT_METHODCALL_OP) || - (WalkState->Opcode == AML_COPY_OP)) + (WalkState->Opcode == AML_COPY_OBJECT_OP)) { break; } Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exstore.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exstore.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exstore.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -435,7 +435,7 @@ /* Only limited target types possible for everything except CopyObject */ - if (WalkState->Opcode != AML_COPY_OP) + if (WalkState->Opcode != AML_COPY_OBJECT_OP) { /* * Only CopyObject allows all object types to be overwritten. For @@ -521,7 +521,7 @@ case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - if ((WalkState->Opcode == AML_COPY_OP) || + if ((WalkState->Opcode == AML_COPY_OBJECT_OP) || !ImplicitConversion) { /* Modified: trunk/reactos/drivers/bus/acpi/acpica/executer/exstoren.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ex…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/executer/exstoren.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/executer/exstoren.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -113,7 +113,7 @@ /* For CopyObject, no further validation necessary */ - if (WalkState->Opcode == AML_COPY_OP) + if (WalkState->Opcode == AML_COPY_OBJECT_OP) { break; } Modified: trunk/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ha…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -107,7 +107,7 @@ {"PCI", 0x0CF8, 0x0CFF, ACPI_OSI_WIN_XP} }; -#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (AcpiProtectedPorts) +#define ACPI_PORT_INFO_ENTRIES ACPI_ARRAY_LENGTH (AcpiProtectedPorts) /****************************************************************************** @@ -137,7 +137,7 @@ const ACPI_PORT_INFO *PortInfo; - ACPI_FUNCTION_TRACE (HwValidateIoRequest); + ACPI_FUNCTION_NAME (HwValidateIoRequest); /* Supported widths are 8/16/32 */ @@ -166,14 +166,14 @@ ACPI_ERROR ((AE_INFO, "Illegal I/O port address/length above 64K: %8.8X%8.8X/0x%X", ACPI_FORMAT_UINT64 (Address), ByteWidth)); - return_ACPI_STATUS (AE_LIMIT); + return (AE_LIMIT); } /* Exit if requested address is not within the protected port table */ if (Address > AcpiProtectedPorts[ACPI_PORT_INFO_ENTRIES - 1].End) { - return_ACPI_STATUS (AE_OK); + return (AE_OK); } /* Check request against the list of protected I/O ports */ @@ -182,7 +182,7 @@ { /* * Check if the requested address range will write to a reserved - * port. Four cases to consider: + * port. There are four cases to consider: * * 1) Address range is contained completely in the port address range * 2) Address range overlaps port range at the port range start @@ -212,7 +212,7 @@ } } - return_ACPI_STATUS (AE_OK); + return (AE_OK); } @@ -221,7 +221,7 @@ * FUNCTION: AcpiHwReadPort * * PARAMETERS: Address Address of I/O port/register to read - * Value Where value is placed + * Value Where value (data) is returned * Width Number of bits * * RETURN: Status and value read from port @@ -267,7 +267,7 @@ /* * There has been a protection violation within the request. Fall * back to byte granularity port I/O and ignore the failing bytes. - * This provides Windows compatibility. + * This provides compatibility with other ACPI implementations. */ for (i = 0, *Value = 0; i < Width; i += 8) { @@ -341,7 +341,7 @@ /* * There has been a protection violation within the request. Fall * back to byte granularity port I/O and ignore the failing bytes. - * This provides Windows compatibility. + * This provides compatibility with other ACPI implementations. */ for (i = 0; i < Width; i += 8) { Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acconfig.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acconfig.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acconfig.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -79,6 +79,7 @@ #define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */ #define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */ #define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */ +#define ACPI_MAX_COMMENT_CACHE_DEPTH 96 /* Comments for the -ca option */ /* * Should the subsystem abort the loading of an ACPI table if the Added: trunk/reactos/drivers/bus/acpi/acpica/include/acconvert.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acconvert.h (added) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acconvert.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -0,0 +1,204 @@ +/****************************************************************************** + * + * Module Name: acapps - common include for ACPI applications/tools + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2017, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#ifndef _ACCONVERT +#define _ACCONVERT + +/* Definitions for comment state */ + +#define ASL_COMMENT_STANDARD 1 +#define ASLCOMMENT_INLINE 2 +#define ASL_COMMENT_OPEN_PAREN 3 +#define ASL_COMMENT_CLOSE_PAREN 4 +#define ASL_COMMENT_CLOSE_BRACE 5 + +/* Definitions for comment print function*/ + +#define AML_COMMENT_STANDARD 1 +#define AMLCOMMENT_INLINE 2 +#define AML_COMMENT_END_NODE 3 +#define AML_NAMECOMMENT 4 +#define AML_COMMENT_CLOSE_BRACE 5 +#define AML_COMMENT_ENDBLK 6 +#define AML_COMMENT_INCLUDE 7 + + +#ifdef ACPI_ASL_COMPILER +/* + * cvcompiler + */ +void +CvProcessComment ( + ASL_COMMENT_STATE CurrentState, + char *StringBuffer, + int c1); + +void +CvProcessCommentType2 ( + ASL_COMMENT_STATE CurrentState, + char *StringBuffer); + +UINT32 +CvCalculateCommentLengths( + ACPI_PARSE_OBJECT *Op); + +void +CvProcessCommentState ( + char input); + +char* +CvAppendInlineComment ( + char *InlineComment, + char *ToAdd); + +void +CvAddToCommentList ( + char* ToAdd); + +void +CvPlaceComment ( + UINT8 Type, + char *CommentString); + +UINT32 +CvParseOpBlockType ( + ACPI_PARSE_OBJECT *Op); + +ACPI_COMMENT_NODE* +CvCommentNodeCalloc ( + void); + +void +CgWriteAmlDefBlockComment ( + ACPI_PARSE_OBJECT *Op); + +void +CgWriteOneAmlComment ( + ACPI_PARSE_OBJECT *Op, + char* CommentToPrint, + UINT8 InputOption); + +void +CgWriteAmlComment ( + ACPI_PARSE_OBJECT *Op); + + +/* + * cvparser + */ +void +CvInitFileTree ( + ACPI_TABLE_HEADER *Table, + UINT8 *AmlStart, + UINT32 AmlLength); + +void +CvClearOpComments ( + ACPI_PARSE_OBJECT *Op); + +ACPI_FILE_NODE* +CvFilenameExists ( + char *Filename, + ACPI_FILE_NODE *Head); + +void +CvLabelFileNode ( + ACPI_PARSE_OBJECT *Op); + +void +CvCaptureListComments ( + ACPI_PARSE_STATE *ParserState, + ACPI_COMMENT_NODE *ListHead, + ACPI_COMMENT_NODE *ListTail); + +void +CvCaptureCommentsOnly ( + ACPI_PARSE_STATE *ParserState); + +void +CvCaptureComments ( + ACPI_WALK_STATE *WalkState); + +void +CvTransferComments ( + ACPI_PARSE_OBJECT *Op); + +/* + * cvdisasm + */ +void +CvSwitchFiles ( + UINT32 level, + ACPI_PARSE_OBJECT *op); + +BOOLEAN +CvFileHasSwitched ( + ACPI_PARSE_OBJECT *Op); + + +void +CvCloseParenWriteComment ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level); + +void +CvCloseBraceWriteComment ( + ACPI_PARSE_OBJECT *Op, + UINT32 Level); + +void +CvPrintOneCommentList ( + ACPI_COMMENT_NODE *CommentList, + UINT32 Level); + +void +CvPrintOneCommentType ( + ACPI_PARSE_OBJECT *Op, + UINT8 CommentType, + char* EndStr, + UINT32 Level); + + +#endif + +#endif /* _ACCONVERT */ Propchange: trunk/reactos/drivers/bus/acpi/acpica/include/acconvert.h ------------------------------------------------------------------------------ svn:eol-style = native Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acdisasm.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acdisasm.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acdisasm.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -803,6 +803,11 @@ void); void +AcpiDmEmitExternal ( + ACPI_PARSE_OBJECT *NameOp, + ACPI_PARSE_OBJECT *TypeOp); + +void AcpiDmUnresolvedWarning ( UINT8 Type); @@ -1097,4 +1102,13 @@ AdDisplayStatistics ( void); + +/* + * dmwalk + */ +UINT32 +AcpiDmBlockType ( + ACPI_PARSE_OBJECT *Op); + + #endif /* __ACDISASM_H__ */ Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acglobal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acglobal.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acglobal.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -374,6 +374,50 @@ #endif +/* + * Meant for the -ca option. + */ +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentInlineComment, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentEndNodeComment, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentOpenBraceComment, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentCloseBraceComment, NULL); + +ACPI_INIT_GLOBAL (char*, AcpiGbl_RootFilename, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentFilename, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentParentFilename, NULL); +ACPI_INIT_GLOBAL (char*, AcpiGbl_CurrentIncludeFilename, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_LastListHead, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListHead, NULL); +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListTail, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListHead, NULL); +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListTail, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListHead, NULL); +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListTail, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListHead, NULL); +ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListTail, NULL); + +ACPI_INIT_GLOBAL (ACPI_COMMENT_ADDR_NODE, *AcpiGbl_CommentAddrListHead, NULL); + +ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT, *AcpiGbl_CurrentScope, NULL); + +ACPI_INIT_GLOBAL (ACPI_FILE_NODE, *AcpiGbl_FileTreeRoot, NULL); + +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_RegCommentCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_CommentAddrCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_FileCache); + +ACPI_INIT_GLOBAL (BOOLEAN, Gbl_CaptureComments, FALSE); + +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DebugAslConversion, FALSE); +ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_ConvDebugFile, NULL); + +ACPI_GLOBAL (char, AcpiGbl_TableSig[4]); + /***************************************************************************** * * Application globals Modified: trunk/reactos/drivers/bus/acpi/acpica/include/aclocal.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/aclocal.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/aclocal.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -54,7 +54,7 @@ /* Total number of aml opcodes defined */ -#define AML_NUM_OPCODES 0x82 +#define AML_NUM_OPCODES 0x83 /* Forward declarations */ @@ -906,21 +906,55 @@ #define ACPI_DISASM_ONLY_MEMBERS(a) #endif +#if defined(ACPI_ASL_COMPILER) +#define ACPI_CONVERTER_ONLY_MEMBERS(a) a; +#else +#define ACPI_CONVERTER_ONLY_MEMBERS(a) +#endif + #define ACPI_PARSE_COMMON \ - union acpi_parse_object *Parent; /* Parent op */\ - UINT8 DescriptorType; /* To differentiate various internal objs */\ - UINT8 Flags; /* Type of Op */\ - UINT16 AmlOpcode; /* AML opcode */\ - UINT8 *Aml; /* Address of declaration in AML */\ - union acpi_parse_object *Next; /* Next op */\ - ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ - ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ - UINT8 ArgListLength; /* Number of elements in the arg list */\ - ACPI_DISASM_ONLY_MEMBERS (\ - UINT16 DisasmFlags; /* Used during AML disassembly */\ - UINT8 DisasmOpcode; /* Subtype used for disassembly */\ - char *OperatorSymbol;/* Used for C-style operator name strings */\ - char AmlOpName[16]) /* Op name (debug only) */ + union acpi_parse_object *Parent; /* Parent op */\ + UINT8 DescriptorType; /* To differentiate various internal objs */\ + UINT8 Flags; /* Type of Op */\ + UINT16 AmlOpcode; /* AML opcode */\ + UINT8 *Aml; /* Address of declaration in AML */\ + union acpi_parse_object *Next; /* Next op */\ + ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ + ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ + UINT8 ArgListLength; /* Number of elements in the arg list */\ + ACPI_DISASM_ONLY_MEMBERS (\ + UINT16 DisasmFlags; /* Used during AML disassembly */\ + UINT8 DisasmOpcode; /* Subtype used for disassembly */\ + char *OperatorSymbol; /* Used for C-style operator name strings */\ + char AmlOpName[16]) /* Op name (debug only) */\ + ACPI_CONVERTER_ONLY_MEMBERS (\ + char *InlineComment; /* Inline comment */\ + char *EndNodeComment; /* End of node comment */\ + char *NameComment; /* Comment associated with the first parameter of the name node */\ + char *CloseBraceComment; /* Comments that come after } on the same as } */\ + ACPI_COMMENT_NODE *CommentList; /* comments that appears before this node */\ + ACPI_COMMENT_NODE *EndBlkComment; /* comments that at the end of a block but before ) or } */\ + char *CvFilename; /* Filename associated with this node. Used for ASL/ASL+ converter */\ + char *CvParentFilename) /* Parent filename associated with this node. Used for ASL/ASL+ converter */ + + +/* categories of comments */ + +typedef enum +{ + STANDARD_COMMENT = 1, + INLINE_COMMENT, + ENDNODE_COMMENT, + OPENBRACE_COMMENT, + CLOSE_BRACE_COMMENT, + STD_DEFBLK_COMMENT, + END_DEFBLK_COMMENT, + FILENAME_COMMENT, + PARENTFILENAME_COMMENT, + ENDBLK_COMMENT, + INCLUDE_COMMENT + +} ASL_COMMENT_TYPES; /* Internal opcodes for DisasmOpcode field above */ @@ -937,9 +971,46 @@ #define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */ #define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */ #define ACPI_DASM_IGNORE_SINGLE 0x0B /* Ignore the opcode but not it's children */ -#define ACPI_DASM_SWITCH_PREDICATE 0x0C /* Object is a predicate for a Switch or Case block */ -#define ACPI_DASM_CASE 0x0D /* If/Else is a Case in a Switch/Case block */ -#define ACPI_DASM_DEFAULT 0x0E /* Else is a Default in a Switch/Case block */ +#define ACPI_DASM_SWITCH 0x0C /* While is a Switch */ +#define ACPI_DASM_SWITCH_PREDICATE 0x0D /* Object is a predicate for a Switch or Case block */ +#define ACPI_DASM_CASE 0x0E /* If/Else is a Case in a Switch/Case block */ +#define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */ + + +/* + * List struct used in the -ca option + */ +typedef struct acpi_comment_node +{ + char *Comment; + struct acpi_comment_node *Next; + +} ACPI_COMMENT_NODE; + + +typedef struct acpi_comment_addr_node +{ + UINT8 *Addr; + struct acpi_comment_addr_node *Next; +} ACPI_COMMENT_ADDR_NODE; + +/* + * File node - used for "Include" operator file stack and + * depdendency tree for the -ca option + */ +typedef struct acpi_file_node +{ + void *File; + char *Filename; + char *FileStart; /* Points to AML and indicates when the AML for this particular file starts. */ + char *FileEnd; /* Points to AML and indicates when the AML for this particular file ends. */ + struct acpi_file_node *Next; + struct acpi_file_node *Parent; + BOOLEAN IncludeWritten; + ACPI_COMMENT_NODE *IncludeComment; + +} ACPI_FILE_NODE; + /* * Generic operation (for example: If, While, Store) @@ -975,6 +1046,8 @@ union acpi_parse_object *Child; union acpi_parse_object *ParentMethod; char *Filename; + BOOLEAN FileChanged; + char *ParentFilename; char *ExternalName; char *Namepath; char NameSeg[4]; @@ -1007,6 +1080,15 @@ } ACPI_PARSE_OBJECT; +typedef struct asl_comment_state +{ + UINT8 CommentType; + UINT32 SpacesBefore; + ACPI_PARSE_OBJECT *Latest_Parse_Node; + ACPI_PARSE_OBJECT *ParsingParenBraceNode; + BOOLEAN CaptureComments; +} ASL_COMMENT_STATE; + /* * Parse state - one state per parser invocation and each control Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acmacros.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acmacros.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acmacros.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -499,4 +499,39 @@ #define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7')) +/* + * Macors used for the ASL-/ASL+ converter utility + */ +#ifdef ACPI_ASL_COMPILER + +#define ASL_CV_LABEL_FILENODE(a) CvLabelFileNode(a); +#define ASL_CV_CAPTURE_COMMENTS_ONLY(a) CvCaptureCommentsOnly (a); +#define ASL_CV_CAPTURE_COMMENTS(a) CvCaptureComments (a); +#define ASL_CV_TRANSFER_COMMENTS(a) CvTransferComments (a); +#define ASL_CV_CLOSE_PAREN(a,b) CvCloseParenWriteComment(a,b); +#define ASL_CV_CLOSE_BRACE(a,b) CvCloseBraceWriteComment(a,b); +#define ASL_CV_SWITCH_FILES(a,b) CvSwitchFiles(a,b); +#define ASL_CV_CLEAR_OP_COMMENTS(a) CvClearOpComments(a); +#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) CvPrintOneCommentType (a,b,c,d); +#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) CvPrintOneCommentList (a,b); +#define ASL_CV_FILE_HAS_SWITCHED(a) CvFileHasSwitched(a) +#define ASL_CV_INIT_FILETREE(a,b,c) CvInitFileTree(a,b,c); + +#else + +#define ASL_CV_LABEL_FILENODE(a) +#define ASL_CV_CAPTURE_COMMENTS_ONLY(a) +#define ASL_CV_CAPTURE_COMMENTS(a) +#define ASL_CV_TRANSFER_COMMENTS(a) +#define ASL_CV_CLOSE_PAREN(a,b) AcpiOsPrintf (")"); +#define ASL_CV_CLOSE_BRACE(a,b) AcpiOsPrintf ("}"); +#define ASL_CV_SWITCH_FILES(a,b) +#define ASL_CV_CLEAR_OP_COMMENTS(a) +#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) +#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) +#define ASL_CV_FILE_HAS_SWITCHED(a) 0 +#define ASL_CV_INIT_FILETREE(a,b,c) + +#endif + #endif /* ACMACROS_H */ Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acopcode.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acopcode.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acopcode.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -91,6 +91,7 @@ #define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST) #define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA) #define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING) +#define ARGP_COMMENT_OP ARGP_LIST2 (ARGP_BYTEDATA, ARGP_COMMENT) #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET) @@ -225,6 +226,7 @@ #define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER) #define ARGI_BYTE_OP ARGI_INVALID_OPCODE #define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE +#define ARGI_COMMENT_OP ARGI_INVALID_OPCODE #define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_ANYTYPE, ARGI_ANYTYPE, ARGI_TARGETREF) #define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) #define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) Modified: trunk/reactos/drivers/bus/acpi/acpica/include/acpixf.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/acpixf.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/acpixf.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -46,7 +46,7 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20170119 +#define ACPI_CA_VERSION 0x20170303 #include "acconfig.h" #include "actypes.h" Modified: trunk/reactos/drivers/bus/acpi/acpica/include/actbl2.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/actbl2.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/actbl2.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -89,6 +89,7 @@ #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ #define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ +#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */ #ifdef ACPI_UNDEFINED_TABLES /* @@ -909,6 +910,16 @@ #define ACPI_IORT_SMMU_DVM_SUPPORTED (1) #define ACPI_IORT_SMMU_COHERENT_WALK (1<<1) +/* Global interrupt format */ + +typedef struct acpi_iort_smmu_gsi +{ + UINT32 NSgIrpt; + UINT32 NSgIrptFlags; + UINT32 NSgCfgIrpt; + UINT32 NSgCfgIrptFlags; +} ACPI_IORT_SMMU_GSI; + typedef struct acpi_iort_smmu_v3 { Modified: trunk/reactos/drivers/bus/acpi/acpica/include/amlcode.h URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/in…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/include/amlcode.h [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/include/amlcode.h [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -48,11 +48,8 @@ /* primary opcodes */ -#define AML_NULL_CHAR (UINT16) 0x00 - #define AML_ZERO_OP (UINT16) 0x00 #define AML_ONE_OP (UINT16) 0x01 -#define AML_UNASSIGNED (UINT16) 0x02 #define AML_ALIAS_OP (UINT16) 0x06 #define AML_NAME_OP (UINT16) 0x08 #define AML_BYTE_OP (UINT16) 0x0a @@ -63,17 +60,15 @@ #define AML_SCOPE_OP (UINT16) 0x10 #define AML_BUFFER_OP (UINT16) 0x11 #define AML_PACKAGE_OP (UINT16) 0x12 -#define AML_VAR_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */ +#define AML_VARIABLE_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */ #define AML_METHOD_OP (UINT16) 0x14 #define AML_EXTERNAL_OP (UINT16) 0x15 /* ACPI 6.0 */ #define AML_DUAL_NAME_PREFIX (UINT16) 0x2e -#define AML_MULTI_NAME_PREFIX_OP (UINT16) 0x2f -#define AML_NAME_CHAR_SUBSEQ (UINT16) 0x30 -#define AML_NAME_CHAR_FIRST (UINT16) 0x41 -#define AML_EXTENDED_OP_PREFIX (UINT16) 0x5b +#define AML_MULTI_NAME_PREFIX (UINT16) 0x2f +#define AML_EXTENDED_PREFIX (UINT16) 0x5b #define AML_ROOT_PREFIX (UINT16) 0x5c #define AML_PARENT_PREFIX (UINT16) 0x5e -#define AML_LOCAL_OP (UINT16) 0x60 +#define AML_FIRST_LOCAL_OP (UINT16) 0x60 /* Used for Local op # calculations */ #define AML_LOCAL0 (UINT16) 0x60 #define AML_LOCAL1 (UINT16) 0x61 #define AML_LOCAL2 (UINT16) 0x62 @@ -82,7 +77,7 @@ #define AML_LOCAL5 (UINT16) 0x65 #define AML_LOCAL6 (UINT16) 0x66 #define AML_LOCAL7 (UINT16) 0x67 -#define AML_ARG_OP (UINT16) 0x68 +#define AML_FIRST_ARG_OP (UINT16) 0x68 /* Used for Arg op # calculations */ #define AML_ARG0 (UINT16) 0x68 #define AML_ARG1 (UINT16) 0x69 #define AML_ARG2 (UINT16) 0x6a @@ -93,7 +88,7 @@ #define AML_STORE_OP (UINT16) 0x70 #define AML_REF_OF_OP (UINT16) 0x71 #define AML_ADD_OP (UINT16) 0x72 -#define AML_CONCAT_OP (UINT16) 0x73 +#define AML_CONCATENATE_OP (UINT16) 0x73 #define AML_SUBTRACT_OP (UINT16) 0x74 #define AML_INCREMENT_OP (UINT16) 0x75 #define AML_DECREMENT_OP (UINT16) 0x76 @@ -110,7 +105,7 @@ #define AML_FIND_SET_LEFT_BIT_OP (UINT16) 0x81 #define AML_FIND_SET_RIGHT_BIT_OP (UINT16) 0x82 #define AML_DEREF_OF_OP (UINT16) 0x83 -#define AML_CONCAT_RES_OP (UINT16) 0x84 /* ACPI 2.0 */ +#define AML_CONCATENATE_TEMPLATE_OP (UINT16) 0x84 /* ACPI 2.0 */ #define AML_MOD_OP (UINT16) 0x85 /* ACPI 2.0 */ #define AML_NOTIFY_OP (UINT16) 0x86 #define AML_SIZE_OF_OP (UINT16) 0x87 @@ -122,18 +117,18 @@ #define AML_CREATE_BIT_FIELD_OP (UINT16) 0x8d #define AML_OBJECT_TYPE_OP (UINT16) 0x8e #define AML_CREATE_QWORD_FIELD_OP (UINT16) 0x8f /* ACPI 2.0 */ -#define AML_LAND_OP (UINT16) 0x90 -#define AML_LOR_OP (UINT16) 0x91 -#define AML_LNOT_OP (UINT16) 0x92 -#define AML_LEQUAL_OP (UINT16) 0x93 -#define AML_LGREATER_OP (UINT16) 0x94 -#define AML_LLESS_OP (UINT16) 0x95 +#define AML_LOGICAL_AND_OP (UINT16) 0x90 +#define AML_LOGICAL_OR_OP (UINT16) 0x91 +#define AML_LOGICAL_NOT_OP (UINT16) 0x92 +#define AML_LOGICAL_EQUAL_OP (UINT16) 0x93 +#define AML_LOGICAL_GREATER_OP (UINT16) 0x94 +#define AML_LOGICAL_LESS_OP (UINT16) 0x95 #define AML_TO_BUFFER_OP (UINT16) 0x96 /* ACPI 2.0 */ -#define AML_TO_DECSTRING_OP (UINT16) 0x97 /* ACPI 2.0 */ -#define AML_TO_HEXSTRING_OP (UINT16) 0x98 /* ACPI 2.0 */ +#define AML_TO_DECIMAL_STRING_OP (UINT16) 0x97 /* ACPI 2.0 */ +#define AML_TO_HEX_STRING_OP (UINT16) 0x98 /* ACPI 2.0 */ #define AML_TO_INTEGER_OP (UINT16) 0x99 /* ACPI 2.0 */ #define AML_TO_STRING_OP (UINT16) 0x9c /* ACPI 2.0 */ -#define AML_COPY_OP (UINT16) 0x9d /* ACPI 2.0 */ +#define AML_COPY_OBJECT_OP (UINT16) 0x9d /* ACPI 2.0 */ #define AML_MID_OP (UINT16) 0x9e /* ACPI 2.0 */ #define AML_CONTINUE_OP (UINT16) 0x9f /* ACPI 2.0 */ #define AML_IF_OP (UINT16) 0xa0 @@ -142,18 +137,29 @@ #define AML_NOOP_OP (UINT16) 0xa3 #define AML_RETURN_OP (UINT16) 0xa4 #define AML_BREAK_OP (UINT16) 0xa5 -#define AML_BREAK_POINT_OP (UINT16) 0xcc +#define AML_COMMENT_OP (UINT16) 0xa9 +#define AML_BREAKPOINT_OP (UINT16) 0xcc #define AML_ONES_OP (UINT16) 0xff -/* prefixed opcodes */ - -#define AML_EXTENDED_OPCODE (UINT16) 0x5b00 /* prefix for 2-byte opcodes */ + +/* + * Combination opcodes (actually two one-byte opcodes) + * Used by the disassembler and iASL compiler + */ +#define AML_LOGICAL_GREATER_EQUAL_OP (UINT16) 0x9295 /* LNot (LLess) */ +#define AML_LOGICAL_LESS_EQUAL_OP (UINT16) 0x9294 /* LNot (LGreater) */ +#define AML_LOGICAL_NOT_EQUAL_OP (UINT16) 0x9293 /* LNot (LEqual) */ + + +/* Prefixed (2-byte) opcodes (with AML_EXTENDED_PREFIX) */ + +#define AML_EXTENDED_OPCODE (UINT16) 0x5b00 /* Prefix for 2-byte opcodes */ #define AML_MUTEX_OP (UINT16) 0x5b01 #define AML_EVENT_OP (UINT16) 0x5b02 -#define AML_SHIFT_RIGHT_BIT_OP (UINT16) 0x5b10 -#define AML_SHIFT_LEFT_BIT_OP (UINT16) 0x5b11 -#define AML_COND_REF_OF_OP (UINT16) 0x5b12 +#define AML_SHIFT_RIGHT_BIT_OP (UINT16) 0x5b10 /* Obsolete, not in ACPI spec */ +#define AML_SHIFT_LEFT_BIT_OP (UINT16) 0x5b11 /* Obsolete, not in ACPI spec */ +#define AML_CONDITIONAL_REF_OF_OP (UINT16) 0x5b12 #define AML_CREATE_FIELD_OP (UINT16) 0x5b13 #define AML_LOAD_TABLE_OP (UINT16) 0x5b1f /* ACPI 2.0 */ #define AML_LOAD_OP (UINT16) 0x5b20 @@ -175,20 +181,11 @@ #define AML_FIELD_OP (UINT16) 0x5b81 #define AML_DEVICE_OP (UINT16) 0x5b82 #define AML_PROCESSOR_OP (UINT16) 0x5b83 -#define AML_POWER_RES_OP (UINT16) 0x5b84 +#define AML_POWER_RESOURCE_OP (UINT16) 0x5b84 #define AML_THERMAL_ZONE_OP (UINT16) 0x5b85 #define AML_INDEX_FIELD_OP (UINT16) 0x5b86 #define AML_BANK_FIELD_OP (UINT16) 0x5b87 #define AML_DATA_REGION_OP (UINT16) 0x5b88 /* ACPI 2.0 */ - - -/* - * Combination opcodes (actually two one-byte opcodes) - * Used by the disassembler and iASL compiler - */ -#define AML_LGREATEREQUAL_OP (UINT16) 0x9295 -#define AML_LLESSEQUAL_OP (UINT16) 0x9294 -#define AML_LNOTEQUAL_OP (UINT16) 0x9293 /* @@ -244,6 +241,7 @@ #define ARGP_SIMPLENAME 0x12 /* NameString | LocalTerm | ArgTerm */ #define ARGP_NAME_OR_REF 0x13 /* For ObjectType only */ #define ARGP_MAX 0x13 +#define ARGP_COMMENT 0x14 /* * Resolved argument types for the AML Interpreter @@ -313,26 +311,19 @@ /* - * hash offsets - */ -#define AML_EXTOP_HASH_OFFSET 22 -#define AML_LNOT_HASH_OFFSET 19 - - -/* - * opcode groups and types - */ -#define OPGRP_NAMED 0x01 -#define OPGRP_FIELD 0x02 -#define OPGRP_BYTELIST 0x04 - - -/* - * Opcode information - */ - -/* Opcode flags */ - + * Some of the flags and types below are of the form: + * + * AML_FLAGS_EXEC_#A_#T,#R, or + * AML_TYPE_EXEC_#A_#T,#R where: + * + * #A is the number of required arguments + * #T is the number of target operands + * #R indicates whether there is a return value + */ + +/* + * Opcode information flags + */ #define AML_LOGICAL 0x0001 #define AML_LOGICAL_NUMERIC 0x0002 #define AML_MATH 0x0004 @@ -349,7 +340,7 @@ #define AML_CONSTANT 0x2000 #define AML_NO_OPERAND_RESOLVE 0x4000 -/* Convenient flag groupings */ +/* Convenient flag groupings of the flags above */ #define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL #define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ @@ -367,7 +358,7 @@ /* * The opcode Type is used in a dispatch table, do not change - * without updating the table. + * or add anything new without updating the table. */ #define AML_TYPE_EXEC_0A_0T_1R 0x00 #define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ @@ -393,7 +384,7 @@ #define AML_TYPE_METHOD_CALL 0x10 -/* Misc */ +/* Miscellaneous types */ #define AML_TYPE_CREATE_FIELD 0x11 #define AML_TYPE_CREATE_OBJECT 0x12 @@ -403,7 +394,6 @@ #define AML_TYPE_NAMED_SIMPLE 0x16 #define AML_TYPE_NAMED_COMPLEX 0x17 #define AML_TYPE_RETURN 0x18 - #define AML_TYPE_UNDEFINED 0x19 #define AML_TYPE_BOGUS 0x1A Modified: trunk/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/na…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -505,7 +505,7 @@ "Dual Pathname (2 segments, Flags=%X)\n", Flags)); break; - case AML_MULTI_NAME_PREFIX_OP: + case AML_MULTI_NAME_PREFIX: /* More than one NameSeg, search rules do not apply */ Modified: trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/na…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -302,24 +302,12 @@ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) { - /* - * The original object is a package element. We need to - * decrement the reference count of the original object, - * for removing it from the package. - * - * However, if the original object was just wrapped with a - * package object as part of the repair, we don't need to - * change the reference count. - */ + /* Update reference count of new object */ + if (!(Info->ReturnFlags & ACPI_OBJECT_WRAPPED)) { NewObject->Common.ReferenceCount = ReturnObject->Common.ReferenceCount; - - if (ReturnObject->Common.ReferenceCount > 1) - { - ReturnObject->Common.ReferenceCount--; - } } ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, Modified: trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/na…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -448,16 +448,12 @@ return (Status); } - /* Take care with reference counts */ - if (OriginalElement != *ElementPtr) { - /* Element was replaced */ + /* Update reference count of new object */ (*ElementPtr)->Common.ReferenceCount = OriginalRefCount; - - AcpiUtRemoveReference (OriginalElement); } ElementPtr++; Modified: trunk/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/na…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -294,7 +294,7 @@ } else { - InternalName[1] = AML_MULTI_NAME_PREFIX_OP; + InternalName[1] = AML_MULTI_NAME_PREFIX; InternalName[2] = (char) NumSegments; Result = &InternalName[3]; } @@ -325,7 +325,7 @@ } else { - InternalName[i] = AML_MULTI_NAME_PREFIX_OP; + InternalName[i] = AML_MULTI_NAME_PREFIX; InternalName[(ACPI_SIZE) i+1] = (char) NumSegments; Result = &InternalName[(ACPI_SIZE) i+2]; } @@ -534,7 +534,7 @@ { switch (InternalName[PrefixLength]) { - case AML_MULTI_NAME_PREFIX_OP: + case AML_MULTI_NAME_PREFIX: /* <count> 4-byte names */ @@ -694,28 +694,23 @@ void) { ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *Prev; + ACPI_OPERAND_OBJECT *Next; ACPI_FUNCTION_TRACE (NsTerminate); -#ifdef ACPI_EXEC_APP - { - ACPI_OPERAND_OBJECT *Prev; - ACPI_OPERAND_OBJECT *Next; - - /* Delete any module-level code blocks */ - - Next = AcpiGbl_ModuleCodeList; - while (Next) - { - Prev = Next; - Next = Next->Method.Mutex; - Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */ - AcpiUtRemoveReference (Prev); - } - } -#endif + /* Delete any module-level code blocks */ + + Next = AcpiGbl_ModuleCodeList; + while (Next) + { + Prev = Next; + Next = Next->Method.Mutex; + Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */ + AcpiUtRemoveReference (Prev); + } /* * Free the entire namespace -- all nodes and all objects Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psargs.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psargs.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psargs.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -47,6 +47,7 @@ #include "amlcode.h" #include "acnamesp.h" #include "acdispat.h" +#include "acconvert.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psargs") @@ -208,7 +209,7 @@ End += 1 + (2 * ACPI_NAME_SIZE); break; - case AML_MULTI_NAME_PREFIX_OP: + case AML_MULTI_NAME_PREFIX: /* Multiple name segments, 4 chars each, count in next byte */ @@ -369,7 +370,7 @@ /* 2) NotFound during a CondRefOf(x) is ok by definition */ - else if (WalkState->Op->Common.AmlOpcode == AML_COND_REF_OF_OP) + else if (WalkState->Op->Common.AmlOpcode == AML_CONDITIONAL_REF_OF_OP) { Status = AE_OK; } @@ -381,7 +382,7 @@ */ else if ((Arg->Common.Parent) && ((Arg->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || - (Arg->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))) + (Arg->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP))) { Status = AE_OK; } @@ -543,6 +544,7 @@ ACPI_FUNCTION_TRACE (PsGetNextField); + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); Aml = ParserState->Aml; /* Determine field type */ @@ -589,6 +591,7 @@ /* Decode the field type */ + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); switch (Opcode) { case AML_INT_NAMEDFIELD_OP: @@ -598,6 +601,23 @@ ACPI_MOVE_32_TO_32 (&Name, ParserState->Aml); AcpiPsSetName (Field, Name); ParserState->Aml += ACPI_NAME_SIZE; + + + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); + +#ifdef ACPI_ASL_COMPILER + /* + * Because the package length isn't represented as a parse tree object, + * take comments surrounding this and add to the previously created + * parse node. + */ + if (Field->Common.InlineComment) + { + Field->Common.NameComment = Field->Common.InlineComment; + } + Field->Common.InlineComment = AcpiGbl_CurrentInlineComment; + AcpiGbl_CurrentInlineComment = NULL; +#endif /* Get the length which is encoded as a package length */ @@ -655,10 +675,12 @@ { ParserState->Aml++; + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); PkgEnd = ParserState->Aml; PkgLength = AcpiPsGetNextPackageLength (ParserState); PkgEnd += PkgLength; + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); if (ParserState->Aml < PkgEnd) { /* Non-empty list */ @@ -675,6 +697,7 @@ Opcode = ACPI_GET8 (ParserState->Aml); ParserState->Aml++; + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); switch (Opcode) { case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ @@ -703,6 +726,7 @@ /* Fill in bytelist data */ + ASL_CV_CAPTURE_COMMENTS_ONLY (ParserState); Arg->Named.Value.Size = BufferLength; Arg->Named.Data = ParserState->Aml; } Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psloop.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psloop.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psloop.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -55,6 +55,7 @@ #include "acparser.h" #include "acdispat.h" #include "amlcode.h" +#include "acconvert.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psloop") @@ -141,6 +142,22 @@ !WalkState->ArgCount) { WalkState->Aml = WalkState->ParserState.Aml; + + switch (Op->Common.AmlOpcode) + { + case AML_METHOD_OP: + case AML_BUFFER_OP: + case AML_PACKAGE_OP: + case AML_VARIABLE_PACKAGE_OP: + case AML_WHILE_OP: + + break; + + default: + + ASL_CV_CAPTURE_COMMENTS (WalkState); + break; + } Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState), GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); @@ -249,7 +266,7 @@ case AML_BUFFER_OP: case AML_PACKAGE_OP: - case AML_VAR_PACKAGE_OP: + case AML_VARIABLE_PACKAGE_OP: if ((Op->Common.Parent) && (Op->Common.Parent->Common.AmlOpcode == AML_NAME_OP) && @@ -487,6 +504,8 @@ while ((ParserState->Aml < ParserState->AmlEnd) || (Op)) { + ASL_CV_CAPTURE_COMMENTS (WalkState); + AmlOpStart = ParserState->Aml; if (!Op) { @@ -519,13 +538,27 @@ AcpiExStartTraceOpcode (Op, WalkState); } - /* * Start ArgCount at zero because we don't know if there are * any args yet */ - WalkState->ArgCount = 0; + WalkState->ArgCount = 0; + + switch (Op->Common.AmlOpcode) + { + case AML_BYTE_OP: + case AML_WORD_OP: + case AML_DWORD_OP: + case AML_QWORD_OP: + + break; + + default: + + ASL_CV_CAPTURE_COMMENTS (WalkState); + break; + } /* Are there any arguments that must be processed? */ Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psobject.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psobject.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psobject.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -45,6 +45,7 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" +#include "acconvert.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psobject") @@ -201,6 +202,7 @@ while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)) { + ASL_CV_CAPTURE_COMMENTS (WalkState); Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState), GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); if (ACPI_FAILURE (Status)) @@ -211,6 +213,18 @@ AcpiPsAppendArg (UnnamedOp, Arg); INCREMENT_ARG_LIST (WalkState->ArgTypes); } + + /* are there any inline comments associated with the NameSeg?? If so, save this. */ + + ASL_CV_CAPTURE_COMMENTS (WalkState); + +#ifdef ACPI_ASL_COMPILER + if (AcpiGbl_CurrentInlineComment != NULL) + { + UnnamedOp->Common.NameComment = AcpiGbl_CurrentInlineComment; + AcpiGbl_CurrentInlineComment = NULL; + } +#endif /* * Make sure that we found a NAME and didn't run out of arguments @@ -256,6 +270,28 @@ } AcpiPsAppendArg (*Op, UnnamedOp->Common.Value.Arg); + +#ifdef ACPI_ASL_COMPILER + + /* save any comments that might be associated with UnnamedOp. */ + + (*Op)->Common.InlineComment = UnnamedOp->Common.InlineComment; + (*Op)->Common.EndNodeComment = UnnamedOp->Common.EndNodeComment; + (*Op)->Common.CloseBraceComment = UnnamedOp->Common.CloseBraceComment; + (*Op)->Common.NameComment = UnnamedOp->Common.NameComment; + (*Op)->Common.CommentList = UnnamedOp->Common.CommentList; + (*Op)->Common.EndBlkComment = UnnamedOp->Common.EndBlkComment; + (*Op)->Common.CvFilename = UnnamedOp->Common.CvFilename; + (*Op)->Common.CvParentFilename = UnnamedOp->Common.CvParentFilename; + (*Op)->Named.Aml = UnnamedOp->Common.Aml; + + UnnamedOp->Common.InlineComment = NULL; + UnnamedOp->Common.EndNodeComment = NULL; + UnnamedOp->Common.CloseBraceComment = NULL; + UnnamedOp->Common.NameComment = NULL; + UnnamedOp->Common.CommentList = NULL; + UnnamedOp->Common.EndBlkComment = NULL; +#endif if ((*Op)->Common.AmlOpcode == AML_REGION_OP || (*Op)->Common.AmlOpcode == AML_DATA_REGION_OP) Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psopcode.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psopcode.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psopcode.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -72,7 +72,7 @@ AML_DEVICE_OP AML_THERMAL_ZONE_OP AML_METHOD_OP - AML_POWER_RES_OP + AML_POWER_RESOURCE_OP AML_PROCESSOR_OP AML_FIELD_OP AML_INDEX_FIELD_OP @@ -98,7 +98,7 @@ AML_DEVICE_OP AML_THERMAL_ZONE_OP AML_METHOD_OP - AML_POWER_RES_OP + AML_POWER_RESOURCE_OP AML_PROCESSOR_OP AML_FIELD_OP AML_INDEX_FIELD_OP @@ -116,7 +116,7 @@ AML_DEVICE_OP AML_THERMAL_ZONE_OP AML_METHOD_OP - AML_POWER_RES_OP + AML_POWER_RESOURCE_OP AML_PROCESSOR_OP AML_NAME_OP AML_ALIAS_OP @@ -139,7 +139,7 @@ AML_DEVICE_OP AML_THERMAL_ZONE_OP AML_METHOD_OP - AML_POWER_RES_OP + AML_POWER_RESOURCE_OP AML_PROCESSOR_OP AML_NAME_OP AML_ALIAS_OP @@ -152,7 +152,7 @@ must be deferred until needed AML_METHOD_OP - AML_VAR_PACKAGE_OP + AML_VARIABLE_PACKAGE_OP AML_CREATE_FIELD_OP AML_CREATE_BIT_FIELD_OP AML_CREATE_BYTE_FIELD_OP @@ -337,7 +337,8 @@ /* ACPI 6.0 opcodes */ -/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R) +/* 81 */ ACPI_OP ("External", ARGP_EXTERNAL_OP, ARGI_EXTERNAL_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE,/* ? */ AML_TYPE_EXEC_3A_0T_0R, AML_FLAGS_EXEC_3A_0T_0R), +/* 82 */ ACPI_OP ("Comment", ARGP_COMMENT_OP, ARGI_COMMENT_OP, ACPI_TYPE_STRING, AML_CLASS_ARGUMENT, AML_TYPE_LITERAL, AML_CONSTANT) /*! [End] no source code translation !*/ }; Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -242,7 +242,7 @@ /* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74, /* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A, /* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61, -/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xA8 */ 0x62, 0x82, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, /* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psparse.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psparse.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psparse.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -114,7 +114,7 @@ Aml = ParserState->Aml; Opcode = (UINT16) ACPI_GET8 (Aml); - if (Opcode == AML_EXTENDED_OP_PREFIX) + if (Opcode == AML_EXTENDED_PREFIX) { /* Extended opcode, get the second opcode byte */ @@ -218,7 +218,7 @@ (Op->Common.Parent->Common.AmlOpcode == AML_BUFFER_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_PACKAGE_OP) || (Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) || - (Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) + (Op->Common.Parent->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) { ReplacementOp = AcpiPsAllocOp ( AML_INT_RETURN_VALUE_OP, Op->Common.Aml); @@ -232,7 +232,7 @@ { if ((Op->Common.AmlOpcode == AML_BUFFER_OP) || (Op->Common.AmlOpcode == AML_PACKAGE_OP) || - (Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP)) + (Op->Common.AmlOpcode == AML_VARIABLE_PACKAGE_OP)) { ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode, Op->Common.Aml); Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/pstree.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/pstree.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/pstree.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -45,6 +45,7 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" +#include "acconvert.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("pstree") @@ -242,6 +243,7 @@ Next = AcpiPsGetArg (Op, 0); if (Next) { + ASL_CV_LABEL_FILENODE (Next); return (Next); } @@ -250,6 +252,7 @@ Next = Op->Common.Next; if (Next) { + ASL_CV_LABEL_FILENODE (Next); return (Next); } @@ -262,6 +265,8 @@ Arg = AcpiPsGetArg (Parent, 0); while (Arg && (Arg != Origin) && (Arg != Op)) { + + ASL_CV_LABEL_FILENODE (Arg); Arg = Arg->Common.Next; } @@ -276,6 +281,7 @@ { /* Found sibling of parent */ + ASL_CV_LABEL_FILENODE (Parent->Common.Next); return (Parent->Common.Next); } @@ -283,6 +289,7 @@ Parent = Parent->Common.Parent; } + ASL_CV_LABEL_FILENODE (Next); return (Next); } @@ -331,7 +338,7 @@ Child = AcpiPsGetArg (Op, 1); break; - case AML_POWER_RES_OP: + case AML_POWER_RESOURCE_OP: case AML_INDEX_FIELD_OP: Child = AcpiPsGetArg (Op, 2); Modified: trunk/reactos/drivers/bus/acpi/acpica/parser/psutils.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/pa…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/parser/psutils.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/parser/psutils.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -45,6 +45,7 @@ #include "accommon.h" #include "acparser.h" #include "amlcode.h" +#include "acconvert.h" #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psutils") @@ -177,6 +178,17 @@ AcpiPsInitOp (Op, Opcode); Op->Common.Aml = Aml; Op->Common.Flags = Flags; + ASL_CV_CLEAR_OP_COMMENTS(Op); + + if (Opcode == AML_SCOPE_OP) + { + AcpiGbl_CurrentScope = Op; + } + } + + if (Gbl_CaptureComments) + { + ASL_CV_TRANSFER_COMMENTS (Op); } return (Op); @@ -203,6 +215,7 @@ ACPI_FUNCTION_NAME (PsFreeOp); + ASL_CV_CLEAR_OP_COMMENTS(Op); if (Op->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP) { ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, Modified: trunk/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ut…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -144,6 +144,40 @@ return (Status); } +#ifdef ACPI_ASL_COMPILER + /* + * For use with the ASL-/ASL+ option. This cache keeps track of regular + * 0xA9 0x01 comments. + */ + Status = AcpiOsCreateCache ("Acpi-Comment", sizeof (ACPI_COMMENT_NODE), + ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_RegCommentCache); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * This cache keeps track of the starting addresses of where the comments + * lie. This helps prevent duplication of comments. + */ + Status = AcpiOsCreateCache ("Acpi-Comment-Addr", sizeof (ACPI_COMMENT_ADDR_NODE), + ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_CommentAddrCache); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * This cache will be used for nodes that represent files. + */ + Status = AcpiOsCreateCache ("Acpi-File", sizeof (ACPI_FILE_NODE), + ACPI_MAX_COMMENT_CACHE_DEPTH, &AcpiGbl_FileCache); + if (ACPI_FAILURE (Status)) + { + return (Status); + } +#endif + #ifdef ACPI_DBG_TRACK_ALLOCATIONS @@ -210,6 +244,16 @@ (void) AcpiOsDeleteCache (AcpiGbl_PsNodeExtCache); AcpiGbl_PsNodeExtCache = NULL; +#ifdef ACPI_ASL_COMPILER + (void) AcpiOsDeleteCache (AcpiGbl_RegCommentCache); + AcpiGbl_RegCommentCache = NULL; + + (void) AcpiOsDeleteCache (AcpiGbl_CommentAddrCache); + AcpiGbl_CommentAddrCache = NULL; + + (void) AcpiOsDeleteCache (AcpiGbl_FileCache); + AcpiGbl_FileCache = NULL; +#endif #ifdef ACPI_DBG_TRACK_ALLOCATIONS Modified: trunk/reactos/drivers/bus/acpi/acpica/utilities/utcache.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ut…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/utilities/utcache.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/utilities/utcache.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -77,7 +77,7 @@ ACPI_FUNCTION_ENTRY (); - if (!CacheName || !ReturnCache || (ObjectSize < 16)) + if (!CacheName || !ReturnCache || !ObjectSize) { return (AE_BAD_PARAMETER); } Modified: trunk/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ut…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -707,4 +707,5 @@ ACPI_EXPORT_SYMBOL (AcpiTracePoint) + #endif Modified: trunk/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ut…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -526,6 +526,16 @@ return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } + /* + * The EndTag opcode must be followed by a zero byte. + * Although this byte is technically defined to be a checksum, + * in practice, all ASL compilers set this byte to zero. + */ + if (*(Aml + 1) != 0) + { + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); + } + /* Return the pointer to the EndTag if requested */ if (!UserFunction) Modified: trunk/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/bus/acpi/acpica/ut…
============================================================================== --- trunk/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c [iso-8859-1] (original) +++ trunk/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c [iso-8859-1] Sat Mar 4 16:54:26 2017 @@ -101,7 +101,7 @@ * * PARAMETERS: ModuleName - Caller's module name (for error output) * LineNumber - Caller's line number (for error output) - * Status - Status to be formatted + * Status - Status value to be decoded/formatted * Format - Printf format string + additional args * * RETURN: None @@ -152,89 +152,85 @@ * * FUNCTION: AcpiWarning * + * PARAMETERS: ModuleName - Caller's module name (for warning output) + * LineNumber - Caller's line number (for warning output) + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Print "ACPI Warning" message with module/line/version info + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiWarning ( + const char *ModuleName, + UINT32 LineNumber, + const char *Format, + ...) +{ + va_list ArgList; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_WARNING); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); + + ACPI_MSG_REDIRECT_END; +} + +ACPI_EXPORT_SYMBOL (AcpiWarning) + + +/******************************************************************************* + * + * FUNCTION: AcpiInfo + * + * PARAMETERS: Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Print generic "ACPI:" information message. There is no + * module/line/version info in order to keep the message simple. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiInfo ( + const char *Format, + ...) +{ + va_list ArgList; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_INFO); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + AcpiOsPrintf ("\n"); + va_end (ArgList); + + ACPI_MSG_REDIRECT_END; +} + +ACPI_EXPORT_SYMBOL (AcpiInfo) + + +/******************************************************************************* + * + * FUNCTION: AcpiBiosError + * * PARAMETERS: ModuleName - Caller's module name (for error output) * LineNumber - Caller's line number (for error output) * Format - Printf format string + additional args * * RETURN: None * - * DESCRIPTION: Print "ACPI Warning" message with module/line/version info - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiWarning ( - const char *ModuleName, - UINT32 LineNumber, - const char *Format, - ...) -{ - va_list ArgList; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_WARNING); - - va_start (ArgList, Format); - AcpiOsVprintf (Format, ArgList); - ACPI_MSG_SUFFIX; - va_end (ArgList); - - ACPI_MSG_REDIRECT_END; -} - -ACPI_EXPORT_SYMBOL (AcpiWarning) - - -/******************************************************************************* - * - * FUNCTION: AcpiInfo - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Format - Printf format string + additional args - * - * RETURN: None - * - * DESCRIPTION: Print generic "ACPI:" information message. There is no - * module/line/version info in order to keep the message simple. - * - * TBD: ModuleName and LineNumber args are not needed, should be removed. - * - ******************************************************************************/ - -void ACPI_INTERNAL_VAR_XFACE -AcpiInfo ( - const char *Format, - ...) -{ - va_list ArgList; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_INFO); - - va_start (ArgList, Format); - AcpiOsVprintf (Format, ArgList); - AcpiOsPrintf ("\n"); - va_end (ArgList); - - ACPI_MSG_REDIRECT_END; -} - -ACPI_EXPORT_SYMBOL (AcpiInfo) - - -/******************************************************************************* - * - * FUNCTION: AcpiBiosError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Format - Printf format string + additional args - * - * RETURN: None - * * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version * info * @@ -268,8 +264,8 @@ * * FUNCTION: AcpiBiosWarning * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) + * PARAMETERS: ModuleName - Caller's module name (for warning output) + * LineNumber - Caller's line number (for warning output) * Format - Printf format string + additional args * * RETURN: None
7 years, 9 months
1
0
0
0
[tfaber] 74055: [BOOTDATA] - Support integrating Intel's DC21x4 network card driver (for Hyper-V/VirtualPC) into our ISOs until we have our own. CORE-8724
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 16:29:51 2017 New Revision: 74055 URL:
http://svn.reactos.org/svn/reactos?rev=74055&view=rev
Log: [BOOTDATA] - Support integrating Intel's DC21x4 network card driver (for Hyper-V/VirtualPC) into our ISOs until we have our own. CORE-8724 Modified: trunk/reactos/boot/bootdata/packages/reactos.dff.in Modified: trunk/reactos/boot/bootdata/packages/reactos.dff.in URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/rea…
============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff.in [iso-8859-1] Sat Mar 4 16:29:51 2017 @@ -92,6 +92,8 @@ "modules/optional/bcmwl5.sys" 2 optional "modules/optional/alcxwdm.inf" 6 optional "modules/optional/alcxwdm.sys" 2 optional +"modules/optional/net21x4.inf" 6 optional +"modules/optional/dc21x4.sys" 2 optional "modules/optional/mfc42.dll" 1 optional "modules/optional/mfc42u.dll" 1 optional "modules/optional/mfc71.dll" 1 optional
7 years, 9 months
1
0
0
0
[ekohl] 74054: [NTOS:OB] Create a custom security descriptor for the global DosDevices directory.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Mar 4 16:02:06 2017 New Revision: 74054 URL:
http://svn.reactos.org/svn/reactos?rev=74054&view=rev
Log: [NTOS:OB] Create a custom security descriptor for the global DosDevices directory. Modified: trunk/reactos/ntoskrnl/ob/obname.c Modified: trunk/reactos/ntoskrnl/ob/obname.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obname.c?rev=7…
============================================================================== --- trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ob/obname.c [iso-8859-1] Sat Mar 4 16:02:06 2017 @@ -34,12 +34,114 @@ NTSTATUS NTAPI INIT_FUNCTION +ObpCreateGlobalDosDevicesSD(OUT PSECURITY_DESCRIPTOR SecurityDescriptor) +{ + ULONG AclLength; + PACL Dacl; + NTSTATUS Status; + + /* Initialize the SD */ + Status = RtlCreateSecurityDescriptor(SecurityDescriptor, + SECURITY_DESCRIPTOR_REVISION); + if (!NT_SUCCESS(Status)) + return Status; + + /* Allocate the DACL */ + AclLength = sizeof(ACL) + + sizeof(ACE) + RtlLengthSid(SeWorldSid) + + sizeof(ACE) + RtlLengthSid(SeLocalSystemSid) + + sizeof(ACE) + RtlLengthSid(SeWorldSid) + + sizeof(ACE) + RtlLengthSid(SeAliasAdminsSid) + + sizeof(ACE) + RtlLengthSid(SeLocalSystemSid) + + sizeof(ACE) + RtlLengthSid(SeCreatorOwnerSid); + + Dacl = ExAllocatePool(PagedPool, AclLength); + if (Dacl == NULL) + { + return STATUS_NO_MEMORY; + } + + /* Initialize the DACL */ + RtlCreateAcl(Dacl, AclLength, ACL_REVISION); + + /* Add the ACEs */ + RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + GENERIC_READ | GENERIC_EXECUTE, + SeWorldSid); + + RtlAddAccessAllowedAce(Dacl, + ACL_REVISION, + GENERIC_ALL, + SeLocalSystemSid); + + RtlAddAccessAllowedAceEx(Dacl, + ACL_REVISION, + INHERIT_ONLY_ACE | CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE, + GENERIC_EXECUTE, + SeWorldSid); + + RtlAddAccessAllowedAceEx(Dacl, + ACL_REVISION, + INHERIT_ONLY_ACE | CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE, + GENERIC_ALL, + SeAliasAdminsSid); + + RtlAddAccessAllowedAceEx(Dacl, + ACL_REVISION, + INHERIT_ONLY_ACE | CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE, + GENERIC_ALL, + SeLocalSystemSid); + + RtlAddAccessAllowedAceEx(Dacl, + ACL_REVISION, + INHERIT_ONLY_ACE | CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE, + GENERIC_ALL, + SeCreatorOwnerSid); + + /* Attach the DACL to the SD */ + Status = RtlSetDaclSecurityDescriptor(SecurityDescriptor, + TRUE, + Dacl, + FALSE); + + return Status; +} + +VOID +NTAPI +INIT_FUNCTION +ObpFreeGlobalDosDevicesSD(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor) +{ + PACL Dacl = NULL; + BOOLEAN DaclPresent, Defaulted; + NTSTATUS Status; + + Status = RtlGetDaclSecurityDescriptor(SecurityDescriptor, + &DaclPresent, + &Dacl, + &Defaulted); + if (NT_SUCCESS(Status) && Dacl != NULL) + { + ExFreePool(Dacl); + } +} + +NTSTATUS +NTAPI +INIT_FUNCTION ObpCreateDosDevicesDirectory(VOID) { OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING RootName, TargetName, LinkName; HANDLE Handle, SymHandle; + SECURITY_DESCRIPTOR DosDevicesSD; NTSTATUS Status; + + /* Create a custom security descriptor for the global DosDevices directory */ + Status = ObpCreateGlobalDosDevicesSD(&DosDevicesSD); + if (!NT_SUCCESS(Status)) + return Status; /* Create the global DosDevices directory \?? */ RtlInitUnicodeString(&RootName, L"\\GLOBAL??"); @@ -47,10 +149,11 @@ &RootName, OBJ_PERMANENT, NULL, - NULL); + &DosDevicesSD); Status = NtCreateDirectoryObject(&Handle, DIRECTORY_ALL_ACCESS, &ObjectAttributes); + ObpFreeGlobalDosDevicesSD(&DosDevicesSD); if (!NT_SUCCESS(Status)) return Status; /*********************************************\
7 years, 9 months
1
0
0
0
[tfaber] 74053: [NTOS:PNP] - Make device instance paths unique if necessary (by adding the parent ID prefix), regardless of the return status from IRP_MN_QUERY_ID/BusQueryInstanceID. Support for th...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 16:01:59 2017 New Revision: 74053 URL:
http://svn.reactos.org/svn/reactos?rev=74053&view=rev
Log: [NTOS:PNP] - Make device instance paths unique if necessary (by adding the parent ID prefix), regardless of the return status from IRP_MN_QUERY_ID/BusQueryInstanceID. Support for this IRP is optional in most cases, and a failure status just indicates no instance id information is needed by the driver stack. Major thanks to Vadim Galyant for debugging this and identifying the root cause. CORE-12732 CORE-12818 CORE-12745 CORE-12733 CORE-12717 CORE-12735 Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat Mar 4 16:01:59 2017 @@ -1950,59 +1950,57 @@ &IoStatusBlock, IRP_MN_QUERY_ID, &Stack); - if (NT_SUCCESS(Status)) - { - RtlInitUnicodeString(&InstanceId, - (PWSTR)IoStatusBlock.Information); - - InstancePath->Length = 0; - InstancePath->MaximumLength = DeviceId.Length + sizeof(WCHAR) + - ParentIdPrefix.Length + - InstanceId.Length + - sizeof(UNICODE_NULL); - if (ParentIdPrefix.Length && InstanceId.Length) - { - InstancePath->MaximumLength += sizeof(WCHAR); - } - - InstancePath->Buffer = ExAllocatePoolWithTag(PagedPool, - InstancePath->MaximumLength, - TAG_IO); - if (!InstancePath->Buffer) - { - RtlFreeUnicodeString(&InstanceId); - RtlFreeUnicodeString(&ParentIdPrefix); - RtlFreeUnicodeString(&DeviceId); - return STATUS_INSUFFICIENT_RESOURCES; - } - - /* Start with the device id */ - RtlCopyUnicodeString(InstancePath, &DeviceId); - RtlAppendUnicodeToString(InstancePath, L"\\"); - - /* Add information from parent bus device to InstancePath */ - RtlAppendUnicodeStringToString(InstancePath, &ParentIdPrefix); - if (ParentIdPrefix.Length && InstanceId.Length) - { - RtlAppendUnicodeToString(InstancePath, L"&"); - } - - /* Finally, add the id returned by the driver stack */ - RtlAppendUnicodeStringToString(InstancePath, &InstanceId); - - /* - * FIXME: Check for valid characters, if there is invalid characters - * then bugcheck - */ - + if (!NT_SUCCESS(Status)) + { + DPRINT("IopInitiatePnpIrp(BusQueryInstanceID) failed (Status %lx)\n", Status); + ASSERT(IoStatusBlock.Information == 0); + } + + RtlInitUnicodeString(&InstanceId, + (PWSTR)IoStatusBlock.Information); + + InstancePath->Length = 0; + InstancePath->MaximumLength = DeviceId.Length + sizeof(WCHAR) + + ParentIdPrefix.Length + + InstanceId.Length + + sizeof(UNICODE_NULL); + if (ParentIdPrefix.Length && InstanceId.Length) + { + InstancePath->MaximumLength += sizeof(WCHAR); + } + + InstancePath->Buffer = ExAllocatePoolWithTag(PagedPool, + InstancePath->MaximumLength, + TAG_IO); + if (!InstancePath->Buffer) + { RtlFreeUnicodeString(&InstanceId); + RtlFreeUnicodeString(&ParentIdPrefix); RtlFreeUnicodeString(&DeviceId); - } - else - { - DPRINT("IopInitiatePnpIrp(BusQueryInstanceID) failed (Status %x)\n", Status); - *InstancePath = DeviceId; - } + return STATUS_INSUFFICIENT_RESOURCES; + } + + /* Start with the device id */ + RtlCopyUnicodeString(InstancePath, &DeviceId); + RtlAppendUnicodeToString(InstancePath, L"\\"); + + /* Add information from parent bus device to InstancePath */ + RtlAppendUnicodeStringToString(InstancePath, &ParentIdPrefix); + if (ParentIdPrefix.Length && InstanceId.Length) + { + RtlAppendUnicodeToString(InstancePath, L"&"); + } + + /* Finally, add the id returned by the driver stack */ + RtlAppendUnicodeStringToString(InstancePath, &InstanceId); + + /* + * FIXME: Check for valid characters, if there is invalid characters + * then bugcheck + */ + + RtlFreeUnicodeString(&InstanceId); + RtlFreeUnicodeString(&DeviceId); RtlFreeUnicodeString(&ParentIdPrefix); return STATUS_SUCCESS;
7 years, 9 months
1
0
0
0
[tfaber] 74052: [NTOS:PNP] - Use UNICODE_STRINGs in IopCreateDeviceInstancePath instead of messing around with unsafe string functions and stack buffers
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 15:17:30 2017 New Revision: 74052 URL:
http://svn.reactos.org/svn/reactos?rev=74052&view=rev
Log: [NTOS:PNP] - Use UNICODE_STRINGs in IopCreateDeviceInstancePath instead of messing around with unsafe string functions and stack buffers Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat Mar 4 15:17:30 2017 @@ -1879,9 +1879,8 @@ _Out_ PUNICODE_STRING InstancePath) { IO_STATUS_BLOCK IoStatusBlock; - PWSTR DeviceId; - PWSTR InstanceId; - WCHAR InstancePathBuffer[MAX_PATH]; + UNICODE_STRING DeviceId; + UNICODE_STRING InstanceId; IO_STACK_LOCATION Stack; NTSTATUS Status; UNICODE_STRING ParentIdPrefix = { 0, 0, NULL }; @@ -1900,23 +1899,21 @@ return Status; } - /* Copy the device id string */ - DeviceId = (PWSTR)IoStatusBlock.Information; - wcscpy(InstancePathBuffer, DeviceId); + /* Save the device id string */ + RtlInitUnicodeString(&DeviceId, (PWSTR)IoStatusBlock.Information); /* * FIXME: Check for valid characters, if there is invalid characters * then bugcheck. */ - ExFreePoolWithTag(DeviceId, 0); - DPRINT("Sending IRP_MN_QUERY_CAPABILITIES to device stack (after enumeration)\n"); Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCapabilities); if (!NT_SUCCESS(Status)) { DPRINT1("IopQueryDeviceCapabilities() failed (Status 0x%08lx)\n", Status); + RtlFreeUnicodeString(&DeviceId); return Status; } @@ -1925,6 +1922,7 @@ { /* FIXME: Cleanup device */ DeviceNode->Flags |= DNF_DISABLED; + RtlFreeUnicodeString(&DeviceId); return STATUS_PLUGPLAY_NO_DEVICE; } else @@ -1940,6 +1938,7 @@ if (!NT_SUCCESS(Status)) { DPRINT1("IopGetParentIdPrefix() failed (Status 0x%08lx)\n", Status); + RtlFreeUnicodeString(&DeviceId); return Status; } } @@ -1953,45 +1952,58 @@ &Stack); if (NT_SUCCESS(Status)) { - InstanceId = (PWSTR)IoStatusBlock.Information; - - /* Append the instance id string */ - wcscat(InstancePathBuffer, L"\\"); - if (ParentIdPrefix.Length > 0) + RtlInitUnicodeString(&InstanceId, + (PWSTR)IoStatusBlock.Information); + + InstancePath->Length = 0; + InstancePath->MaximumLength = DeviceId.Length + sizeof(WCHAR) + + ParentIdPrefix.Length + + InstanceId.Length + + sizeof(UNICODE_NULL); + if (ParentIdPrefix.Length && InstanceId.Length) { - /* Add information from parent bus device to InstancePath */ - wcscat(InstancePathBuffer, ParentIdPrefix.Buffer); - if (InstanceId && *InstanceId) - { - wcscat(InstancePathBuffer, L"&"); - } + InstancePath->MaximumLength += sizeof(WCHAR); } - if (InstanceId) + + InstancePath->Buffer = ExAllocatePoolWithTag(PagedPool, + InstancePath->MaximumLength, + TAG_IO); + if (!InstancePath->Buffer) { - wcscat(InstancePathBuffer, InstanceId); + RtlFreeUnicodeString(&InstanceId); + RtlFreeUnicodeString(&ParentIdPrefix); + RtlFreeUnicodeString(&DeviceId); + return STATUS_INSUFFICIENT_RESOURCES; } + + /* Start with the device id */ + RtlCopyUnicodeString(InstancePath, &DeviceId); + RtlAppendUnicodeToString(InstancePath, L"\\"); + + /* Add information from parent bus device to InstancePath */ + RtlAppendUnicodeStringToString(InstancePath, &ParentIdPrefix); + if (ParentIdPrefix.Length && InstanceId.Length) + { + RtlAppendUnicodeToString(InstancePath, L"&"); + } + + /* Finally, add the id returned by the driver stack */ + RtlAppendUnicodeStringToString(InstancePath, &InstanceId); /* * FIXME: Check for valid characters, if there is invalid characters * then bugcheck */ - if (InstanceId) - { - ExFreePoolWithTag(InstanceId, 0); - } + RtlFreeUnicodeString(&InstanceId); + RtlFreeUnicodeString(&DeviceId); } else { DPRINT("IopInitiatePnpIrp(BusQueryInstanceID) failed (Status %x)\n", Status); + *InstancePath = DeviceId; } RtlFreeUnicodeString(&ParentIdPrefix); - - if (!RtlCreateUnicodeString(InstancePath, InstancePathBuffer)) - { - DPRINT1("RtlCreateUnicodeString failed\n"); - return STATUS_INSUFFICIENT_RESOURCES; - } return STATUS_SUCCESS; }
7 years, 9 months
1
0
0
0
[tfaber] 74051: [FASTFAT] - Avoid use after free in vfatDestroyFCB
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 14:48:05 2017 New Revision: 74051 URL:
http://svn.reactos.org/svn/reactos?rev=74051&view=rev
Log: [FASTFAT] - Avoid use after free in vfatDestroyFCB Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c Modified: trunk/reactos/drivers/filesystems/fastfat/fcb.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/fastfa…
============================================================================== --- trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] (original) +++ trunk/reactos/drivers/filesystems/fastfat/fcb.c [iso-8859-1] Sat Mar 4 14:48:05 2017 @@ -273,8 +273,8 @@ ExFreePool(pFCB->PathNameBuffer); ExDeleteResourceLite(&pFCB->PagingIoResource); ExDeleteResourceLite(&pFCB->MainResource); + ASSERT(IsListEmpty(&pFCB->ParentListHead)); ExFreeToNPagedLookasideList(&VfatGlobalData->FcbLookasideList, pFCB); - ASSERT(IsListEmpty(&pFCB->ParentListHead)); } BOOLEAN
7 years, 9 months
1
0
0
0
[ekohl] 74050: [NTOS:SE] Add a missing ACE(SeAliasAdminsSid / GENERIC_ALL) to the SePublicDefaultDacl ACL. This fixes a kmtest:ObSecurity failure.
by ekohl@svn.reactos.org
Author: ekohl Date: Sat Mar 4 14:38:13 2017 New Revision: 74050 URL:
http://svn.reactos.org/svn/reactos?rev=74050&view=rev
Log: [NTOS:SE] Add a missing ACE(SeAliasAdminsSid / GENERIC_ALL) to the SePublicDefaultDacl ACL. This fixes a kmtest:ObSecurity failure. Modified: trunk/reactos/ntoskrnl/se/acl.c Modified: trunk/reactos/ntoskrnl/se/acl.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/se/acl.c?rev=7405…
============================================================================== --- trunk/reactos/ntoskrnl/se/acl.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/se/acl.c [iso-8859-1] Sat Mar 4 14:38:13 2017 @@ -38,7 +38,8 @@ /* create PublicDefaultDacl */ AclLength = sizeof(ACL) + (sizeof(ACE) + RtlLengthSid(SeWorldSid)) + - (sizeof(ACE) + RtlLengthSid(SeLocalSystemSid)); + (sizeof(ACE) + RtlLengthSid(SeLocalSystemSid)) + + (sizeof(ACE) + RtlLengthSid(SeAliasAdminsSid)); SePublicDefaultDacl = ExAllocatePoolWithTag(PagedPool, AclLength, @@ -59,6 +60,11 @@ ACL_REVISION, GENERIC_ALL, SeLocalSystemSid); + + RtlAddAccessAllowedAce(SePublicDefaultDacl, + ACL_REVISION, + GENERIC_ALL, + SeAliasAdminsSid); /* create PublicDefaultUnrestrictedDacl */ AclLength = sizeof(ACL) +
7 years, 9 months
1
0
0
0
[tfaber] 74049: [NTOS:PNP] Fix IopGetParentIdPrefix: - Do not include null terminator in UNICODE_STRING::Length - Use pool tagging - Use strsafe printf - Avoid a magic number
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 13:50:55 2017 New Revision: 74049 URL:
http://svn.reactos.org/svn/reactos?rev=74049&view=rev
Log: [NTOS:PNP] Fix IopGetParentIdPrefix: - Do not include null terminator in UNICODE_STRING::Length - Use pool tagging - Use strsafe printf - Avoid a magic number Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat Mar 4 13:50:55 2017 @@ -1634,6 +1634,7 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode, PUNICODE_STRING ParentIdPrefix) { + const UNICODE_STRING EnumKeyPath = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); ULONG KeyNameBufferLength; PKEY_VALUE_PARTIAL_INFORMATION ParentIdPrefixInformation = NULL; UNICODE_STRING KeyName = {0, 0, NULL}; @@ -1655,22 +1656,28 @@ /* 1. Try to retrieve ParentIdPrefix from registry */ KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); - ParentIdPrefixInformation = ExAllocatePool(PagedPool, KeyNameBufferLength + sizeof(WCHAR)); + ParentIdPrefixInformation = ExAllocatePoolWithTag(PagedPool, + KeyNameBufferLength + sizeof(UNICODE_NULL), + TAG_IO); if (!ParentIdPrefixInformation) { return STATUS_INSUFFICIENT_RESOURCES; } - KeyName.Buffer = ExAllocatePool(PagedPool, (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length); + KeyName.Length = 0; + KeyName.MaximumLength = EnumKeyPath.Length + + DeviceNode->Parent->InstancePath.Length + + sizeof(UNICODE_NULL); + KeyName.Buffer = ExAllocatePoolWithTag(PagedPool, + KeyName.MaximumLength, + TAG_IO); if (!KeyName.Buffer) { Status = STATUS_INSUFFICIENT_RESOURCES; goto cleanup; } - KeyName.Length = 0; - KeyName.MaximumLength = (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length; - - RtlAppendUnicodeToString(&KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); + + RtlCopyUnicodeString(&KeyName, &EnumKeyPath); RtlAppendUnicodeStringToString(&KeyName, &DeviceNode->Parent->InstancePath); Status = IopOpenRegistryKeyEx(&hKey, NULL, &KeyName, KEY_QUERY_VALUE | KEY_SET_VALUE); @@ -1693,15 +1700,20 @@ } else { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.Length = KeyValue.MaximumLength - sizeof(UNICODE_NULL); KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; + ASSERT(KeyValue.Buffer[KeyValue.Length / sizeof(WCHAR)] == UNICODE_NULL); } goto cleanup; } if (Status != STATUS_OBJECT_NAME_NOT_FOUND) { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + /* FIXME how do we get here and why is ParentIdPrefixInformation valid? */ + KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.Length = KeyValue.MaximumLength - sizeof(UNICODE_NULL); KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; + ASSERT(KeyValue.Buffer[KeyValue.Length / sizeof(WCHAR)] == UNICODE_NULL); goto cleanup; } @@ -1710,8 +1722,12 @@ (PUCHAR)DeviceNode->Parent->InstancePath.Buffer, DeviceNode->Parent->InstancePath.Length); - swprintf((PWSTR)ParentIdPrefixInformation->Data, L"%lx&%lx", DeviceNode->Parent->Level, crc32); - RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data); + RtlStringCbPrintfW((PWSTR)ParentIdPrefixInformation, + KeyNameBufferLength, + L"%lx&%lx", + DeviceNode->Parent->Level, + crc32); + RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation); /* 3. Try to write the ParentIdPrefix to registry */ Status = ZwSetValueKey(hKey, @@ -1729,7 +1745,7 @@ &KeyValue, ParentIdPrefix); } - ExFreePool(ParentIdPrefixInformation); + ExFreePoolWithTag(ParentIdPrefixInformation, TAG_IO); RtlFreeUnicodeString(&KeyName); if (hKey != NULL) {
7 years, 9 months
1
0
0
0
[tfaber] 74048: [NTOS:PNP] - Improve use of local variables in IopCreateDeviceInstancePath and IopActionInterrogateDeviceStack - Improve debug prints in IopCreateDeviceInstancePath. By Vadim Galyan...
by tfaber@svn.reactos.org
Author: tfaber Date: Sat Mar 4 13:20:25 2017 New Revision: 74048 URL:
http://svn.reactos.org/svn/reactos?rev=74048&view=rev
Log: [NTOS:PNP] - Improve use of local variables in IopCreateDeviceInstancePath and IopActionInterrogateDeviceStack - Improve debug prints in IopCreateDeviceInstancePath. By Vadim Galyant - Fix formatting in IopGetParentIdPrefix Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
============================================================================== --- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c [iso-8859-1] Sat Mar 4 13:20:25 2017 @@ -1634,98 +1634,108 @@ IopGetParentIdPrefix(PDEVICE_NODE DeviceNode, PUNICODE_STRING ParentIdPrefix) { - ULONG KeyNameBufferLength; - PKEY_VALUE_PARTIAL_INFORMATION ParentIdPrefixInformation = NULL; - UNICODE_STRING KeyName = {0, 0, NULL}; - UNICODE_STRING KeyValue; - UNICODE_STRING ValueName; - HANDLE hKey = NULL; - ULONG crc32; - NTSTATUS Status; - - /* HACK: As long as some devices have a NULL device - * instance path, the following test is required :( - */ - if (DeviceNode->Parent->InstancePath.Length == 0) - { - DPRINT1("Parent of %wZ has NULL Instance path, please report!\n", - &DeviceNode->InstancePath); - return STATUS_UNSUCCESSFUL; - } - - /* 1. Try to retrieve ParentIdPrefix from registry */ - KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); - ParentIdPrefixInformation = ExAllocatePool(PagedPool, KeyNameBufferLength + sizeof(WCHAR)); - if (!ParentIdPrefixInformation) - { - return STATUS_INSUFFICIENT_RESOURCES; - } - - KeyName.Buffer = ExAllocatePool(PagedPool, (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length); - if (!KeyName.Buffer) - { - Status = STATUS_INSUFFICIENT_RESOURCES; - goto cleanup; - } - KeyName.Length = 0; - KeyName.MaximumLength = (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length; - - RtlAppendUnicodeToString(&KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); - RtlAppendUnicodeStringToString(&KeyName, &DeviceNode->Parent->InstancePath); - - Status = IopOpenRegistryKeyEx(&hKey, NULL, &KeyName, KEY_QUERY_VALUE | KEY_SET_VALUE); - if (!NT_SUCCESS(Status)) - goto cleanup; - RtlInitUnicodeString(&ValueName, L"ParentIdPrefix"); - Status = ZwQueryValueKey( - hKey, &ValueName, - KeyValuePartialInformation, ParentIdPrefixInformation, - KeyNameBufferLength, &KeyNameBufferLength); - if (NT_SUCCESS(Status)) - { - if (ParentIdPrefixInformation->Type != REG_SZ) - Status = STATUS_UNSUCCESSFUL; - else - { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; - KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; - } - goto cleanup; - } - if (Status != STATUS_OBJECT_NAME_NOT_FOUND) - { - KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; - KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; - goto cleanup; - } - - /* 2. Create the ParentIdPrefix value */ - crc32 = RtlComputeCrc32(0, - (PUCHAR)DeviceNode->Parent->InstancePath.Buffer, - DeviceNode->Parent->InstancePath.Length); - - swprintf((PWSTR)ParentIdPrefixInformation->Data, L"%lx&%lx", DeviceNode->Parent->Level, crc32); - RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data); - - /* 3. Try to write the ParentIdPrefix to registry */ - Status = ZwSetValueKey(hKey, - &ValueName, - 0, - REG_SZ, - (PVOID)KeyValue.Buffer, - ((ULONG)wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR)); + ULONG KeyNameBufferLength; + PKEY_VALUE_PARTIAL_INFORMATION ParentIdPrefixInformation = NULL; + UNICODE_STRING KeyName = {0, 0, NULL}; + UNICODE_STRING KeyValue; + UNICODE_STRING ValueName; + HANDLE hKey = NULL; + ULONG crc32; + NTSTATUS Status; + + /* HACK: As long as some devices have a NULL device + * instance path, the following test is required :( + */ + if (DeviceNode->Parent->InstancePath.Length == 0) + { + DPRINT1("Parent of %wZ has NULL Instance path, please report!\n", + &DeviceNode->InstancePath); + return STATUS_UNSUCCESSFUL; + } + + /* 1. Try to retrieve ParentIdPrefix from registry */ + KeyNameBufferLength = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[0]) + MAX_PATH * sizeof(WCHAR); + ParentIdPrefixInformation = ExAllocatePool(PagedPool, KeyNameBufferLength + sizeof(WCHAR)); + if (!ParentIdPrefixInformation) + { + return STATUS_INSUFFICIENT_RESOURCES; + } + + KeyName.Buffer = ExAllocatePool(PagedPool, (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length); + if (!KeyName.Buffer) + { + Status = STATUS_INSUFFICIENT_RESOURCES; + goto cleanup; + } + KeyName.Length = 0; + KeyName.MaximumLength = (49 * sizeof(WCHAR)) + DeviceNode->Parent->InstancePath.Length; + + RtlAppendUnicodeToString(&KeyName, L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum\\"); + RtlAppendUnicodeStringToString(&KeyName, &DeviceNode->Parent->InstancePath); + + Status = IopOpenRegistryKeyEx(&hKey, NULL, &KeyName, KEY_QUERY_VALUE | KEY_SET_VALUE); + if (!NT_SUCCESS(Status)) + { + goto cleanup; + } + RtlInitUnicodeString(&ValueName, L"ParentIdPrefix"); + Status = ZwQueryValueKey(hKey, + &ValueName, + KeyValuePartialInformation, + ParentIdPrefixInformation, + KeyNameBufferLength, + &KeyNameBufferLength); + if (NT_SUCCESS(Status)) + { + if (ParentIdPrefixInformation->Type != REG_SZ) + { + Status = STATUS_UNSUCCESSFUL; + } + else + { + KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; + } + goto cleanup; + } + if (Status != STATUS_OBJECT_NAME_NOT_FOUND) + { + KeyValue.Length = KeyValue.MaximumLength = (USHORT)ParentIdPrefixInformation->DataLength; + KeyValue.Buffer = (PWSTR)ParentIdPrefixInformation->Data; + goto cleanup; + } + + /* 2. Create the ParentIdPrefix value */ + crc32 = RtlComputeCrc32(0, + (PUCHAR)DeviceNode->Parent->InstancePath.Buffer, + DeviceNode->Parent->InstancePath.Length); + + swprintf((PWSTR)ParentIdPrefixInformation->Data, L"%lx&%lx", DeviceNode->Parent->Level, crc32); + RtlInitUnicodeString(&KeyValue, (PWSTR)ParentIdPrefixInformation->Data); + + /* 3. Try to write the ParentIdPrefix to registry */ + Status = ZwSetValueKey(hKey, + &ValueName, + 0, + REG_SZ, + (PVOID)KeyValue.Buffer, + ((ULONG)wcslen(KeyValue.Buffer) + 1) * sizeof(WCHAR)); cleanup: - if (NT_SUCCESS(Status)) - { - /* Duplicate the string to return it */ - Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, &KeyValue, ParentIdPrefix); - } - ExFreePool(ParentIdPrefixInformation); - RtlFreeUnicodeString(&KeyName); - if (hKey != NULL) - ZwClose(hKey); - return Status; + if (NT_SUCCESS(Status)) + { + /* Duplicate the string to return it */ + Status = RtlDuplicateUnicodeString(RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE, + &KeyValue, + ParentIdPrefix); + } + ExFreePool(ParentIdPrefixInformation); + RtlFreeUnicodeString(&KeyName); + if (hKey != NULL) + { + ZwClose(hKey); + } + return Status; } NTSTATUS @@ -1850,11 +1860,12 @@ NTSTATUS IopCreateDeviceInstancePath( _In_ PDEVICE_NODE DeviceNode, - _Out_ PUNICODE_STRING InstancePathU) + _Out_ PUNICODE_STRING InstancePath) { IO_STATUS_BLOCK IoStatusBlock; - PWSTR InformationString; - WCHAR InstancePath[MAX_PATH]; + PWSTR DeviceId; + PWSTR InstanceId; + WCHAR InstancePathBuffer[MAX_PATH]; IO_STACK_LOCATION Stack; NTSTATUS Status; UNICODE_STRING ParentIdPrefix = { 0, 0, NULL }; @@ -1869,27 +1880,27 @@ &Stack); if (!NT_SUCCESS(Status)) { - DPRINT1("IopInitiatePnpIrp() failed (Status %x)\n", Status); + DPRINT1("IopInitiatePnpIrp(BusQueryDeviceID) failed (Status %x)\n", Status); return Status; } /* Copy the device id string */ - InformationString = (PWSTR)IoStatusBlock.Information; - wcscpy(InstancePath, InformationString); + DeviceId = (PWSTR)IoStatusBlock.Information; + wcscpy(InstancePathBuffer, DeviceId); /* * FIXME: Check for valid characters, if there is invalid characters * then bugcheck. */ - ExFreePoolWithTag(InformationString, 0); + ExFreePoolWithTag(DeviceId, 0); DPRINT("Sending IRP_MN_QUERY_CAPABILITIES to device stack (after enumeration)\n"); Status = IopQueryDeviceCapabilities(DeviceNode, &DeviceCapabilities); if (!NT_SUCCESS(Status)) { - DPRINT1("IopInitiatePnpIrp() failed (Status 0x%08lx)\n", Status); + DPRINT1("IopQueryDeviceCapabilities() failed (Status 0x%08lx)\n", Status); return Status; } @@ -1926,22 +1937,22 @@ &Stack); if (NT_SUCCESS(Status)) { - InformationString = (PWSTR)IoStatusBlock.Information; + InstanceId = (PWSTR)IoStatusBlock.Information; /* Append the instance id string */ - wcscat(InstancePath, L"\\"); + wcscat(InstancePathBuffer, L"\\"); if (ParentIdPrefix.Length > 0) { /* Add information from parent bus device to InstancePath */ - wcscat(InstancePath, ParentIdPrefix.Buffer); - if (InformationString && *InformationString) + wcscat(InstancePathBuffer, ParentIdPrefix.Buffer); + if (InstanceId && *InstanceId) { - wcscat(InstancePath, L"&"); + wcscat(InstancePathBuffer, L"&"); } } - if (InformationString) + if (InstanceId) { - wcscat(InstancePath, InformationString); + wcscat(InstancePathBuffer, InstanceId); } /* @@ -1949,18 +1960,18 @@ * then bugcheck */ - if (InformationString) + if (InstanceId) { - ExFreePoolWithTag(InformationString, 0); + ExFreePoolWithTag(InstanceId, 0); } } else { - DPRINT("IopInitiatePnpIrp() failed (Status %x)\n", Status); + DPRINT("IopInitiatePnpIrp(BusQueryInstanceID) failed (Status %x)\n", Status); } RtlFreeUnicodeString(&ParentIdPrefix); - if (!RtlCreateUnicodeString(InstancePathU, InstancePath)) + if (!RtlCreateUnicodeString(InstancePath, InstancePathBuffer)) { DPRINT1("RtlCreateUnicodeString failed\n"); return STATUS_INSUFFICIENT_RESOURCES; @@ -1991,7 +2002,8 @@ PVOID Context) { IO_STATUS_BLOCK IoStatusBlock; - PWSTR InformationString; + PWSTR DeviceDescription; + PWSTR LocationInformation; PDEVICE_NODE ParentDeviceNode; IO_STACK_LOCATION Stack; NTSTATUS Status; @@ -2104,14 +2116,14 @@ &IoStatusBlock, IRP_MN_QUERY_DEVICE_TEXT, &Stack); - InformationString = NT_SUCCESS(Status) ? (PWSTR)IoStatusBlock.Information + DeviceDescription = NT_SUCCESS(Status) ? (PWSTR)IoStatusBlock.Information : NULL; /* This key is mandatory, so even if the Irp fails, we still write it */ RtlInitUnicodeString(&ValueName, L"DeviceDesc"); if (ZwQueryValueKey(InstanceKey, &ValueName, KeyValueBasicInformation, NULL, 0, &RequiredLength) == STATUS_OBJECT_NAME_NOT_FOUND) { - if (InformationString && - *InformationString != UNICODE_NULL) + if (DeviceDescription && + *DeviceDescription != UNICODE_NULL) { /* This key is overriden when a driver is installed. Don't write the * new description if another one already exists */ @@ -2119,8 +2131,8 @@ &ValueName, 0, REG_SZ, - InformationString, - ((ULONG)wcslen(InformationString) + 1) * sizeof(WCHAR)); + DeviceDescription, + ((ULONG)wcslen(DeviceDescription) + 1) * sizeof(WCHAR)); } else { @@ -2141,9 +2153,9 @@ } } - if (InformationString) - { - ExFreePoolWithTag(InformationString, 0); + if (DeviceDescription) + { + ExFreePoolWithTag(DeviceDescription, 0); } DPRINT("Sending IRP_MN_QUERY_DEVICE_TEXT.DeviceTextLocation to device stack\n"); @@ -2156,21 +2168,21 @@ &Stack); if (NT_SUCCESS(Status) && IoStatusBlock.Information) { - InformationString = (PWSTR)IoStatusBlock.Information; - DPRINT("LocationInformation: %S\n", InformationString); + LocationInformation = (PWSTR)IoStatusBlock.Information; + DPRINT("LocationInformation: %S\n", LocationInformation); RtlInitUnicodeString(&ValueName, L"LocationInformation"); Status = ZwSetValueKey(InstanceKey, &ValueName, 0, REG_SZ, - InformationString, - ((ULONG)wcslen(InformationString) + 1) * sizeof(WCHAR)); + LocationInformation, + ((ULONG)wcslen(LocationInformation) + 1) * sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { DPRINT1("ZwSetValueKey() failed (Status %lx)\n", Status); } - ExFreePoolWithTag(InformationString, 0); + ExFreePoolWithTag(LocationInformation, 0); } else {
7 years, 9 months
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
25
26
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
Results per page:
10
25
50
100
200