leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
823 stars 81 forks source link

Cannot run a 16-bit exe #197

Open TheGeneral007 opened 2 years ago

TheGeneral007 commented 2 years ago

I am not able to run this .exe any longer.

image

Did I forget to do something ?

During compilation I had an error, that the regedt16.exe wasn't found. I had a previous build and took it from there. There were no more errors, so I uninstalled the NTVDMX64 and installed it again.

I tried running command.com instead of cmd.exe, to see if I could start the dbu.exe there, but this also gave me an error. image

I hope you can put me back on the right direction.

Thx.

leecher1337 commented 2 years ago

First message looks like a loader problem, check DbgView output.

Second message may be missing or broken config.nt or other startup problem. Theoretically, it could be related to https://github.com/leecher1337/ntvdmx64/commit/2f4d9a5a780d60e0609b4f3cae604ef80b7f269c but I just prevent removing this file, it should still install normally, if it's not already present.

Can you check config.nt contents if the file exists and is sane and has correct access permissions?

TheGeneral007 commented 2 years ago

1} if I run I get this in DebugView:

[11636] [0703/132749.997:ERROR:filesystem_win.cc(130)] GetFileAttributes C:\Users\Marcelhome\AppData\Local\Google\Chrome\User Data\Crashpad\attachments\a1d7d201-3bb5-4fc6-9941-50a2704348b8: Het systeem kan het opgegeven bestand niet vinden. (0x2) [6796] PrivateExtractIconsWHook(C:\Tools\DBU.EXE) [6796] PrivateExtractIconsWHook(C:\Tools\DBASE.EXE) [6796] NtCreateUserProcess(ThreadHandle=0, CommandLine="C:\Tools\DBU.EXE" ) failed with C0000130 [6796] LDNTVDM: BasepProcessInvalidImage(C0000130,'\??\C:\Tools\DBU.EXE'); [6796] VDMState=00000001 [6796] LDNTVDM: Launch DOS! [11272] NTVDM: 32768K Memory: 15360K XMS, 0K EMS, 16384K DPMI [11272] YODA debug event handler installed [11272] Loading [C:\WINDOWS\system32\ntio.sys] [11272] VDM ModLoad: C:\WINDOWS\system32\ntio.sys => segment 8e05, len=8430 [11272] VDM SegMove: C:\WINDOWS\system32\ntio.sys (1) 8e05 => 70, len = 8430 [11272] VDM SegMove: C:\WINDOWS\system32\ntdos.sys (2) 9386 => a7, len = 8f29

2) You are right, they seem to be missing now. Can this be because the older uninstall was used?

  I have tried to rebuild the 2 files in another folder and then moved them to the c:\windows\system32, but still out of luck. 
 I haven't found which permissions are necessary and needed, more/other than system having all the rights. 
 I deleted them again and copied the proper ones from the releases\dos to c:\windows\system32 
 and get this failure:

image

leecher1337 commented 2 years ago

Ad 1) This looks fine to me, as it seems to launch the executable, so I'm not really sure where this 16bit error comes from. If there is a 16bit error, it shouldn't launch NTVDM at all, but log indicates that it launches NTVDM normally...?

Ad 2) I reverted the change to the .inf. If a config.nt is still there after uninstallation (as the changed uninstaller shouldn't remove it, which was the purpose of the commit), you may delete it by hand before reinstalling so that it gets written there again upon re-installation.

TheGeneral007 commented 2 years ago

I uninstalled it and updated to the latest version. Rebuild it. Installed it. And still I cannot get it back working again. image

New attempt: I now also updated to the Win10_21H2-version.

image

And now I am no longer allowed to get results in DebugView.

I am at a loss at the moment. Any ideas what I should do or should have done differently ?

TheGeneral007 commented 2 years ago

I did an install on another clean 2004/x64. Installation without errors. But no dbase.exe or dbu.exe are working. Same windows-error. Also no self-build, clipper-compiled executables are running. I will try an older build to see what happens.

TheGeneral007 commented 2 years ago

I installed a 20210412_fre_build on a Win10 2004 machine and on that install the dbu.exe is working. The difference can be _fre-build instead of the _chk-build I uninstalled it successfully. Restarted. I want to install a newer build, but it will not let me. /------- Checking machine, please wait /------- ERROR: The system was unable to find the specified registry key or value It seems that you have ntvdm.exe already on your system.

What was left behind with the older uninstall ? Any tips ?

TheGeneral007 commented 2 years ago

Ok, I have found the c:\windows\syswow64\ntvdm.exe and I deleted it and could continue.

My findings so far are that I can use dbu.exe on the ntvdm.exe build of 20220307 and not with the build of 20220704.

Have you got any idea what can cause this (=not being able to run the 16-bit dbu.exe ?

leecher1337 commented 2 years ago

The log you provided still confuses me. It shows that NTVDM gets launched and also start up successfully, but in the screenshot you provide, you get the 16bit error that should only show up, if the loader DOES NOT load NTVDM. Does the failure to start DBU.EXE depend on the subsystem of the parent application? i.e., it starts from explorer.exe, but not from cmd.exe or vice versa? I treid installing the most recent version on Windows 10 and didn't have any issues so far. Also, the change log between version 20220307 and 20220704 doesn't have any significant hcanges that could affect the Win 10 loader. So I'm a bit confused here, are you sure that your debugview log contained a FAILED attempt to start the .exe ?

TheGeneral007 commented 2 years ago

I noticed that when I open a cmd-prompt and try to run dbu.exe, I will get a failure and nothing in DebugView. When I do winver.exe from this same cmd-prompt, then this is run and things starts showing in DebugView. After this I try the dbu.exe and look and behold, the dbu.exe starts working.

W10-O365-VIRT_20220705a_dbu.exe.LOG

leecher1337 commented 2 years ago

Ok, so the loader gets launched in Windows subsystem apps and then injects into parent process upon load causing cmd.exe to be able to launch after injection. This means that for some reason, explorer.exe doesn't inject into the newly created cmd.exe process. Can you check with Process Explorer if ldntvdm.dll is properly loaded in explorer.exe ?

One of the changes on Mar 30 was that Windows 11 loader is now default for Windows 10 too, whereas it previously was using an AppInitDLL-Based loader. As the Win10 loaders are still available in the installation package, you can try to enforce the older Win 10 loader just by reverting this change in the installation batch file:

https://github.com/leecher1337/ntvdmx64/commit/991923afdbff3120af43c94db1791cf4c2fa35bf (basically, just remove the REM from the REMmed lines).

TheGeneral007 commented 2 years ago

Open the .cmd and checked for ldntvdm.dll and is not found. Ran dbu.exe and checked and not found. Ran winver.exe and checked and FOUND 2x. 1x cmd.exe 1x conhost.exe Now dbu.exe was working. I ran both dbu.exe and winver.exe from that same cmd-prompt

After closing the cmd-windows, there were no handles to ldntvdm.dll left and after opening a new cmd-prompt, dbu.exe was not able to run, as there was no ldntvdm.dll in explorer.exe anymore.

Changed Install.bat = Yep, spot on. That is it. That is the difference. With this loader it is running instantly.