[Spice-devel] [vdagent-win v1] vdagent-win: start vdagent with lock info from session

Victor Toso victortoso at redhat.com
Tue Dec 13 15:15:25 UTC 2016


Hi,

On Mon, Dec 12, 2016 at 10:46:34PM +0100, Victor Toso wrote:
> and maybe move the variable definition to the top?
>
> Acked-by: Victor Toso <victortoso at redhat.com>
>
>   toso

I'm removing the ack from this patch. Sorry for the noise.

The issue is around the whole solution in verifying reliably the
lock/unlock status of the session. There is race in vdagent.exe in
regard of receiving the sessions notifications, trying to summarize it
bellow:

Normal workflow:
1) User clicks to Lock the session
2) vdagent receives: WTS_SESSION_LOCK and updates its _session_is_locked
3) vdagent receives: CONTROL_ACTION -> CONTROL_DESKTOP_SWITCH which will
   set its _desktop_switch to true, making the
   input_desktop_message_loop() to end, which will end up calling
   WTSUnRegisterSessionNotification() in the process;

Race workflow:
(3) happens before (2). That means, WTS_SESSION_LOCK will be ignored and
its _session_is_locked will not be updated.

Session will be locked but vdagent will still accept file-transfers :(

The solution for the moment is removing the handler in vdagent for
WTS_SESSION_LOCK and WTS_SESSION_UNLOCK, and receive this information
from vdservice, always. This will be v2 of my previous patch [0] plus
removing some code in vdagent.

I hope to do it now, do some testing and send it soon.

Cheers,
  toso

PS: A real solution is improving the design of windows vdagent to be
more like linux vdagent, IMHO :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161213/5427f995/attachment.sig>


More information about the Spice-devel mailing list