Bug 39878 clearly established that current Windows versions don't do such clamping. Does this application work on current Windows versions?
Yes, current Windows doesn't clamp that. Well, there are few things to this. First, the current Steam release of the game ships dgVoodoo ddraw implementation alongside game which is intentionally broken under Wine (does a stealthy Wine check and then simulates a crash later by adding QPC value to some pointer). Then, with that ddraw.dll removed, the game can still be started on Windows by setting compat option 'start in 640x80 resolution'). The game is basically unplayable this way and exhibits various heavy glitches, while it is still possible to get to the game and observe that the issue concerned here (low textures resolution) is actually not there. That is also affected by D3DDEVCAPS_TEXTURENONLOCALVIDMEM flag in HAL dwDevCaps. When that is set (which happens on Win11 at least on the device it ends up with) it doesn't actually mind GetAvailableVidMem result, even though still queries that. If that is not set (like in our case) >2GB memory gets into signed comparison (and thus is negative) and the game considers there is not enough VRAM for textures of higher resolution.
As you mentioned, we do clamp the reported video memory for older Windows versions. (And IIRC that matches the actual behaviour of those versions.) Why is that not sufficient for this application?
It is not sufficient because obviously the default prefix has newer Windows and the game doesn't work OOTB. Changing it manually is sufficient of course. So yes, WRT this specific game it would be probably possible to explore the life of D3DDEVCAPS_TEXTURENONLOCALVIDMEM, look in more details which device type it ends up with on Windows (it is HAL on Wine), and maybe (not necessarily as it actually might be different for old Windows and present) this specific game can be fixed by sometimes reporting D3DDEVCAPS_TEXTURENONLOCALVIDMEM. If we consider manual tinkering and configuration setting WinXP version also works. I sent this specific patch because I was under impression that we help some range of games in default config this way, while probably nothing benefits from reporting >2GB on ddraw specifically. We preliminary discussed that with Zeb and she wasn't against this approach at once. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11090#note_142448