https://git.reactos.org/?p=reactos.git;a=commitdiff;h=88b933330d110ad142fe8…
commit 88b933330d110ad142fe8de2241dd4cc278fad15
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Apr 10 20:06:56 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 5 19:15:01 2021 +0200
[PEFIXUP] Only recalculate the PE checksum if the image is not from a reproducible build (original checksum == 0). (#3598)
---
sdk/tools/pefixup.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sdk/tools/pefixup.c b/sdk/tools/pefixup.c
index 22d3d0c00fa..bb4f9ddaffc 100644
--- a/sdk/tools/pefixup.c
+++ b/sdk/tools/pefixup.c
@@ -283,10 +283,11 @@ int main(int argc, char **argv)
if (!result)
{
- /* Success. Fix checksum and write to file */
- fix_checksum(buffer, len, nt_header);
+ /* Success. Recalculate the checksum only if this is not a reproducible build file */
+ if (nt_header->OptionalHeader.CheckSum != 0)
+ fix_checksum(buffer, len, nt_header);
- /* We could 'optimize by only writing the changed parts, but keep it simple for now */
+ /* We could optimize by only writing the changed parts, but keep it simple for now */
fseek(file, 0, SEEK_SET);
fwrite(buffer, 1, len, file);
}
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=db089c517edb75d560760…
commit db089c517edb75d560760ec1ff8dac35cd0a2137
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Apr 21 19:03:00 2021 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed May 5 17:24:12 2021 +0200
[PSDK] Remove a buggy GNU-specific "PACKED" attribute in KEY_EVENT_RECORD structure declaration. (#3619)
CORE-17545
No other public header out there (in MS PSDK, MinGW, Wine, etc...) does have
this hack (that was introduced back in the days in r15141 / commit 01df92bc).
Add static assert on KEY_EVENT_RECORD's uChar member to ensure it's properly aligned.
May fix Clang warning:
win32ss/user/winsrv/consrv/lineinput.c:457:62: warning: taking address of packed member 'uChar' of class or structure '_KEY_EVENT_RECORD' may result in an unaligned pointer value [-Waddress-of-packed-member]
LineInputEdit(Console, (Overstrike ? 1 : 0), 1, &KeyEvent->uChar.UnicodeChar);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
and whatnot...
---
sdk/include/psdk/wincon.h | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sdk/include/psdk/wincon.h b/sdk/include/psdk/wincon.h
index 6145b93cf1c..bb6e1ed8dc5 100644
--- a/sdk/include/psdk/wincon.h
+++ b/sdk/include/psdk/wincon.h
@@ -246,12 +246,9 @@ typedef struct _KEY_EVENT_RECORD {
CHAR AsciiChar;
} uChar;
DWORD dwControlKeyState;
-}
-#ifdef __GNUC__
-/* gcc's alignment is not what win32 expects */
-PACKED
-#endif
-KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
+} KEY_EVENT_RECORD, *PKEY_EVENT_RECORD;
+
+C_ASSERT(FIELD_OFFSET(KEY_EVENT_RECORD, uChar) == 0xA);
typedef struct _MOUSE_EVENT_RECORD {
COORD dwMousePosition;