This commit makes `CDebug` use Unicode internally instead of whatever
random code page is in use. It also gets rid of the horrible character
counting and replaces that with `vasprintf` and `vaswprintf` helpers
(partially inspired by Linux) which allocates a buffer.
For HRESULT logging, the error code in both hex and decimal are included.
The output is now guaranteed to be UTF-8.
Custom modes can now be configured via the registry under
HKEY_LOCAL_MACHINE\SOFTWARE\LookingGlass\IDD
Create the value "Modes" as a REG_MULTI_SZ with the value as
a list of modes, for example:
1024x768@60
1920x1080@60
1920x1080@120*
The '*' denotes the preferred mode to default to if one has not
been selected by the user.
If the screen is blanked or removed through a user action
`IddCxMonitorQueryHardwareCursor` will return with a failure. This
is normal and we should not log this as an error.
It is invalid to call `IddCxMonitorSetupHardwareCursor` before
`IddCxSwapChainSetDevice`. This fixes this by moving the thread into
CSwapChainProcessor and starting it after `IddCxSwapChainSetDevice`
has succeeded.
The callback runs in a random thread, we can't call directx methods
safely from it, so move reset so it's called automatically when a free
copy list is obtained.
`IddCxSwapChainFinishedProcessingFrame` must be called after every
frame, but we should do it as early as possible once all commands
are queued that use the frame.
As the resource size can be larger then the actual frame data, we
need to track this seperately so that we don't waste cycles copying
data the client will never use.
As the IDD itself runs in a WUMDF sandbox, it doesn't have enough
access to perform interactive operations such as moving the cursor.
This helper service communicates with the IDD over a named pipe,
so that we can perform these things, as well as in the future provide
a configuration GUI.