[Spice-devel] [PATCH 2/3] vdagent: don't stop due to UIPI blocking

Alon Levy alevy at redhat.com
Mon Sep 10 07:49:57 PDT 2012


ACK with one question.

> User Interface Privilege Isolation is usually used only for specific
> windows of
> system security applications (anti-viruses etc.), so with this patch
> mouse will
> be irresponsive for these windows but keep working for the rest. A
> complete
> solution might be switching to server mouse mode while the agent is
> still active.
> ---
>  vdagent/vdagent.cpp |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> index 3ffafe3..078e50f 100644
> --- a/vdagent/vdagent.cpp
> +++ b/vdagent/vdagent.cpp
> @@ -429,9 +429,14 @@ bool VDAgent::send_input()
>              return false;
>          }
>      }
> -    if (!SendInput(1, &_input, sizeof(INPUT)) && GetLastError() !=
> ERROR_ACCESS_DENIED) {
> -        vd_printf("SendInput failed: %lu", GetLastError());
> -        ret = _running = false;
> +    if (!SendInput(1, &_input, sizeof(INPUT))) {
> +        DWORD err = GetLastError();
> +        // Don't stop agent due to UIPI blocking, which is usually
> only for specific windows
> +        // of system security applications (anti-viruses etc.)
> +        if (err != ERROR_SUCCESS && err != ERROR_ACCESS_DENIED) {

layman question: Isn't there a more specific UIPI error code?


> +            vd_printf("SendInput failed: %lu", err);
> +            ret = _running = false;
> +        }
>      }
>      _input_time = GetTickCount();
>      _desktop_layout->unlock();
> --
> 1.7.4.1
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 


More information about the Spice-devel mailing list