For a bit more context, this is one of four patches that allow us to run selected tests on Windows 98. This may be a bit of a controversial proposition, so I'm submitting this patch on its own since I think it's an improvement regardless.
The other three patches for Windows 98 are much simpler, comprising a diffstat of 11 total lines, and I've pushed them as https://gitlab.winehq.org/zfigura/wine/-/commits/win98.
I've found this extremely useful for running DirectDraw tests on real contemporaneous hardware.