https://bugs.winehq.org/show_bug.cgi?id=40537
--- Comment #17 from Henri Verbeet hverbeet@gmail.com --- (In reply to François Gouget from comment #16)
I'll add that removing either DDSCAPS_COMPLEX or DDSCAPS_FLIP from surface_desc.ddsCaps.dwCaps for the IDirectDraw_EnumSurfaces() call avoids the crash. It's only when they are together that the crash happens. (reader from the future: see the modified test attachment)
That makes sense, removing those likely makes it fail validation in the ddraw runtime, before the driver gets involved.