Index: remoting/host/ipc_desktop_environment_unittest.cc |
diff --git a/remoting/host/ipc_desktop_environment_unittest.cc b/remoting/host/ipc_desktop_environment_unittest.cc |
index 9174f67e70e0d993daef44d82771f735f129d40a..515f6263838fe3909bbf3be4811381c4d08f9371 100644 |
--- a/remoting/host/ipc_desktop_environment_unittest.cc |
+++ b/remoting/host/ipc_desktop_environment_unittest.cc |
@@ -421,9 +421,16 @@ void IpcDesktopEnvironmentTest::OnDisconnectCallback() { |
void IpcDesktopEnvironmentTest::OnDesktopAttached( |
IPC::PlatformFileForTransit desktop_pipe) { |
+ base::ProcessHandle process_handle = base::GetCurrentProcessHandle(); |
+#if defined(OS_WIN) |
+ ASSERT_NE(FALSE, ::DuplicateHandle(GetCurrentProcess(), process_handle, |
+ GetCurrentProcess(), &process_handle, |
+ 0, FALSE, DUPLICATE_SAME_ACCESS)); |
+#endif |
+ |
// Instruct DesktopSessionProxy to connect to the network-to-desktop pipe. |
desktop_environment_factory_->OnDesktopSessionAgentAttached( |
- terminal_id_, base::GetCurrentProcessHandle(), desktop_pipe); |
+ terminal_id_, process_handle, desktop_pipe); |
} |
// Runs until the desktop is attached and exits immediately after that. |