diff --git a/VERSION b/VERSION index c200b53b..fdcb6fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B1-166-g1222fd40b7+1 \ No newline at end of file +B1-167-gdbd7db7787+1 \ No newline at end of file diff --git a/c-host/platform/Windows/capture/DXGI/src/dxgi.c b/c-host/platform/Windows/capture/DXGI/src/dxgi.c index 897f80a2..2ac62271 100644 --- a/c-host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/c-host/platform/Windows/capture/DXGI/src/dxgi.c @@ -56,6 +56,7 @@ struct iface LARGE_INTEGER perfFreq; LARGE_INTEGER frameTime; bool stop; + HDESK desktop; IDXGIFactory1 * factory; IDXGIAdapter1 * adapter; IDXGIOutput * output; @@ -172,6 +173,27 @@ static bool dxgi_init() { assert(this); + this->desktop = OpenInputDesktop(0, FALSE, GENERIC_READ); + if (!this->desktop) + DEBUG_WINERROR("Failed to open the desktop", GetLastError()); + else + { + if (!SetThreadDesktop(this->desktop)) + { + DEBUG_WINERROR("Failed to set thread desktop", GetLastError()); + CloseDesktop(this->desktop); + this->desktop = NULL; + } + } + + if (!this->desktop) + { + DEBUG_INFO("The above error(s) will prevent LG from being able to capture the secure desktop (UAC dialogs)"); + DEBUG_INFO("This is not a failure, please do not report this as an issue."); + DEBUG_INFO("To fix this run LG using the PsExec SysInternals tool from Microsoft."); + DEBUG_INFO("https://docs.microsoft.com/en-us/sysinternals/downloads/psexec"); + } + // this is required for DXGI 1.5 support to function if (!dpiDone) {