LOADER: fill in the MZ header in builtin PE DLLs

Mike McCormack mike at codeweavers.com
Thu Sep 2 20:55:12 CDT 2004


ChangeLog:
* fill in the MZ header in builtin PE DLLs
-------------- next part --------------
Index: libs/wine/loader.c
===================================================================
RCS file: /home/wine/wine/libs/wine/loader.c,v
retrieving revision 1.21
diff -u -r1.21 loader.c
--- libs/wine/loader.c	14 Jun 2004 17:07:30 -0000	1.21
+++ libs/wine/loader.c	3 Sep 2004 00:26:17 -0000
@@ -276,6 +276,17 @@
     /* Build the DOS and NT headers */
 
     dos->e_magic  = IMAGE_DOS_SIGNATURE;
+    dos->e_cblp   = sizeof(*dos)%0x200;
+    dos->e_cp     = (sizeof(*dos)+0x1ff)/0x200;
+    dos->e_crlc   = 0;
+    dos->e_cparhdr = (sizeof(*dos)+0xf)/0x10;
+    dos->e_minalloc = 0;
+    dos->e_maxalloc = 0xffff;
+    dos->e_ss     = 0x0000;
+    dos->e_sp     = 0x00b8;
+    dos->e_ip     = 0x0000;
+    dos->e_cs     = 0x0000;
+    dos->e_lfarlc = sizeof(*dos);
     dos->e_lfanew = sizeof(*dos);
 
     *nt = *nt_descr;


More information about the wine-patches mailing list