[Spice-devel] [PATCH] vdservice: set process handle for vdagent launched on session>0

Uri Lublin uril at redhat.com
Sun Dec 9 00:49:24 PST 2012


On 11/25/2012 05:14 PM, Arnon Gilboa wrote:
> The problem on XP was failing to terminate agent running on session>0,
> since during agent process creation, a handle was not set, so it was NULL.
> Therefore, the new agent created (at the session we switched to) was unable
> to open vitio-serial which was still used by the other running agent instance.
>
> rhbz#868254
> ---
>   vdservice/vdservice.cpp |    7 +++++++
>   1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
> index b2448e7..a2cf67d 100644
> --- a/vdservice/vdservice.cpp
> +++ b/vdservice/vdservice.cpp
> @@ -640,6 +640,13 @@ BOOL create_session_process_as_user(IN DWORD session_id, IN BOOL use_default_tok
>           ret = proc_ret.ret_value;
>           if (ret) {
>               *process_information = proc_ret.process_information;
> +            if (process_information->hProcess == 0) {
> +                process_information->hProcess = OpenProcess(SYNCHRONIZE | PROCESS_TERMINATE, FALSE,
> +                                                            process_information->dwProcessId);
> +                if (!process_information->hProcess) {
> +                    vd_printf("OpenProcess() failed %lu", GetLastError());
> +                }
> +            }
>           } else {
>               SetLastError(proc_ret.last_error);
>           }

Ack.


More information about the Spice-devel mailing list