Eh, okay. I'd prefer to clean it up in wined3d_context_gl_set_gl_context() then though; it's more idiomatic to have functions leave state alone on failure.
I don't get it, it's what is being done? wined3d_context_gl_set_gl_context() already cleans things up by releasing the context DCs it previously acquired to try the backup one (https://gitlab.winehq.org/wine/wine/-/merge_requests/9382/diffs?commit_id=89...), this only adds an extra call to reset the internal pixel format it may have changed too.