|
|
|
|
|
by Deadcode0
2166 days ago
|
|
I'll take this one :) Not even a hello world supports Windows 95 when compiled by MSVC 2005, and it's just because of a call to IsDebuggerPresent() in the standard library's startup code. To work around this, I overrode the definition of that function in one of WA's .cpp modules, to delay-load the real function, and return FALSE if it doesn't exist: extern "C" __declspec(noinline) BOOL WINAPI _imp__IsDebuggerPresent(VOID)
{
typedef BOOL (WINAPI *IsDebuggerPresent_t)(VOID);
if (HMODULE lib = GetModuleHandle("KERNEL32.dll"))
if (IsDebuggerPresent_t proc = (IsDebuggerPresent_t)GetProcAddress(lib, "IsDebuggerPresent"))
return proc();
return FALSE;
}
(Many more hacks like this would be necessary if using a later version of MSVC. So I use Daffodil to allow using a later version of Visual Studio while still using Visual C++ 2005 for the actual compiling.)Other than that, it was just a matter of identifying all the API calls requiring Windows 98 or later and replacing them with their Windows 95 equivalents. In cases where this would mean sacrificing functionality, that meant delay-loading the Windows 98-or-later version and falling back to the Windows 95 version if necessary, such as with GetDiskFreeSpaceEx() vs. GetDiskFreeSpace(). |
|