This saddens me. Who knows how much valuable info has been lost. I recall back in the days of MSDN, we had docs back to early Windows, and it was a wonderful historical record. Today's Docs site seems to keep info only for a few versions.
The VS2008 version purged all API information regarding pre-Windows 2000.
Incredible that a few decades after thinking "All the world's knowledge will be online", we probably have to return to physical libraries to find the knowledge that ended up not being online anymore.
When available I just buy the GOG versions instead, but even those versions sadly often have issues.
Meanwhile slightly older games from the DOS era works perfectly everywhere thanks to DOSBox. I would love to see something like that for old Windows. Merge DOSBox with WINE, someone?
Otherwise, 86Box is a pretty good full-system emulator for everything up to the early 3D era.
As for DRM, there's various ways around it of course :)
(I think this game is probably past those times but not by much)
I expected to see significantly more code, pass-through to the original DLL.
Yup! That's why I didn't have to create a gazillion passthrough functions.
The original DLL in my modern Windows installation has these 8 exports:
DirectInputCreateA
DirectInputCreateEx
DirectInputCreateW
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
The game only calls DirectInputCreateA, and the rest happens via the COM object that that function creates.Seems pretty straightforward. They hook DirectInputCreateA() and pass their own device enumeration wrapper with the offending flag removed.
The idea is, rather than handle up to 8 devices, otherwise UB and usually crash, handle up to 8 "joysticks" and disregard any beyond that.
Interesting article, thank you.
But yeah, with the info provided it should be patchable. It's a `push esi` though, where esi has to stay 0 for a few further usages, so it's a bit more than a one-byte patch. It also wouldn't fully resolve the OOB write in the rare case where you _do_ have 9+ game controllers connected.