leecher1337 / ntvdmx64

Run Microsoft Windows NTVDM (DOS) on 64bit Editions
780 stars 80 forks source link

WOW32 Support won't load in new Windows 10 (x64) and Windows 11 (x64) Installations #187

Closed kllkradio closed 2 years ago

kllkradio commented 2 years ago

I just created fresh installation Windows 11 (21H2) and Windows 10 (21H2) onto to two different computers. I ran into the same problem when installing ntvdmx64 with WOW32 support on both computers. Both computers have secure boot enabled and use UEFI. Ntvdmx64 installs without any difficulty on both computers and appears to be working correctly, but the NTVDMx64 WOW32 Support gives the following errors: "INF Install Failure". Access is Denied. "Advanced INF Install". INF Install Failure. Reason: Access is Denied. This issue appears to be similar to that which was reported in Issue #101.

I used autobuild to compile the most recent autobuild-ccpu-fre.cmd, but also got the same result using the most recent compiled code from Columbia.edu. I also turned off Windows Defender virus protection while doing the installation. I tried implementing the fix mentioned in Issue #101, but it didn't do the trick. I have no other anti-virus software installed.

I might also add that I had to run autobuild twice to get it to completely compile the code. One the first run, it gave me the same error as in issue #178. When I ran autobuild a second time it was able to complete the entire process.

Thanks for creating this fabulous patch!

Brian Henry

leecher1337 commented 2 years ago

If you already have installed NTVDMx64 and just WOW32 installation fails, you can try to only launch WOW32 installer as Administrator from commandline with:

RunDll32 advpack.dll,LaunchINFSection wow32.Inf

in installation directory, so that you don't have to run the full installatino procedure everytime when testing. Do you get the installation question at least?

image

If you are just getting "access denied", something on your system is blocking access to the file. You can use Sysinternals ProcessMonitor to check file access on your system during installation attempt to find out which file access gets denied. Maybe this sheds some light on the issue? The command is executing just fine on my Windows 11 21H2. It's hard to find out what is blocking file access on the system, may be some filter driver or maybe it's just a simple file permission issue. Antivirus programs are notorious for interfering with normal system operation, so these are normally my first suspects, but you said you completely disabled them.

kllkradio commented 2 years ago

Thank you for the reply!

Yes, I am getting the installation question.

I ran the command line link and got essentially the same errors but with a bit more detail.

There are two errors. Both files are in their respective directories so it does seem as though something in Windows is preventing the action.

Copy Error Setup cannot copy: Olethk32.dll Copy files from: C:\NTVDMBLD\releases\usa\ole2

Copy Error Setup cannot copy: Comm.drv Copy files from: C:\NTVDMBLD\releases\usa\wow32

As I mentioned, this occurs with two separate new clean installations on two different computers. One running Windows 11 (x64) Pro (21H2) and the other running Windows 10 (x64) Home (21H2) so there appears to be something in common with both.

I defeated Windows Defender by running the Windows Security App, went to manage settings, and turned the real time protection off.

leecher1337 commented 2 years ago

Ah, that makes some sense then. I remeber that there were indeed some file permission issues with these files on completely virgin Windows installations where file access rights for some of these fiels weren't already adjusted. The WfpReplace.exe doesn't know about i.e. Win 11 and may refuse working there, thus not turning off WFP protection. That's why it doesn'T occur on a system where I already cleanly installed it once. Will check with a clean fresh installation image then.

kllkradio commented 2 years ago

It has been a bit of a challenge making it to this point with my rudimentary skills. Initially, I just tried to download and install the compiled version. Even that wasn't easy as in order to do so, you have to disable Windows Defender "Real Time Protection". Once I figured that out, I was able to successfully install ntvdmx64, but then ran into the problem with the WOW32 installation. I then decided to compile the code myself using autobuild. It took some hunting around to track down all of the installation programs. I lucked out when I decided to run autobuild a second time after it failed the first time which allowed it to finish the compilation process. I am blown away that you figured all of this out! It is one of the reasons that I decided to give the 64-bit version of Windows 11 a try. Hopefully, these issues won't be too hard to sort out.

leecher1337 commented 2 years ago

