v2: - use global handle table instead of per-ddraw one; - deduplicate state between multiple devices; - deduplicate render targets between multiple devices; - add a bit more tests.
What is currently left behind in this patchset is properly handling materials and viewports set to multiple devices simultaneously. It is not overly hard to do probably, but also the thing is already complicated enough while I don't know any app depending on this functionality beyond the ability to create a second d3d device per ddraw and be able to use it.