OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/host/win/launch_process_with_token.h" | 5 #include "remoting/host/win/launch_process_with_token.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <winternl.h> | 9 #include <winternl.h> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 } | 54 } |
55 | 55 |
56 // Connects to the executor server corresponding to |session_id|. | 56 // Connects to the executor server corresponding to |session_id|. |
57 bool ConnectToExecutionServer(uint32_t session_id, | 57 bool ConnectToExecutionServer(uint32_t session_id, |
58 base::win::ScopedHandle* pipe_out) { | 58 base::win::ScopedHandle* pipe_out) { |
59 base::string16 pipe_name; | 59 base::string16 pipe_name; |
60 | 60 |
61 // Use winsta!WinStationQueryInformationW() to determine the process creation | 61 // Use winsta!WinStationQueryInformationW() to determine the process creation |
62 // pipe name for the session. | 62 // pipe name for the session. |
63 base::FilePath winsta_path( | 63 base::FilePath winsta_path( |
64 base::GetNativeLibraryName(base::UTF8ToUTF16("winsta"))); | 64 base::ASCIIToUTF16(base::GetNativeLibraryName("winsta"))); |
65 base::ScopedNativeLibrary winsta(winsta_path); | 65 base::ScopedNativeLibrary winsta(winsta_path); |
66 if (winsta.is_valid()) { | 66 if (winsta.is_valid()) { |
67 PWINSTATIONQUERYINFORMATIONW win_station_query_information = | 67 PWINSTATIONQUERYINFORMATIONW win_station_query_information = |
68 reinterpret_cast<PWINSTATIONQUERYINFORMATIONW>( | 68 reinterpret_cast<PWINSTATIONQUERYINFORMATIONW>( |
69 winsta.GetFunctionPointer("WinStationQueryInformationW")); | 69 winsta.GetFunctionPointer("WinStationQueryInformationW")); |
70 if (win_station_query_information) { | 70 if (win_station_query_information) { |
71 wchar_t name[MAX_PATH]; | 71 wchar_t name[MAX_PATH]; |
72 ULONG name_length; | 72 ULONG name_length; |
73 if (win_station_query_information(0, | 73 if (win_station_query_information(0, |
74 session_id, | 74 session_id, |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 | 517 |
518 base::win::ScopedProcessInformation process_info(temp_process_info); | 518 base::win::ScopedProcessInformation process_info(temp_process_info); |
519 | 519 |
520 CHECK(process_info.IsValid()); | 520 CHECK(process_info.IsValid()); |
521 process_out->Set(process_info.TakeProcessHandle()); | 521 process_out->Set(process_info.TakeProcessHandle()); |
522 thread_out->Set(process_info.TakeThreadHandle()); | 522 thread_out->Set(process_info.TakeThreadHandle()); |
523 return true; | 523 return true; |
524 } | 524 } |
525 | 525 |
526 } // namespace remoting | 526 } // namespace remoting |
OLD | NEW |