leecher1337 / ntvdmx64

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

16 bit MS-DOS Subsystem problem #201

Closed peter8777555 closed 1 year ago

peter8777555 commented 1 year ago

OS : Windows 7 X64 Chinese version.

I run a DOS program and got error message below


16 bit MS-DOS Subsystem

An application has attempted to directly access the hard disk, which cannot be supported. This may cause the application to function incorrectly. Choose 'Close' to terminate the application.

Close(C) Ignore(I)

1. Can it always answer "Ignore" and do NOT show the window ?

2. Which file (Source Code File/EXE/DLL) include this error message ?

Sample File for testing.

peter8777555 commented 1 year ago

By the way,

OS : Windows 7 X64 Chinese version.

I have a weird question.

Open new C:\Windows\System32\cmd.exe Run any DOS programs are OK.

Open new C:\Windows\SysWOW64\cmd.exe Run any DOS programs are OK. But sometime it can NOT run any DOS programs.


Unsupported 16-bit applications

The program or feature "\??\C:\TEST.EXE" cannot be started or executed because it is incompatible with the 64-bit version of Windows. Check with your software vendor to see if a 64-bit compatible version of Windows is available.

OK

I must un-installed NTVDMX64 and Reboot. re-installed NTVDMX64 and Reboot.

It always happen on C:\Windows\SysWOW64\cmd.exe

See DbgView_Log.log

DbgView_Log.zip

leecher1337 commented 1 year ago

Regarding the "Ignore" button: In your example file, it just asks once. But if there are multiple direct accesses, it may ask more often. Not sure, if an application would work correctly anyway, do you have an application that would work correctly despite the direct port access, so that the feature for ignoring the message would make sense?

The message itself gets processed in host_direct_access_error function in mvdm\softpc.new\host\src\nt_error.c

Regarding the error with not opening on 32bit executable, I suggest you delete the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ldntvdm

from registry. It may be that it contains an invalid offset in address cache. Cache gets refreshed if you delete ldntvdm key. Just my guess what the problem can be.

peter8777555 commented 1 year ago

Regarding the "Ignore" button: In your example file, it just asks once. But if there are multiple direct accesses, it may ask more often.

Yes,there are multiple direct accesses, it may ask more often.

Not sure, if an application would work correctly anyway, do you have an application that would work correctly despite the direct port access, so that the feature for ignoring the message would make sense?

Yes,application work correctly. Can you add a option(in registry),it always answer "Ignore" and do NOT show the window ?

Regarding the error with not opening on 32bit executable, I suggest you delete the following key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ldntvdm

Yes,you are right. I delete HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ldntvdm and works well.

If the error with not opening on 32bit executable,it always BaseIsDosApplication32 and BasepProcessInvalidImage32 with WRONG value. So i suggestion,ldntvdm always update BaseIsDosApplication32 and BasepProcessInvalidImage32 in registry.

peter8777555 commented 1 year ago

I set BaseIsDosApplication32=0 BasepProcessInvalidImage32=0

OR

I delete BaseIsDosApplication32 BasepProcessInvalidImage32

It always works well.

leecher1337 commented 1 year ago

I would need an example for repeated popups, because this piece of code should normally prevent multiple popups:

       /*
        *  Get the direct error record for the current thread
        *  if TlsGetValue returns NULL
        *     - could be invalid index (TlsAlloc failed)
        *     - actual value is 0, (no bits set)
        *  In both cases we will go ahead with the popup
        */
    dwDirectError = (DWORD)TlsGetValue(TlsDirectError);

       // don't annoy user with repeated popups
    if ((dwDirectError & (1<<type)) != 0)
        return;

    TlsSetValue(TlsDirectError, (LPVOID)(dwDirectError | (1 << type)));

The example you attached here only fires once for me.

Regarding registry key values: Normally the mechanism is to check the timestamp of the assigned .DLL file and update the values only if they are different (to prevent slowdown of code by always having to lookup the values again, which would be a problem as the Symbol Server code doesn't work when running in i.e. DllEntry). So it would be useful if there is some way to reproduce this in order to check why the values aren't updated in certain conditions.

peter8777555 commented 1 year ago

I would need an example for repeated popups, because this piece of code should normally prevent multiple popups:

I send a sample for you. Run GoLoop.bat

The example you attached here only fires once for me.

You mean it always show popup window ONE time ? Is it possible NEVER show popup window ?

peter8777555 commented 1 year ago

Test OK and Thank you a lots.