leecher1337 / ntvdmx64

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

Clarification about internet dependency (MS symbol server) #156

Open gorgzilla opened 2 years ago

gorgzilla commented 2 years ago

Hello,

The readme states this: "You must also ensure, that the machine is connected to the Internet during the first run of a DOS-Application, because the loader code needs to fetch symbols from the Microsoft Symbol server so that it can call OS internal functions in order to properly start NTVDM."

Is this really necessary? How does it affect NTVDM if I don't have a connection to the internet? I have a machine (Win10 64bit) which is in a network with a DHCP server but no internet connection. When the computer is not connected to the network 16bit applications start instantly but when the computer is connected to the network it takes a very long time for the apps to start and close. Some system components like task manager freeze up, too during that time. The solution was to put in 127.0.0.1 as a DNS in the network config to prevent the long starts/freezes.

My question is how can I get rid of the apparent dependency on a working internet connection for NTVDM? And if the symbols are necessary for applications/NTVDM to run properly, how can I prevent them from getting deleted from the temporary folder, and which folder is it (so I can back them up) ? Thanks

leecher1337 commented 2 years ago

Hi,

The problem is that nowadays, the system files that need to be patched, change very frequently with nearly every update. So to ensure proper operation across minor system updates (I still recommend uninstalling NTVDMx64 before installing certain updates that change conhost.exe, as they may fail when the loader is active, but fortunately, there are not many updates that are affected by this), the loader always checks if the symbol files match the current version of the DLL. If this is not the case, the loader tries to download the matching symbols from the symbol server and for that in order to work, it needs an Internet connection to use the Microsoft Symbol Server. If you don't have an Internet connection available, you can also download the necessary symbols manually and put them into \Windows\Symbols directory (including the necessary directories, so directory i.e. contains: kernel32.pdb wkernel32.pdb appinfo.pdb conhost.pdb subdirectories). The install.bat tries to download the current symbols for your system during installation. So you can download the symbols manually by executing the symfetch lines from https://github.com/leecher1337/ntvdmx64/blob/master/ntvdmpatch/release/install.bat If you need to download the symbols on another system with internet access, you may need to copy the necessary files from the target system to the system with Internet access, then execute symfetch lines for all these files (the one from the target system, of course), and then copy the fetched symbols to the target system to Windows\symbols directory. If you have the correct symbol files in the temp directory, you can copy them to windows\symbols directory so that they don't get lost, as this path is also in the Symbol search path of the loader. Regarding your question about the delay that gets introduced by the symbol loader: As soon as the symbol files on the target system match the .dll file versions, the loader should detect it and not try to download the symbol files again, thus you should not experience a delay anymore.

Does that answer your question?

gorgzilla commented 2 years ago

Yes, thank you.