[PATCH v2] kernel32/tests: Allow failure when loading the 268 bytes minimal PE image.

Francois Gouget fgouget at codeweavers.com
Mon Jul 19 07:23:41 CDT 2021


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>
---
v2: Fixed v1's comment to match the platforms this test accutally 
    succeeds on.

w7u (32-bit Windows 7) rejects this image but not w7pro64.
cw-rx460 (64-bit Windows 8.1) also rejects this image but not
cw-gtx560, w8 and w864.
So this image is sometimes rejected by Windows versions that are
expected to accept it without the reason being known.
https://test.winehq.org/data/patterns.html#kernel32:loader
---
 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 1db68a191a3..4ec77670f8c 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,
-- 
2.20.1



More information about the wine-devel mailing list