|
Post by jmoffitt on Jan 19, 2021 23:43:14 GMT 1
Hello there,
We have a program that is really an amalgamation of programs that I've been trying to run in an emulator for years. The main sticking point I've hit is that at some steps the dos program calls out to a .net program. I'm not really sure what it's doing, but I think it might be pulling data from a sql table. When I try to run through that step in vdos it definitely looks like it passes out to windows to launch the app, a window pops up very quickly then closes, and then my dos app throws an error that I'm pretty sure happens when the .net app doesn't send anything back. If I follow along with procmon, I can definitely see the .net app doing work, but I think the dos app has already thrown the error.
Is there a way to keep these programs in sync?
|
|
|
Post by jmoffitt on Jan 20, 2021 0:51:53 GMT 1
|
|
|
Post by Jos on Jan 20, 2021 10:45:03 GMT 1
The issue would be that the Windows program generates some file, and the DOS program checks for that before the Windows program actually finishes. Waiting for a Windows program to finish was implemented by optionally preceding the command line to that program with WAIT. Until now that seems to do the job, however it makes sense to wait by default with a CLI program. Can you start vDos with the /log option (….vDos.exe /log) and look in the generated vDos.log file how the Windows program is started. I guess you have no option to precede the command line with WAIT.
Jos
|
|
|
Post by jmoffitt on Jan 20, 2021 15:41:49 GMT 1
Yeah, unfortunately I don't think we have the ability to modify the code anymore, but I'll check with our team and see.
Here are the relevant log entries in order I believe.
16.56 Idle end OpenFile failed: REQEDIT.OFF(2) => \REQEDIT.OFF(2) 16.64 OpenFile failed: 095CD0JK.DNC(2) => C:\Users\ Desktop\vDos - MENUENG\095CD0JK.DNC(2)
Execute: C:\COMMAND.COM - /C REQEDIT LOADALL C:\095CD0JK.DNC
Execute: REQEDIT.EXE - LOADALL C:\095CD0JK.DNC
Which definitely looks like it's trying to open the file before it has executed the program that generates the file.
|
|
|
Post by Jos on Jan 20, 2021 16:49:55 GMT 1
I would have expected a failed DirFirst or OpenFile 095CD0JK.DNC after the executes.
Since your program uses the command shell to start REQEDIT.EXE w/o specifying the extension, you could just trick it:
- Rename REQEDIT.EXE to for instance REQEDIT2.EXE. - Create a REQEDIT.BAT file with:
CMD WAIT /C REQEDIT2.EXE - LOADALL C:\095CD0JK.DNC EXIT
Mind, the C:\095CD0JK.DNC reference is that of Windows. Eventually change that to <wherever it is located in Windows filesystem>:\095CD0JK.DNC. If it doesn’t work, temporary change the /C to /K, so the command line window is kept open.
Jos
|
|
|
Post by jmoffitt on Jan 20, 2021 17:09:26 GMT 1
I'll work on trying that now. Not sure it will work because that .dnc file is randomly generated every time reqedit is run. From what I can tell it's saving the job file to that temp file, passing the temp file to reqedit, then reqedit is using that to go look something up.
|
|
|
Post by Jos on Jan 20, 2021 17:25:21 GMT 1
Then it would be: CMD WAIT /C REQEDIT2.EXE - LOADALL %2
Though Windows and vDos C: then have to match.
Jos
|
|
|
Post by jmoffitt on Jan 20, 2021 17:31:17 GMT 1
Yeah, I was just looking through those logs and think I see one of the issues here. the .net app I think is looking at windows c and the dos is looking in the vdos directory. I just tried to run vdos at the root of c to test. It still failed, but the thing that's confusing me is why is the file fail open adding a (2) to the end of the file name.
Going to try your CMD thing now.
|
|
|
Post by jmoffitt on Jan 20, 2021 17:39:17 GMT 1
Ok, I tried that and I can see it run the program and then fail after which is definitely a change in the right direction. The vdos log looks similar, except instead of failing the reqedit.exe(2) open once it fails it 23 times, and then it fails to open the randomfile(2) once. The loadall command still comes after, but that might not be an issue.
|
|
|
Post by jmoffitt on Jan 20, 2021 17:58:49 GMT 1
Following procmon, on a working computer reqedit goes and opens that generated file and then does some stuff. With the WAIT test reqedit is never able to open the generated file, my guess being it doesn't know where it is?
|
|