Do we have tests that attaching backbuffers is illegal in ddraw2/4/7? It would be nice to add them if not. 2/4: I apologize for not being able to think or read very well, but why do we need both is_root and is_chain_start? Why can't we just modify is_root? detach_clear_flags I don't like for reasons that are hard to describe. I think we can instead store the original flags (and I'd say "original_caps") and selectively restore those on detach? Does that work or am I missing something? 4/4: ``` + if (force_3ddevice(ddraw, desc, version)) + caps |= DDSCAPS_3DDEVICE; ``` I don't find this sort of thing very idiomatic; I would prefer to just do "if ((caps & 3DDEVICE) || (version == 1 && (caps & PRIMARYSURFACE)))". At that point it probably doesn't need a helper function either. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10992#note_141605