I made a very simple cross-platform game library for DOS/Win32.
(I used MASM/VC++/WC++)

And, I want to make a dual EXE file that contains
PE(Portable Executable) and LE(Linear Executable).

But Both executables use file offset 3CH to identify their overlay (module).

How can I make a PE&LE dual Executable?

Thank you for reading.
Have a nice day!
Posted on 2001-11-28 21:32:24 by nyam
The only way I can think of would make the dos stub do the loading
of your LE executable, based on some other field. But then you
might just as well stick to WDOSX, which can load PE files, and even
implements a small set of the win32 api. To achieve this and still
use eg directdraw, you code a DLL for your graphics library. The trick
is that WDOS loads .WDL files instead of .DLL, so when the PE
is running dos-extended, it loads the .WDL (that can be incorporated
directly in the executable), while the windows version loads the
windows DLL... well, that's one way to do it.
Posted on 2001-11-28 22:09:02 by f0dder
Thank you f0dder for your great reply!

WDOSX works fine! :)

Thank you very much!
Posted on 2001-11-29 18:07:41 by nyam

The trick is to build the 16 bit file first and try setting it as the DOS stub. Its an option in masm. You can run a 16 bit DOS file as a DOS stub but I have never seen anyone do it with a 16 bit LE EXE file for 16 bit windows.

You could try it and see if it works.


Posted on 2001-11-30 01:39:45 by hutch--
Hutch, LE can be both 32bit and 16bit (and even mixed).

cross-platform game library for DOS/Win32.

Prolly it's dos32 as well :). It's hard to link multiple "lpfanew" images
into one exe... without custom loading code. Lalala.
Posted on 2001-11-30 01:53:36 by f0dder

That makes sense, its been 6 years since I wrote 16 bit windows code and I will be happier when its 10 years. I have a 16 bit PowerBASIC compiler that builds this stuff OK and very small but I just could not be bothered fishing around for win32wh.hlp again to look this stuff up. 16 bit windows is something like tuning a T model ford.


Posted on 2001-11-30 02:34:56 by hutch--
win16 = bleh. dos16 = bleh. dos32 can be ok. win32 is nice most of the time.
Posted on 2001-11-30 02:43:57 by f0dder