https://git.reactos.org/?p=reactos.git;a=commitdiff;h=91b51f6e9cc4467b9d86a…
commit 91b51f6e9cc4467b9d86ad31ffc130336f690f16
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Fri Dec 9 22:56:02 2022 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Fri Dec 30 11:19:26 2022 +0100
[NTDLL_APITEST] Fix LdrEnumResources test for x64
---
modules/rostests/apitests/ntdll/LdrEnumResources.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/modules/rostests/apitests/ntdll/LdrEnumResources.c
b/modules/rostests/apitests/ntdll/LdrEnumResources.c
index 1e0a0787f08..13a712bdf4b 100644
--- a/modules/rostests/apitests/ntdll/LdrEnumResources.c
+++ b/modules/rostests/apitests/ntdll/LdrEnumResources.c
@@ -162,7 +162,7 @@ InitializeTestImage(
TestImage->NtHeaders.Signature = IMAGE_NT_SIGNATURE;
- TestImage->NtHeaders.FileHeader.Machine = IMAGE_FILE_MACHINE_I386;
+ TestImage->NtHeaders.FileHeader.Machine = IMAGE_FILE_MACHINE_NATIVE;
TestImage->NtHeaders.FileHeader.NumberOfSections = 1;
TestImage->NtHeaders.FileHeader.TimeDateStamp = 0;
TestImage->NtHeaders.FileHeader.PointerToSymbolTable = 0;
@@ -170,7 +170,11 @@ InitializeTestImage(
TestImage->NtHeaders.FileHeader.SizeOfOptionalHeader =
sizeof(IMAGE_OPTIONAL_HEADER);
TestImage->NtHeaders.FileHeader.Characteristics = 0;
+#ifdef _WIN64
+ TestImage->NtHeaders.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC;
+#else
TestImage->NtHeaders.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR32_MAGIC;
+#endif
TestImage->NtHeaders.OptionalHeader.ImageBase = (DWORD_PTR)TestImage;
TestImage->NtHeaders.OptionalHeader.SizeOfImage = sizeof(TEST_IMAGE);
TestImage->NtHeaders.OptionalHeader.SizeOfHeaders = sizeof(IMAGE_DOS_HEADER) +
sizeof(IMAGE_NT_HEADERS);
@@ -202,7 +206,7 @@ InitializeTestImage(
ok_dec((_Res)->Type, _Type); \
if ((ULONG_PTR)(_Name) > 0xFFFF) \
{ \
- ok_dec(*(WORD*)((_Res)->Name), wcslen((PWCHAR)(_Name))); \
+ ok_size_t(*(WORD*)((_Res)->Name), wcslen((PWCHAR)(_Name))); \
ok_nwstr((PWCHAR)((_Res)->Name + 2), (PWCHAR)_Name,
*(WORD*)((_Res)->Name)); \
} \
else \