Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / sandbox / win / src / handle_dispatcher.cc
index 26b8fc3..6acb6f9 100644 (file)
@@ -53,10 +53,11 @@ bool HandleDispatcher::DuplicateHandleProxy(IPCInfo* ipc,
   HANDLE handle_temp;
   if (!::DuplicateHandle(ipc->client_info->process, source_handle,
                          ::GetCurrentProcess(), &handle_temp,
-                         0, FALSE, DUPLICATE_SAME_ACCESS)) {
+                         0, FALSE, DUPLICATE_SAME_ACCESS | options)) {
     ipc->return_info.win32_result = ::GetLastError();
     return false;
   }
+  options &= ~DUPLICATE_CLOSE_SOURCE;
   base::win::ScopedHandle handle(handle_temp);
 
   // Get the object type (32 characters is safe; current max is 14).
@@ -78,8 +79,7 @@ bool HandleDispatcher::DuplicateHandleProxy(IPCInfo* ipc,
   EvalResult eval = policy_base_->EvalPolicy(IPC_DUPLICATEHANDLEPROXY_TAG,
                                              params.GetBase());
   ipc->return_info.win32_result =
-      HandlePolicy::DuplicateHandleProxyAction(eval, *ipc->client_info,
-                                               source_handle,
+      HandlePolicy::DuplicateHandleProxyAction(eval, handle,
                                                target_process_id,
                                                &ipc->return_info.handle,
                                                desired_access, options);