"Chris Morgan" cmorgan@alum.wpi.edu wrote:
I have a .com application that is calling out to dos int21 4Bh to load and execute a program. MZ_Exec assumes this program is always going to be a dos executable and the application fails to run and complains that it is a pe executable. So I've started to try and add support for correctly handling pe executables.
If that is what Windows really does, then your approach is certainly right. Did you check how Windows does behave in that case?
So far I have a patch like below but I'm thinking that a lot more needs to be done in order to fulfill the dos requirements of this function and kind of wanted some opinions on this. This compiles but I haven't tested it since the program is at work, just wanted to get some feedback.
- binType = MODULE_GetBinaryType(hFile);
Why not call GetBinaryTypeA here? It will be much cleaner and will not break DLL separation.