I currently tested WOW32 installation with a fresh Windows 11 21H2 (Build 22000.194) VM and didn't experience any issues on installation. WOW32 starts up normally after installation. What you can try: install.bat has a section where it executes code that takes ownership of the .dll files in question and moves the old ones to a backup directory:

:instole
for %%F in (olethk32.dll compobj.dll ole2.dll ole2disp.dll ole2nls.dll storage.dll typelib.dll) do call :replsysfil %%F %2 %3
goto fini

...

:replsysfil
if not exist %3\%1 (
  takeown /f %2\%1
  cacls %2\%1 /e /p %USERNAME%:F
  move %2\%1 %3\
)

My guess is that the fiel was already backed up, so the routine isn't running and isn't doing takeown /F and cacls on the file, so if the file got protected again, it isn't unprotected by setup. You can try to change the code to:

:replsysfil
takeown /f %2\%1
cacls %2\%1 /e /p %USERNAME%:F
if not exist %3\%1 move %2\%1 %3\
exit /B

and report back if that helps (the install.cmd is called from wow32.inf, so you can still test with RunDll32 advpack.dll,LaunchINFSection wow32.Inf ) That would explain the problem with olethk32.dll, but why it also fails on comm.drv is strange, because this file originally doesn't even exist on a fresh, clean Windows installation and gets copied by the installer. You may want to check its security permissions.

kllkradio commented 2 years ago

Hmmm. That wasn't what I had expected.....

Do you think that there is any difference between a virtual machine and an actual one? What makes my two computers different from yours? Both of mine have Secure Boot enabled and use UEFI. The one running WIN11Pro has TPM 1.2 enabled and the one running WIN10 Home has TPM 2.0 enabled.

Unfortunately, the change to the install.bat file wasn't the fix. The two errors that it now gives are:

Advanced INF Install. INF Install failure. Reason: Access is denied

NTVDMx64 WOW support INF install failure. Reason: Access is denied

It no longer shows the copy error dialogs.

I did disable Windows Defender, but that made no difference.

leecher1337 commented 2 years ago

Well, my fresh Windows 11 image wasn't THAT fresh (it was ca. October 2021), as this was the earliest snapshot of my VM without any other stuff installed to ensure that it's a clean install. Maybe the INF installer is simply broken in recent Windows versions? I don't think that it has to do with UEFI/Secure Boot, as this can prevent the loader from working, but it shouldn't have any effect on .inf installation. Also, an Antivirus may get upset wit hthe loaders, but the WOW32 components usually don't trigger false positives. That looks more like a fault in the .inf installer.

Do you have the possibility to install a VM with the same installation medium you used for the physical machines and check if it fails there, too? If you create a VM snapshot prior to installing, you could send me the VM image then so that you problem can possibly be reproduced.

You can try to manually install WOW32 support by just copying the files from ole2, vfw16 and wow32 directories to Windows\SysWOW64, importing reg\wow.reg and manually creating the registry keys mentioned in wow32.inf, but it would be more interesting what causes the INF installer to fail on your machines.

kllkradio commented 2 years ago

I won't be home for the next few days so I won't be able to tackle any of this for a while.

For installing Windows, I just used a 16 GB SanDisk USB stick with an ISO image that I downloaded directly from the Microsoft website. I didn't do anything special. I just booted from the USB stick and let it do its thing onto a clean hard drive.

I have never created a VM so I will need to do little research in order to do that.

Thanks again for your help. I'll check back in when have an opportunity to work on this some more.

leecher1337 commented 2 years ago

Could reproduce it on a physiscal machine. Seems to be some kind of permission problems with the files being replaced. Even though cacls runs through sucessfully, it doesn't lat you replace the files. If you add permissions via GUI dialog, it works. Weird...

leecher1337 commented 2 years ago

Interestingly, when I installed a brand-new Windows 11 in a VM, the problem couldn't be reproduced. Very weird, indeed.

kllkradio commented 2 years ago

Interesting. Did you also run into the problem where you had to run autobuild twice to compile the software on the physical machine?

leecher1337 commented 2 years ago

If the patch fixed your issue, please close it as solved

kllkradio commented 2 years ago

The installation works flawlessly, now! Thank you!