Dmitry Timoshkov : kernel32: Add a minimal PE image that XP is able
to load .
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Dec 19 10:04:54 CST 2006
Module: wine
Branch: master
Commit: 5fc9ffd500c77d508797a57a3f7a89303e4a74fe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5fc9ffd500c77d508797a57a3f7a89303e4a74fe
Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date: Mon Dec 18 19:14:36 2006 +0800
kernel32: Add a minimal PE image that XP is able to load.
---
dlls/kernel32/tests/loader.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c
index 7ae70f3..8811334 100644
--- a/dlls/kernel32/tests/loader.c
+++ b/dlls/kernel32/tests/loader.c
@@ -185,6 +185,14 @@ START_TEST(loader)
0,
ERROR_SUCCESS
},
+#if 0 /* not power of 2 alignments need more test cases */
+ { &dos_header, sizeof(dos_header),
+ 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x300, 0x300,
+ 1,
+ 0,
+ ERROR_BAD_EXE_FORMAT /* alignment is not power of 2 */
+ },
+#endif
{ &dos_header, sizeof(dos_header),
0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 4, 4,
1,
@@ -210,6 +218,14 @@ START_TEST(loader)
0x200,
ERROR_SUCCESS
},
+ /* Minimal PE image that XP is able to load: 92 bytes */
+ { &dos_header, 0x04,
+ 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum),
+ 0x04 /* also serves as e_lfanew in the truncated MZ header */, 0x04,
+ 1,
+ 0,
+ ERROR_SUCCESS
+ }
};
static const char filler[0x1000];
static const char section_data[0x10] = "section data";
@@ -412,7 +428,7 @@ todo_wine {
ok(FreeLibrary(hlib), "FreeLibrary error %d\n", GetLastError());
}
else
- { /* LoadLibrary has failed */
+ { /* LoadLibrary is expected to fail */
ok(!hlib, "%d: LoadLibrary should fail\n", i);
if (GetLastError() == ERROR_GEN_FAILURE) /* Win9x, broken behaviour */
More information about the wine-cvs
mailing list