https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6d262f1ee4dfa76641d62…
commit 6d262f1ee4dfa76641d625dcab47724ee7de06f7
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Wed Apr 11 12:36:44 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Wed Apr 11 12:36:44 2018 +0100
[KERNEL32/WINE] Sync res.c with Wine Staging 3.3. CORE-14434
---
dll/win32/kernel32/wine/res.c | 10 +++++++++-
media/doc/README.WINE | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dll/win32/kernel32/wine/res.c b/dll/win32/kernel32/wine/res.c
index d6b0e5ea54..971d27a192 100644
--- a/dll/win32/kernel32/wine/res.c
+++ b/dll/win32/kernel32/wine/res.c
@@ -1383,7 +1383,7 @@ static BOOL write_raw_resources( QUEUEDUPDATES *updates )
{
static const WCHAR prefix[] = { 'r','e','s','u',0 };
WCHAR tempdir[MAX_PATH], tempfile[MAX_PATH];
- DWORD section_size;
+ DWORD i, section_size;
BOOL ret = FALSE;
IMAGE_SECTION_HEADER *sec;
IMAGE_NT_HEADERS32 *nt;
@@ -1567,11 +1567,19 @@ static BOOL write_raw_resources( QUEUEDUPDATES *updates )
nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress =
sec->VirtualAddress;
nt64->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].Size =
res_size.total_size;
nt64->OptionalHeader.SizeOfInitializedData = get_init_data_size(
write_map->base, mapping_size );
+
+ for (i=0; i<nt64->OptionalHeader.NumberOfRvaAndSizes; i++)
+ if (nt64->OptionalHeader.DataDirectory[i].VirtualAddress >
sec->VirtualAddress)
+ nt64->OptionalHeader.DataDirectory[i].VirtualAddress +=
rva_delta;
} else {
nt->OptionalHeader.SizeOfImage += rva_delta;
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].VirtualAddress =
sec->VirtualAddress;
nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_RESOURCE].Size =
res_size.total_size;
nt->OptionalHeader.SizeOfInitializedData = get_init_data_size(
write_map->base, mapping_size );
+
+ for (i=0; i<nt->OptionalHeader.NumberOfRvaAndSizes; i++)
+ if (nt->OptionalHeader.DataDirectory[i].VirtualAddress >
sec->VirtualAddress)
+ nt->OptionalHeader.DataDirectory[i].VirtualAddress += rva_delta;
}
}
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 7580f000a6..8cf47655b2 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -274,7 +274,7 @@ kernel32 -
reactos/dll/win32/kernel32/wine/comm.c # Synced in r52754
reactos/dll/win32/kernel32/wine/lzexpand.c # Synced to WineStaging-3.3
reactos/dll/win32/kernel32/wine/profile.c # Synced to WineStaging-3.3
- reactos/dll/win32/kernel32/wine/res.c # Partially synced to
WineStaging-1.7.55
+ reactos/dll/win32/kernel32/wine/res.c # Partially synced to
WineStaging-3.3
reactos/dll/win32/kernel32/winnls/string/casemap.c # Synced to WineStaging-1.7.55
reactos/dll/win32/kernel32/winnls/string/chartype.c # Synced in r52754
reactos/dll/win32/kernel32/winnls/string/collation.c # Synced to WineStaging-1.7.55