mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[c-host] Enable secure desktop capture using SetThreadDesktop
Closes #263 - Credit to https://github.com/DataBeaver for this gem!
This commit is contained in:
parent
dbd7db7787
commit
d3836d4548
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user