So if a process changes the registry settings, this will _not_ restore the original display mode, is that intended?
Yes, native also restores to the current registry settings.
Generally speaking, in my opinion we should simply stop messing with the host display settings entirely and instead move toward a fully virtualized display modes.
Are we going to make the virtual display mode process-specific? If not, a restoration mechanism like this would still be useful.
This looks interesting nonetheless, even though it also raises a couple of questions like what should happen if two processes change display mode one after another?
The tests show that the last process to call ChangeDisplaySettings* "wins".