[INCLUDE:HOST] Revert a bug that has been sneaked in by Arch Blackmann in 9e9ba41f...
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 22 Sep 2019 23:53:25 +0000 (01:53 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 1 Feb 2020 17:35:40 +0000 (18:35 +0100)
The "TypeOffset" thing was just an informative comment to tell that the
data that follows after the IMAGE_BASE_RELOCATION header is an arbitrary
array of WORDs describing packed (Type + Offset)s.

Having the header structure containing that spurious "TypeOffset" was
breaking all the code that was basing on expected size of the
IMAGE_BASE_RELOCATION structure in order to apply relocations (typically
this would mean that the first 2 relocations described by it would not
be applied).

Hopefully this bug only hit the host-tools, and not the OS itself :)

sdk/include/host/pecoff.h

index 42bc0bf..14e267c 100644 (file)
@@ -202,7 +202,7 @@ typedef struct _IMAGE_SECTION_HEADER {
 typedef struct _IMAGE_BASE_RELOCATION {
        DWORD VirtualAddress;
        DWORD SizeOfBlock;
-    WORD  TypeOffset[1];
+       // Followed by: WORD TypeOffset[ANYSIZE_ARRAY];
 } IMAGE_BASE_RELOCATION,*PIMAGE_BASE_RELOCATION;
 #pragma pack(pop)