mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-25 15:03:39 +00:00
[host] make DXGI detect the secure desktop and wait
While we can't interact with UAC and CTL+ALT+DEL stuff, we can alteast wait around for it to return so we can re-init and continue to stream.
This commit is contained in:
parent
00c96a7dec
commit
1975bc13bc
@ -263,12 +263,24 @@ bool DXGI::GrabFrame(FrameInfo & frame)
|
||||
case DXGI_ERROR_ACCESS_LOST: // desktop switch, mode change or switch DWM on or off
|
||||
case WAIT_ABANDONED: // this can happen also during desktop switches, not documented by MS though
|
||||
{
|
||||
// see if we can open the desktop, if not the secure desktop
|
||||
// is active so just wait for it instead of aborting out
|
||||
HDESK desktop = NULL;
|
||||
while(!desktop)
|
||||
{
|
||||
desktop = OpenInputDesktop(0, TRUE, GENERIC_READ);
|
||||
if (desktop)
|
||||
break;
|
||||
Sleep(100);
|
||||
}
|
||||
CloseDesktop(desktop);
|
||||
|
||||
if (!ReInitialize())
|
||||
{
|
||||
DEBUG_ERROR("Failed to re-initialize after access was lost");
|
||||
DEBUG_ERROR("Failed to ReInitialize after lost access to desktop");
|
||||
return false;
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user