Francois Gouget : kernel32/tests: Allow failure when loading the 268 bytes minimal PE image.

Alexandre Julliard julliard at winehq.org
Tue Jul 20 15:11:04 CDT 2021


Module: wine
Branch: master
Commit: 542dc085c91c249ca569473029578f4ed0d38537
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=542dc085c91c249ca569473029578f4ed0d38537

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Mon Jul 19 14:23:41 2021 +0200

kernel32/tests: Allow failure when loading the 268 bytes minimal PE image.

Windows 10 1809+ rejects this minimal image so allow ERROR_BAD_EXE_FORMAT
as a valid result.
Also adjust the comment to reflect the range of Windows versions that
usually accept this image and note that there are some exceptions which
means there are other unidentified factors at play.

Wine-Bug: https://bugs.winehq.org//show_bug.cgi?id=51185
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/loader.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 0a13179b106..8faacb07587 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -860,7 +860,10 @@ static void test_Loader(void)
           0,
           { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */
         },
-        /* Minimal PE image that Windows7 is able to load: 268 bytes */
+        /* Minimal PE image initially created for Windows 7 and accepted from
+         * Vista up to Windows 10 1709 with some unexplained exceptions:
+         * 268 bytes
+         */
         { 0x04,
           0, 0xf0, /* optional header size just forces 0xf0 bytes to be written,
                       0 or another number don't change the behaviour, what really
@@ -868,7 +871,7 @@ static void test_Loader(void)
           0x04 /* also serves as e_lfanew in the truncated MZ header */, 0x04,
           0x40, /* minimal image size that Windows7 accepts */
           0,
-          { ERROR_SUCCESS }
+          { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* rejected by win10 1809+ */
         },
         /* the following data mimics the PE image which 8k demos have */
         { 0x04,




More information about the wine-cvs mailing list