From c18859ff35c439985a6134c71e35861dd71b186e Mon Sep 17 00:00:00 2001 From: Arnon Gilboa Date: Sun, 25 Nov 2012 17:11:39 +0200 Subject: vdservice: set process handle for vdagent launched on session>0 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 file changed, 7 insertions(+) (limited to 'vdservice') 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); } -- cgit v1.2.3