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).
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);