Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(296)

Side by Side Diff: remoting/host/win/launch_process_with_token.cc

Issue 2048523002: Fix base::GetNativeLibraryName() for Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@native_lib_clean
Patch Set: Remove string16 version of GetNativeLibraryName Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698