-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows 98 and Windows 10 SDK compatibility #1
Comments
Hello @danielmarschall. That said, I can answer some of your questions though: (1) You are apparently using the "msvc-v141-xp" branch of EnlyzeWinCompatLib, which provides compatibility down to Windows 2000 using the Windows SDK 7.1. Among other things, that code fixes the mentioned problem with the (2a) (2b) I'm surprised that
For a first try, I would also implement (3) For the "msvc-v141-xp" branch, this is a two-stage process. You first untick "Inherit from parent or project defaults" and then include "EnlyzeWinCompatLib.h". That header file has "/lib" commands to add the missing library references again, but AFTER linking to EnlyzeWinCompatLib first. (4) Try moving your entire project to my "clang" branch and the Clang toolkit as proposed in my latest blog post. See the clang version of my Wizard-2020 project as an example. This should solve both of your problems:
(5) Off the top of my head, I would select all files of |
Hello, thank you very much for your extensive answer! I am sure there are no Windows 95/98 users of my software out there, but it gives me a "good feeling" to document that my software works with every 32/64 Windows version of Windows that has every existed. Yes, it sounds a bit strange, and is probably also mixed with a lot of nostalgia :-) It would be nice if EnlyzeWinCompatLib could help me building with Visual Studio, but if it will fail, I can still continue using OpenWatcom for the x86 builds of my application. I will try your "clang" branch and check if the problems persist. In re (2): I have checked the following directories and searched for all *.c and *.h files
It seems like What I don't understand is why
I don't have much experience with these compiler settings. I have a question: Will this compiler setting let my code be less effective on modern CPUs, by omitting fancy OP codes that could improve performance, or will the executable determine its own CPUID in order to find out which code branch will be used? |
If |
Thank you very much for your solution of making Visual Studio applications compatible with older Windows versions.
I try to achieve to run an application on Windows 95 while compiling using Visual C++ 2019. Currently I need to compile with OpenWatcom in order to create a Win95 binary of my application.
I have following problems:
(1)
In winnt_50.cpp at function
_CompatInterlockedFlushSList
:In my Windows 10 SDK, the field "Sequence" is only available if
defined(_AMD64_)
ordefined(_ARM64_)
, but not fordefined(_X86_)
ordefined(_ARM_)
.For x86, the definition in my Win10 SDK is:
For the moment, I have simply commented out the line. But I am not sure if that fix is appropriate.
(2)
In my application I have following unresolved Win2000 dependencies which are supported by EnlyzeWinCompatLib:
DecodePointer
InitializeSListHead
GetModuleHandleExW
InterlockedFlushSList
(2a) In addition, I see following unresolved Win98 dependencies:
SetFilePointerEx
GetFileSizeEx
=> For these two functions, I have created following patch (sorry, I am not used to GIT/PullRequests, so I just uploaded my code).
EnlyzeWinCompatLib-Patch-VTS-1.zip
I haven't tested the functions themselves, and I am not sure if winnt_50.cpp is the correct "home" for these two functions. I think I should have called the file win98.cpp, since it implements functions missing in Windows 98. With the patch, I could successfully run my application on Windows 98 SE!
(2b) Win95 has more additional dependencies (used by the SDK, not used in my code):
FindFirstFileExW
(For Win95, the only way would be a fallback/convertion to FindFirstFileA)InitializeCriticalSectionAndSpinCount
(Can we simply call InitializeCriticalSection and ignore the spin feature, or will this lead to problems?)IsDebuggerPresent
(We can always return 0)IsProcessorFeaturePresent
(That will be very hard to implement. I'll have to look in the SDK source to see if this function is used in a critical way)=> Would it be possible to write patches for these functions as well? I would be super happy about it!
(3) When I untick the option "Inherit from parent or project defaults" as described on your website, I get a lot of errors of unresolved symbols, so I cannot build my executable. What am I doing wrong?

If I simply place the source files into my own project (without dependency), then it works.
(4) My application (a Photoshop plugin) crashes on one Win2000 computer and on another Win2000 VM it doesn't crash.
The crash happens when I call the function
ceil
. Directly afterceil
is executed, theCompatInterlockedFlushSList
compatibility function is called, and after that call, the program crashes.This sample program will output the debug messages A, B, C and then crashes.
So, I have the suspicion that the reason is my commented out
NewHead.Sequence++
, and it is most likely dependent on the CPU of the computer.But, theoretically, it is also possible that Visual C++ 2019 creates CPU OP codes which cannot be executed by the CPU of the old computer (Intel Celeron 500 MHz), and the call to
InterlockedFlushSList
is invoked by a crash handler or similar. Havingceil
crashing probably means that there is some CPU airthmetic related stuff going on, probably in combination with compiler optimizations.(5) When I included the .asm files in my project and enabled "masm", I cannot compile my application with Win64 anymore. (I compile my application in 32 and 64 bit)
Following errors show up when I try to compile as X64:
I get a lot of errors at
_CompatInterlockedFlushSList
, saying "union _SLIST_HEADER has no member Next/Depth/Sequence".The asm files show that
.model flat
has a syntax error, because "model" is not existing in x64How can I completely disable "masm"/EnlyzeWinCompatLib for the X64 build?
Thank you for your help!
The text was updated successfully, but these errors were encountered: