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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
         }
-- 
1.7.4.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]