The commit adding more SwapDeviceContextState() tests (ccffc06c6df3) is causing d3d11:d3d11 to crash on the GTX 560 Nvidia card:
https://test.winehq.org/data/patterns.html#d3d11:d3d11
It turns out that the crash is happening in the final ID3D11Device1_Release(device) call in test_device_context_state().
So that's probably a reference counting bug in the Nvidia driver but it still happens on the latest driver for that GeForce GTX 560 card : 391.35.
So what should we do? Drop the final ID3D11Device1_Release(device) call? Drop the extra tests? Something else?