Zhiyi Zhang (@zhiyi) commented about dlls/uxtheme/tests/system.c:
For the last error code. You can SetLastError(0xdeadbeef) before the call and check that the last error is set to ERROR_SUCCESS after the call. And then you set the last error code in the ShouldSystemUseDarkMode() implementation.