https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be617cf987f94d3e0b083…
commit be617cf987f94d3e0b083433dc80f9c975f609cc
Author: Thomas Faber <thomas.faber(a)reactos.org>
AuthorDate: Sat Dec 14 09:04:07 2019 +0100
Commit: Thomas Faber <thomas.faber(a)reactos.org>
CommitDate: Sat Dec 14 09:48:11 2019 +0100
[ACPICA] Update to version 20191213. CORE-16559
---
drivers/bus/acpi/acpica/dispatcher/dsfield.c | 2 +-
drivers/bus/acpi/acpica/dispatcher/dsopcode.c | 1 +
drivers/bus/acpi/acpica/dispatcher/dswload.c | 22 ++++++++++++++++++++++
drivers/bus/acpi/acpica/executer/exfield.c | 10 ++++++++--
drivers/bus/acpi/acpica/hardware/hwxfsleep.c | 2 +-
drivers/bus/acpi/acpica/include/acobject.h | 1 +
drivers/bus/acpi/acpica/include/acpixf.h | 2 +-
drivers/bus/acpi/acpica/include/platform/acenv.h | 15 +++++++++++++++
8 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsfield.c b/drivers/bus/acpi/acpica/dispatcher/dsfield.c
index 4c3c7ff22f3..4d7280a1de9 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsfield.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsfield.c
@@ -305,7 +305,7 @@ Cleanup:
* FUNCTION: AcpiDsGetFieldNames
*
* PARAMETERS: Info - CreateField info structure
- * ` WalkState - Current method state
+ * WalkState - Current method state
* Arg - First parser arg for the field name list
*
* RETURN: Status
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
index 1d35c5be77c..b680bb78e44 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
@@ -266,6 +266,7 @@ AcpiDsInitBufferField (
}
ObjDesc->BufferField.BufferObj = BufferDesc;
+ ObjDesc->BufferField.IsCreateField = AmlOpcode == AML_CREATE_FIELD_OP;
/* Reference count for BufferDesc inherits ObjDesc count */
diff --git a/drivers/bus/acpi/acpica/dispatcher/dswload.c b/drivers/bus/acpi/acpica/dispatcher/dswload.c
index bc99b2b166c..8badd9f897e 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dswload.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dswload.c
@@ -459,6 +459,28 @@ AcpiDsLoad1EndOp (
Op = WalkState->Op;
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
+ /*
+ * Disassembler: handle create field operators here.
+ *
+ * CreateBufferField is a deferred op that is typically processed in load
+ * pass 2. However, disassembly of control method contents walk the parse
+ * tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed
+ * in a later walk. This is a problem when there is a control method that
+ * has the same name as the AML_CREATE object. In this case, any use of the
+ * name segment will be detected as a method call rather than a reference
+ * to a buffer field.
+ *
+ * This earlier creation during disassembly solves this issue by inserting
+ * the named object in the ACPI namespace so that references to this name
+ * would be a name string rather than a method call.
+ */
+ if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) &&
+ (WalkState->OpInfo->Flags & AML_CREATE))
+ {
+ Status = AcpiDsCreateBufferField (Op, WalkState);
+ return_ACPI_STATUS (Status);
+ }
+
/* We are only interested in opcodes that have an associated name */
if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD)))
diff --git a/drivers/bus/acpi/acpica/executer/exfield.c b/drivers/bus/acpi/acpica/executer/exfield.c
index f4c4139b97c..70e73babde4 100644
--- a/drivers/bus/acpi/acpica/executer/exfield.c
+++ b/drivers/bus/acpi/acpica/executer/exfield.c
@@ -138,7 +138,8 @@ AcpiExGetProtocolBufferLength (
* RETURN: Status
*
* DESCRIPTION: Read from a named field. Returns either an Integer or a
- * Buffer, depending on the size of the field.
+ * Buffer, depending on the size of the field and whether if a
+ * field is created by the CreateField() operator.
*
******************************************************************************/
@@ -202,12 +203,17 @@ AcpiExReadDataFromField (
* the use of arithmetic operators on the returned value if the
* field size is equal or smaller than an Integer.
*
+ * However, all buffer fields created by CreateField operator needs to
+ * remain as a buffer to match other AML interpreter implementations.
+ *
* Note: Field.length is in bits.
*/
BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
ObjDesc->Field.BitLength);
- if (BufferLength > AcpiGbl_IntegerByteWidth)
+ if (BufferLength > AcpiGbl_IntegerByteWidth ||
+ (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD &&
+ ObjDesc->BufferField.IsCreateField))
{
/* Field is too large for an Integer, create a Buffer instead */
diff --git a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
index d1c35c5a11d..401ed18589c 100644
--- a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
+++ b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
@@ -84,7 +84,7 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
ACPI_STRUCT_INIT (ExtendedFunction,
AcpiHwExtendedWakePrep) },
- {ACPI_STRUCT_INIT (Legacy_function,
+ {ACPI_STRUCT_INIT (LegacyFunction,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
ACPI_STRUCT_INIT (ExtendedFunction,
AcpiHwExtendedWake) }
diff --git a/drivers/bus/acpi/acpica/include/acobject.h b/drivers/bus/acpi/acpica/include/acobject.h
index 45f09839b6d..8fe08977777 100644
--- a/drivers/bus/acpi/acpica/include/acobject.h
+++ b/drivers/bus/acpi/acpica/include/acobject.h
@@ -381,6 +381,7 @@ typedef struct acpi_object_buffer_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
+ BOOLEAN IsCreateField; /* Special case for objects created by CreateField() */
union acpi_operand_object *BufferObj; /* Containing Buffer object */
} ACPI_OBJECT_BUFFER_FIELD;
diff --git a/drivers/bus/acpi/acpica/include/acpixf.h b/drivers/bus/acpi/acpica/include/acpixf.h
index bf88d566950..c1d46e6bac2 100644
--- a/drivers/bus/acpi/acpica/include/acpixf.h
+++ b/drivers/bus/acpi/acpica/include/acpixf.h
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20191018
+#define ACPI_CA_VERSION 0x20191213
#include "acconfig.h"
#include "actypes.h"
diff --git a/drivers/bus/acpi/acpica/include/platform/acenv.h b/drivers/bus/acpi/acpica/include/platform/acenv.h
index a6b5ab18fd7..d81b91c2296 100644
--- a/drivers/bus/acpi/acpica/include/platform/acenv.h
+++ b/drivers/bus/acpi/acpica/include/platform/acenv.h
@@ -162,6 +162,21 @@
#define ACPI_DISASSEMBLER 1
#endif
+/*
+ * acpisrc CR\LF support
+ * Unix file line endings do not include the carriage return.
+ * If the acpisrc utility is being built using a microsoft compiler, it means
+ * that it will be running on a windows machine which means that the output is
+ * expected to have CR/LF newlines. If the acpisrc utility is built with
+ * anything else, it will likely run on a system with LF newlines. This flag
+ * tells the acpisrc utility that newlines will be in the LF format.
+ */
+#if defined(ACPI_SRC_APP) && !defined(_MSC_VER)
+#define ACPI_SRC_OS_LF_ONLY 1
+#else
+#define ACPI_SRC_OS_LF_ONLY 0
+#endif
+
/*! [Begin] no source code translation */
/******************************************************************************
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8ec05f5fa1108a50f378e…
commit 8ec05f5fa1108a50f378e57b76b5015ab7613ffe
Author: Bișoc George <fraizeraust99(a)gmail.com>
AuthorDate: Thu Dec 12 00:24:20 2019 +0100
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Dec 12 08:24:20 2019 +0900
[SHELL32] Do not return -1 if a file is not valid or not found - ExtractIconEx() (#2113)
ExtractIconEx() returns the number of successfully extracted icons from a file. The routine may return 0 in case no icons could be extracted but it could also return 0 if the file is not a valid PE image file or the file couldn't be found.
PrivateExtractIcons and the internal USER32 routine, ICO_ExtractIconExW(), return -1 in such scenarios. The behaviour is correct however we do not want that ExtractIconEx() returns -1 as well as it doesn't comply with the general documentation. In such cases, simply return 0 as no successful icons have been extracted due to related file failures.
CORE-16535
---
dll/win32/shell32/iconcache.cpp | 20 +++++++++---
modules/rostests/apitests/shell32/CMakeLists.txt | 1 +
.../rostests/apitests/shell32/ExtractIconEx.cpp | 37 ++++++++++++++++++++++
modules/rostests/apitests/shell32/testlist.c | 2 ++
4 files changed, 56 insertions(+), 4 deletions(-)
diff --git a/dll/win32/shell32/iconcache.cpp b/dll/win32/shell32/iconcache.cpp
index 400f75cc456..5b35326a2b7 100644
--- a/dll/win32/shell32/iconcache.cpp
+++ b/dll/win32/shell32/iconcache.cpp
@@ -866,12 +866,13 @@ EXTERN_C INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex, UINT b
/*************************************************************************
* ExtractIconExW [SHELL32.@]
* RETURNS
- * 0 no icon found
- * -1 file is not valid
+ * 0 no icon found (or the file is not valid)
* or number of icons extracted
*/
UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge, HICON * phiconSmall, UINT nIcons)
{
+ UINT ret = 0;
+
/* get entry point of undocumented function PrivateExtractIconExW() in user32 */
#if defined(__CYGWIN__) || defined (__MINGW32__) || defined(_MSC_VER)
static UINT (WINAPI*PrivateExtractIconExW)(LPCWSTR,int,HICON*,HICON*,UINT) = NULL;
@@ -881,13 +882,24 @@ UINT WINAPI ExtractIconExW(LPCWSTR lpszFile, INT nIconIndex, HICON * phiconLarge
PrivateExtractIconExW = (UINT(WINAPI*)(LPCWSTR,int,HICON*,HICON*,UINT)) GetProcAddress(hUser32, "PrivateExtractIconExW");
if (!PrivateExtractIconExW)
- return 0;
+ return ret;
}
#endif
TRACE("%s %i %p %p %i\n", debugstr_w(lpszFile), nIconIndex, phiconLarge, phiconSmall, nIcons);
+ ret = PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
- return PrivateExtractIconExW(lpszFile, nIconIndex, phiconLarge, phiconSmall, nIcons);
+ /* PrivateExtractIconExW() may return -1 if the provided file is not a valid PE image file or the said
+ * file couldn't be found. The behaviour is correct although ExtractIconExW() only returns the successfully
+ * extracted icons from a file. In such scenario, simply return 0.
+ */
+ if (ret == 0xFFFFFFFF)
+ {
+ WARN("Invalid file or couldn't be found - %s\n", debugstr_w(lpszFile));
+ ret = 0;
+ }
+
+ return ret;
}
/*************************************************************************
diff --git a/modules/rostests/apitests/shell32/CMakeLists.txt b/modules/rostests/apitests/shell32/CMakeLists.txt
index f1cd11fefaa..22dbadf9dfb 100644
--- a/modules/rostests/apitests/shell32/CMakeLists.txt
+++ b/modules/rostests/apitests/shell32/CMakeLists.txt
@@ -18,6 +18,7 @@ list(APPEND SOURCE
CUserNotification.cpp
Control_RunDLLW.cpp
DragDrop.cpp
+ ExtractIconEx.cpp
IShellFolderViewCB.cpp
OpenAs_RunDLL.cpp
PathResolve.cpp
diff --git a/modules/rostests/apitests/shell32/ExtractIconEx.cpp b/modules/rostests/apitests/shell32/ExtractIconEx.cpp
new file mode 100644
index 00000000000..721c749350b
--- /dev/null
+++ b/modules/rostests/apitests/shell32/ExtractIconEx.cpp
@@ -0,0 +1,37 @@
+/*
+ * PROJECT: ReactOS API Tests
+ * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Tests for ExtractIconEx routine
+ * COPYRIGHT: Copyright 2019 Bișoc George (fraizeraust99 at gmail dot com)
+ */
+
+#include "shelltest.h"
+
+typedef struct
+{
+ PCWSTR pszFilePath;
+ UINT nIcons;
+} EXTRACTICONTESTS;
+
+EXTRACTICONTESTS IconTests[] =
+{
+ /* Executable file with icon */
+ {L"%SystemRoot%\\System32\\cmd.exe", 1},
+
+ /* Executable file without icon */
+ {L"%SystemRoot%\\System32\\autochk.exe", 0},
+
+ /* Non-existing files */
+ {L"%SystemRoot%\\non-existent-file.sdf", 0}
+};
+
+START_TEST(ExtractIconEx)
+{
+ UINT i, nReturnedIcons;
+
+ for (i = 0; i < _countof(IconTests); ++i)
+ {
+ nReturnedIcons = ExtractIconExW(IconTests[i].pszFilePath, 0, NULL, NULL, IconTests[i].nIcons);
+ ok(nReturnedIcons == IconTests[i].nIcons, "ExtractIconExW(%u): Expected %u icons, got %u\n", i, IconTests[i].nIcons, nReturnedIcons);
+ }
+}
diff --git a/modules/rostests/apitests/shell32/testlist.c b/modules/rostests/apitests/shell32/testlist.c
index a274688b0f5..18939f998e3 100644
--- a/modules/rostests/apitests/shell32/testlist.c
+++ b/modules/rostests/apitests/shell32/testlist.c
@@ -12,6 +12,7 @@ extern void func_CShellDesktop(void);
extern void func_CShellLink(void);
extern void func_CUserNotification(void);
extern void func_DragDrop(void);
+extern void func_ExtractIconEx(void);
extern void func_IShellFolderViewCB(void);
extern void func_menu(void);
extern void func_OpenAs_RunDLL(void);
@@ -35,6 +36,7 @@ const struct test winetest_testlist[] =
{ "CShellLink", func_CShellLink },
{ "CUserNotification", func_CUserNotification },
{ "DragDrop", func_DragDrop },
+ { "ExtractIconEx", func_ExtractIconEx },
{ "IShellFolderViewCB", func_IShellFolderViewCB },
{ "menu", func_menu },
{ "OpenAs_RunDLL", func_OpenAs_RunDLL },
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=99f8ccdc7fb343e3e4fe9…
commit 99f8ccdc7fb343e3e4fe95ece1629eddd267c078
Author: Serge Gautherie <32623169+SergeGautherie(a)users.noreply.github.com>
AuthorDate: Tue Dec 10 13:16:46 2019 +0100
Commit: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito(a)reactos.org>
CommitDate: Tue Dec 10 13:16:46 2019 +0100
[SETUPLIB] Fix 'MAX_USHORT' typo in a comment (#2144)
---
base/setup/lib/utils/bldrsup.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/base/setup/lib/utils/bldrsup.h b/base/setup/lib/utils/bldrsup.h
index 41cc1bb11b8..39862660d8d 100644
--- a/base/setup/lib/utils/bldrsup.h
+++ b/base/setup/lib/utils/bldrsup.h
@@ -44,7 +44,7 @@ typedef struct _BOOT_STORE_OPTIONS
* IS_INTRESOURCE macros for Win32 resources.
*
* A key consists of either a boot ID number, comprised between 0 and
- * MAX_USHORT == 0xFFFF == 65535, or can be a pointer to a human-readable
+ * MAXUSHORT == 0xFFFF == 65535, or can be a pointer to a human-readable
* string (section name), as in the case of FreeLDR, or to a GUID, as in the
* case of BOOTMGR.
*