[PATCH v2 3/4] krnl386.exe16: Assume expected Windows version of 1.01 if NE file has no

Martin Payne development at martinpayne.me.uk
Sat Dec 16 15:04:46 CST 2017


expected version set, or if the linker major version is 4.

Tested on Fedora 26 x86
---
 dlls/krnl386.exe16/ne_module.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dlls/krnl386.exe16/ne_module.c b/dlls/krnl386.exe16/ne_module.c
index 673b627208..b3c0b75a4d 100644
--- a/dlls/krnl386.exe16/ne_module.c
+++ b/dlls/krnl386.exe16/ne_module.c
@@ -648,6 +648,11 @@ static HMODULE16 build_module( const void *mapping, SIZE_T mapping_size, LPCSTR
 
     pModule->ne_flags &= ~(NE_FFLAGS_BUILTIN | NE_FFLAGS_WIN32);
 
+    /* The original NE spec (which link4 version 4.x follows) doesn't have an ne_expver field and reserves it for
+       future use. Other early executables have the version set to 0.0. Assume Windows 1.01 in either case. */
+    if ((ne_header->ne_ver == 0x04) || (ne_header->ne_expver == 0x0000))
+        pModule->ne_expver = 0x0101;
+
     /* Get the segment table */
 
     pModule->ne_segtab = pData - (BYTE *)pModule;
-- 
2.15.1.windows.2




More information about the wine-devel mailing list