diff options
author | Arnon Gilboa <agilboa@redhat.com> | 2012-11-25 17:11:39 +0200 |
---|---|---|
committer | Arnon Gilboa <agilboa@redhat.com> | 2012-11-25 17:11:39 +0200 |
commit | c18859ff35c439985a6134c71e35861dd71b186e (patch) | |
tree | dc4367a2161b728c59903287ff5e5cf7cbf48a63 /vdservice | |
parent | e5c363b8417d2063393a5e6e58cf413ac5e1aabb (diff) |
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
Diffstat (limited to 'vdservice')
-rw-r--r-- | 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); } |