Commit a11dbe9b authored by alexeypa@chromium.org's avatar alexeypa@chromium.org

Cleaned up usage of std::wstring in src/remoting. Added presubmit warning...

Cleaned up usage of std::wstring in src/remoting. Added presubmit warning supressions for the remaning instances because they depend on hard-to-change public APIs.

BUG=133003


Review URL: https://chromiumcodereview.appspot.com/10824166

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150224 0039d316-1c4b-4281-b951-d872f2087c98
parent cdd42346
...@@ -292,14 +292,21 @@ def _CheckNoNewWStrings(input_api, output_api): ...@@ -292,14 +292,21 @@ def _CheckNoNewWStrings(input_api, output_api):
f.LocalPath().endswith('test.cc')): f.LocalPath().endswith('test.cc')):
continue continue
allowWString = False
for line_num, line in f.ChangedContents(): for line_num, line in f.ChangedContents():
if 'wstring' in line: if 'presubmit: allow wstring' in line:
allowWString = True
elif not allowWString and 'wstring' in line:
problems.append(' %s:%d' % (f.LocalPath(), line_num)) problems.append(' %s:%d' % (f.LocalPath(), line_num))
allowWString = False
else:
allowWString = False
if not problems: if not problems:
return [] return []
return [output_api.PresubmitPromptWarning('New code should not use wstrings.' return [output_api.PresubmitPromptWarning('New code should not use wstrings.'
' If you are calling an API that accepts a wstring, fix the API.\n' + ' If you are calling a cross-platform API that accepts a wstring, '
'fix the API.\n' +
'\n'.join(problems))] '\n'.join(problems))]
......
...@@ -153,14 +153,15 @@ google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { ...@@ -153,14 +153,15 @@ google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() {
scoped_ptr<FileVersionInfo> version_info( scoped_ptr<FileVersionInfo> version_info(
FileVersionInfo::CreateFileVersionInfoForModule(binary)); FileVersionInfo::CreateFileVersionInfoForModule(binary));
std::wstring version; static wchar_t version[64];
if (version_info.get()) if (version_info.get()) {
version = UTF16ToWide(version_info->product_version()); wcscpy_s(version, UTF16ToWide(version_info->product_version()).c_str());
if (version.empty()) } else {
version = kBreakpadVersionDefault; wcscpy_s(version, kBreakpadVersionDefault);
}
static google_breakpad::CustomInfoEntry ver_entry( static google_breakpad::CustomInfoEntry ver_entry(
kBreakpadVersionEntry, version.c_str()); kBreakpadVersionEntry, version);
static google_breakpad::CustomInfoEntry prod_entry( static google_breakpad::CustomInfoEntry prod_entry(
kBreakpadProdEntry, kBreakpadProductName); kBreakpadProdEntry, kBreakpadProductName);
static google_breakpad::CustomInfoEntry plat_entry( static google_breakpad::CustomInfoEntry plat_entry(
......
...@@ -25,8 +25,7 @@ namespace { ...@@ -25,8 +25,7 @@ namespace {
class HostEventLoggerWin : public HostEventLogger, public HostStatusObserver { class HostEventLoggerWin : public HostEventLogger, public HostStatusObserver {
public: public:
HostEventLoggerWin(ChromotingHost* host, HostEventLoggerWin(ChromotingHost* host, const std::string& application_name);
const std::string& application_name);
virtual ~HostEventLoggerWin(); virtual ~HostEventLoggerWin();
...@@ -43,7 +42,7 @@ class HostEventLoggerWin : public HostEventLogger, public HostStatusObserver { ...@@ -43,7 +42,7 @@ class HostEventLoggerWin : public HostEventLogger, public HostStatusObserver {
private: private:
void LogString(WORD type, DWORD event_id, const std::string& string); void LogString(WORD type, DWORD event_id, const std::string& string);
void Log(WORD type, DWORD event_id, const std::vector<string16>& strings); void Log(WORD type, DWORD event_id, const std::vector<std::string>& strings);
scoped_refptr<ChromotingHost> host_; scoped_refptr<ChromotingHost> host_;
...@@ -60,7 +59,7 @@ HostEventLoggerWin::HostEventLoggerWin(ChromotingHost* host, ...@@ -60,7 +59,7 @@ HostEventLoggerWin::HostEventLoggerWin(ChromotingHost* host,
: host_(host), : host_(host),
event_log_(NULL) { event_log_(NULL) {
event_log_ = RegisterEventSourceW(NULL, event_log_ = RegisterEventSourceW(NULL,
ASCIIToUTF16(application_name).c_str()); UTF8ToUTF16(application_name).c_str());
if (event_log_ != NULL) { if (event_log_ != NULL) {
host_->AddStatusObserver(this); host_->AddStatusObserver(this);
} else { } else {
...@@ -92,13 +91,12 @@ void HostEventLoggerWin::OnClientRouteChange( ...@@ -92,13 +91,12 @@ void HostEventLoggerWin::OnClientRouteChange(
const std::string& jid, const std::string& jid,
const std::string& channel_name, const std::string& channel_name,
const protocol::TransportRoute& route) { const protocol::TransportRoute& route) {
std::vector<string16> strings(5); std::vector<std::string> strings(5);
strings[0] = ASCIIToUTF16(jid); strings[0] = jid;
strings[1] = ASCIIToUTF16(route.remote_address.ToString()); strings[1] = route.remote_address.ToString();
strings[2] = ASCIIToUTF16(route.local_address.ToString()); strings[2] = route.local_address.ToString();
strings[3] = ASCIIToUTF16(channel_name); strings[3] = channel_name;
strings[4] = ASCIIToUTF16( strings[4] = protocol::TransportRoute::GetTypeString(route.type);
protocol::TransportRoute::GetTypeString(route.type));
Log(EVENTLOG_INFORMATION_TYPE, MSG_HOST_CLIENT_ROUTING_CHANGED, strings); Log(EVENTLOG_INFORMATION_TYPE, MSG_HOST_CLIENT_ROUTING_CHANGED, strings);
} }
...@@ -107,15 +105,17 @@ void HostEventLoggerWin::OnShutdown() { ...@@ -107,15 +105,17 @@ void HostEventLoggerWin::OnShutdown() {
void HostEventLoggerWin::Log(WORD type, void HostEventLoggerWin::Log(WORD type,
DWORD event_id, DWORD event_id,
const std::vector<string16>& strings) { const std::vector<std::string>& strings) {
if (event_log_ == NULL) if (event_log_ == NULL)
return; return;
// ReportEventW() takes an array of raw string pointers. They should stay // ReportEventW() takes an array of raw string pointers. They should stay
// valid for the duration of the call. // valid for the duration of the call.
std::vector<const WCHAR*> raw_strings(strings.size()); std::vector<const WCHAR*> raw_strings(strings.size());
std::vector<string16> utf16_strings(strings.size());
for (size_t i = 0; i < strings.size(); ++i) { for (size_t i = 0; i < strings.size(); ++i) {
raw_strings[i] = strings[i].c_str(); utf16_strings[i] = UTF8ToUTF16(strings[i]);
raw_strings[i] = utf16_strings[i].c_str();
} }
if (!ReportEventW(event_log_, if (!ReportEventW(event_log_,
...@@ -134,8 +134,8 @@ void HostEventLoggerWin::Log(WORD type, ...@@ -134,8 +134,8 @@ void HostEventLoggerWin::Log(WORD type,
void HostEventLoggerWin::LogString(WORD type, void HostEventLoggerWin::LogString(WORD type,
DWORD event_id, DWORD event_id,
const std::string& string) { const std::string& string) {
std::vector<string16> strings; std::vector<std::string> strings;
strings.push_back(ASCIIToUTF16(string)); strings.push_back(string);
Log(type, event_id, strings); Log(type, event_id, strings);
} }
......
...@@ -285,24 +285,23 @@ void DaemonCommandLineInstallerWin::Install() { ...@@ -285,24 +285,23 @@ void DaemonCommandLineInstallerWin::Install() {
return; return;
} }
// presubmit: allow wstring
std::wstring google_update; std::wstring google_update;
result = update_key.ReadValue(kOmahaPathValueName, result = update_key.ReadValue(kOmahaPathValueName, &google_update);
&google_update);
if (result != ERROR_SUCCESS) { if (result != ERROR_SUCCESS) {
Done(HRESULT_FROM_WIN32(result)); Done(HRESULT_FROM_WIN32(result));
return; return;
} }
// Launch the updater process and wait for its termination. // Launch the updater process and wait for its termination.
std::wstring command_line = string16 command_line = WideToUTF16(
StringPrintf(kGoogleUpdateCommandLineFormat, StringPrintf(kGoogleUpdateCommandLineFormat,
google_update.c_str(), google_update.c_str(),
kHostOmahaAppid, kHostOmahaAppid,
kOmahaLanguage); kOmahaLanguage));
base::LaunchOptions options; base::LaunchOptions options;
if (!base::LaunchProcess(WideToUTF16(command_line), options, if (!base::LaunchProcess(command_line, options, process_.Receive())) {
process_.Receive())) {
result = GetLastError(); result = GetLastError();
Done(HRESULT_FROM_WIN32(result)); Done(HRESULT_FROM_WIN32(result));
return; return;
......
...@@ -114,7 +114,9 @@ class PolicyWatcherWin : ...@@ -114,7 +114,9 @@ class PolicyWatcherWin :
bool GetRegistryPolicyString(const std::string& value_name, bool GetRegistryPolicyString(const std::string& value_name,
std::string* result) const { std::string* result) const {
// presubmit: allow wstring
std::wstring value_name_wide = UTF8ToWide(value_name); std::wstring value_name_wide = UTF8ToWide(value_name);
// presubmit: allow wstring
std::wstring value; std::wstring value;
RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ);
if (policy_key.ReadValue(value_name_wide.c_str(), &value) == if (policy_key.ReadValue(value_name_wide.c_str(), &value) ==
...@@ -136,6 +138,7 @@ class PolicyWatcherWin : ...@@ -136,6 +138,7 @@ class PolicyWatcherWin :
bool GetRegistryPolicyInteger(const std::string& value_name, bool GetRegistryPolicyInteger(const std::string& value_name,
uint32* result) const { uint32* result) const {
// presubmit: allow wstring
std::wstring value_name_wide = UTF8ToWide(value_name); std::wstring value_name_wide = UTF8ToWide(value_name);
DWORD value = 0; DWORD value = 0;
RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ); RegKey policy_key(HKEY_LOCAL_MACHINE, kRegistrySubKey, KEY_READ);
......
...@@ -24,6 +24,7 @@ const wchar_t kOmahaClientStateMedium[] = L"ClientStateMedium"; ...@@ -24,6 +24,7 @@ const wchar_t kOmahaClientStateMedium[] = L"ClientStateMedium";
const wchar_t kOmahaUsagestatsValue[] = L"usagestats"; const wchar_t kOmahaUsagestatsValue[] = L"usagestats";
LONG ReadUsageStatsValue(const wchar_t* state_key, DWORD* usagestats_out) { LONG ReadUsageStatsValue(const wchar_t* state_key, DWORD* usagestats_out) {
// presubmit: allow wstring
std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat, std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat,
state_key, state_key,
remoting::kHostOmahaAppid); remoting::kHostOmahaAppid);
...@@ -71,6 +72,7 @@ bool IsUsageStatsAllowed() { ...@@ -71,6 +72,7 @@ bool IsUsageStatsAllowed() {
bool SetUsageStatsConsent(bool allowed) { bool SetUsageStatsConsent(bool allowed) {
DWORD value = allowed; DWORD value = allowed;
// presubmit: allow wstring
std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat, std::wstring client_state = StringPrintf(kOmahaClientStateKeyFormat,
kOmahaClientStateMedium, kOmahaClientStateMedium,
kHostOmahaAppid); kHostOmahaAppid);
......
...@@ -91,7 +91,6 @@ namespace remoting { ...@@ -91,7 +91,6 @@ namespace remoting {
HostService::HostService() : HostService::HostService() :
console_session_id_(kInvalidSessionId), console_session_id_(kInvalidSessionId),
run_routine_(&HostService::RunAsService), run_routine_(&HostService::RunAsService),
service_name_(kWindowsServiceName),
service_status_handle_(0), service_status_handle_(0),
stopped_event_(true, false) { stopped_event_(true, false) {
} }
...@@ -228,7 +227,7 @@ void HostService::RunMessageLoop(MessageLoop* message_loop) { ...@@ -228,7 +227,7 @@ void HostService::RunMessageLoop(MessageLoop* message_loop) {
int HostService::RunAsService() { int HostService::RunAsService() {
SERVICE_TABLE_ENTRYW dispatch_table[] = { SERVICE_TABLE_ENTRYW dispatch_table[] = {
{ const_cast<LPWSTR>(service_name_.c_str()), &HostService::ServiceMain }, { const_cast<LPWSTR>(kWindowsServiceName), &HostService::ServiceMain },
{ NULL, NULL } { NULL, NULL }
}; };
...@@ -348,7 +347,7 @@ VOID WINAPI HostService::ServiceMain(DWORD argc, WCHAR* argv[]) { ...@@ -348,7 +347,7 @@ VOID WINAPI HostService::ServiceMain(DWORD argc, WCHAR* argv[]) {
// Register the service control handler. // Register the service control handler.
self->service_status_handle_ = self->service_status_handle_ =
RegisterServiceCtrlHandlerExW(self->service_name_.c_str(), RegisterServiceCtrlHandlerExW(kWindowsServiceName,
&HostService::ServiceControlHandler, &HostService::ServiceControlHandler,
self); self);
if (self->service_status_handle_ == 0) { if (self->service_status_handle_ == 0) {
......
...@@ -100,9 +100,6 @@ class HostService : public WtsConsoleMonitor { ...@@ -100,9 +100,6 @@ class HostService : public WtsConsoleMonitor {
// The action routine to be executed. // The action routine to be executed.
int (HostService::*run_routine_)(); int (HostService::*run_routine_)();
// The service name.
std::wstring service_name_;
// The service status handle. // The service status handle.
SERVICE_STATUS_HANDLE service_status_handle_; SERVICE_STATUS_HANDLE service_status_handle_;
......
...@@ -20,8 +20,8 @@ using base::win::ScopedHandle; ...@@ -20,8 +20,8 @@ using base::win::ScopedHandle;
namespace { namespace {
const wchar_t kCreateProcessDefaultPipeNameFormat[] = const char kCreateProcessDefaultPipeNameFormat[] =
L"\\\\.\\Pipe\\TerminalServer\\SystemExecSrvr\\%d"; "\\\\.\\Pipe\\TerminalServer\\SystemExecSrvr\\%d";
// Undocumented WINSTATIONINFOCLASS value causing // Undocumented WINSTATIONINFOCLASS value causing
// winsta!WinStationQueryInformationW() to return the name of the pipe for // winsta!WinStationQueryInformationW() to return the name of the pipe for
...@@ -38,20 +38,20 @@ const int kMaxLaunchDelaySeconds = 60; ...@@ -38,20 +38,20 @@ const int kMaxLaunchDelaySeconds = 60;
const int kMinLaunchDelaySeconds = 1; const int kMinLaunchDelaySeconds = 1;
// Name of the default session desktop. // Name of the default session desktop.
wchar_t kDefaultDesktopName[] = L"winsta0\\default"; const char kDefaultDesktopName[] = "winsta0\\default";
// Requests the execution server to create a process in the specified session // Requests the execution server to create a process in the specified session
// using the default (i.e. Winlogon) token. This routine relies on undocumented // using the default (i.e. Winlogon) token. This routine relies on undocumented
// OS functionality and will likely not work on anything but XP or W2K3. // OS functionality and will likely not work on anything but XP or W2K3.
bool CreateRemoteSessionProcess( bool CreateRemoteSessionProcess(
uint32 session_id, uint32 session_id,
const std::wstring& application_name, const FilePath::StringType& application_name,
const std::wstring& command_line, const CommandLine::StringType& command_line,
PROCESS_INFORMATION* process_information_out) PROCESS_INFORMATION* process_information_out)
{ {
DCHECK(base::win::GetVersion() == base::win::VERSION_XP); DCHECK(base::win::GetVersion() == base::win::VERSION_XP);
std::wstring pipe_name; string16 pipe_name;
// Use winsta!WinStationQueryInformationW() to determine the process creation // Use winsta!WinStationQueryInformationW() to determine the process creation
// pipe name for the session. // pipe name for the session.
...@@ -77,7 +77,8 @@ bool CreateRemoteSessionProcess( ...@@ -77,7 +77,8 @@ bool CreateRemoteSessionProcess(
// Use the default pipe name if we couldn't query its name. // Use the default pipe name if we couldn't query its name.
if (pipe_name.empty()) { if (pipe_name.empty()) {
pipe_name = StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id); pipe_name = UTF8ToUTF16(
StringPrintf(kCreateProcessDefaultPipeNameFormat, session_id));
} }
// Try to connect to the named pipe. // Try to connect to the named pipe.
...@@ -111,7 +112,7 @@ bool CreateRemoteSessionProcess( ...@@ -111,7 +112,7 @@ bool CreateRemoteSessionProcess(
return false; return false;
} }
std::wstring desktop_name(kDefaultDesktopName); string16 desktop_name(UTF8ToUTF16(kDefaultDesktopName));
// |CreateProcessRequest| structure passes the same parameters to // |CreateProcessRequest| structure passes the same parameters to
// the execution server as CreateProcessAsUser() function does. Strings are // the execution server as CreateProcessAsUser() function does. Strings are
...@@ -244,17 +245,19 @@ bool CreateRemoteSessionProcess( ...@@ -244,17 +245,19 @@ bool CreateRemoteSessionProcess(
namespace remoting { namespace remoting {
bool LaunchProcessWithToken(const FilePath& binary, bool LaunchProcessWithToken(const FilePath& binary,
const std::wstring& command_line, const CommandLine::StringType& command_line,
HANDLE user_token, HANDLE user_token,
base::Process* process_out) { base::Process* process_out) {
std::wstring application_name = binary.value(); FilePath::StringType application_name = binary.value();
base::win::ScopedProcessInformation process_info; base::win::ScopedProcessInformation process_info;
STARTUPINFOW startup_info; STARTUPINFOW startup_info;
string16 desktop_name(UTF8ToUTF16(kDefaultDesktopName));
memset(&startup_info, 0, sizeof(startup_info)); memset(&startup_info, 0, sizeof(startup_info));
startup_info.cb = sizeof(startup_info); startup_info.cb = sizeof(startup_info);
startup_info.lpDesktop = kDefaultDesktopName; startup_info.lpDesktop = const_cast<char16*>(desktop_name.c_str());
BOOL result = CreateProcessAsUser(user_token, BOOL result = CreateProcessAsUser(user_token,
application_name.c_str(), application_name.c_str(),
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <windows.h> #include <windows.h>
#include <string> #include <string>
#include "base/command_line.h"
#include "base/file_path.h" #include "base/file_path.h"
#include "base/process_util.h" #include "base/process_util.h"
...@@ -16,7 +17,7 @@ namespace remoting { ...@@ -16,7 +17,7 @@ namespace remoting {
// Launches |binary| in the security context of the user represented by // Launches |binary| in the security context of the user represented by
// |user_token|. The session ID specified by the token is respected as well. // |user_token|. The session ID specified by the token is respected as well.
bool LaunchProcessWithToken(const FilePath& binary, bool LaunchProcessWithToken(const FilePath& binary,
const std::wstring& command_line, const CommandLine::StringType& command_line,
HANDLE user_token, HANDLE user_token,
base::Process* process_out); base::Process* process_out);
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include "base/process_util.h" #include "base/process_util.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/stringprintf.h" #include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "base/win/scoped_handle.h" #include "base/win/scoped_handle.h"
#include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_message.h" #include "ipc/ipc_message.h"
...@@ -47,7 +48,7 @@ const FilePath::CharType kMe2meHostBinaryName[] = ...@@ -47,7 +48,7 @@ const FilePath::CharType kMe2meHostBinaryName[] =
FILE_PATH_LITERAL("remoting_me2me_host.exe"); FILE_PATH_LITERAL("remoting_me2me_host.exe");
// Match the pipe name prefix used by Chrome IPC channels. // Match the pipe name prefix used by Chrome IPC channels.
const wchar_t kChromePipeNamePrefix[] = L"\\\\.\\pipe\\chrome."; const char kChromePipeNamePrefix[] = "\\\\.\\pipe\\chrome.";
// The IPC channel name is passed to the host in the command line. // The IPC channel name is passed to the host in the command line.
const char kChromotingIpcSwitchName[] = "chromoting-ipc"; const char kChromotingIpcSwitchName[] = "chromoting-ipc";
...@@ -150,8 +151,8 @@ bool CreateSessionToken(uint32 session_id, ...@@ -150,8 +151,8 @@ bool CreateSessionToken(uint32 session_id,
// Generates random channel ID. // Generates random channel ID.
// N.B. Stolen from src/content/common/child_process_host_impl.cc // N.B. Stolen from src/content/common/child_process_host_impl.cc
std::wstring GenerateRandomChannelId(void* instance) { std::string GenerateRandomChannelId(void* instance) {
return base::StringPrintf(L"%d.%p.%d", return base::StringPrintf("%d.%p.%d",
base::GetCurrentProcId(), instance, base::GetCurrentProcId(), instance,
base::RandInt(0, std::numeric_limits<int>::max())); base::RandInt(0, std::numeric_limits<int>::max()));
} }
...@@ -159,7 +160,7 @@ std::wstring GenerateRandomChannelId(void* instance) { ...@@ -159,7 +160,7 @@ std::wstring GenerateRandomChannelId(void* instance) {
// Creates the server end of the Chromoting IPC channel. // Creates the server end of the Chromoting IPC channel.
// N.B. This code is based on IPC::Channel's implementation. // N.B. This code is based on IPC::Channel's implementation.
bool CreatePipeForIpcChannel(void* instance, bool CreatePipeForIpcChannel(void* instance,
std::wstring* channel_name_out, std::string* channel_name_out,
ScopedHandle* pipe_out) { ScopedHandle* pipe_out) {
// Create security descriptor for the channel. // Create security descriptor for the channel.
SECURITY_ATTRIBUTES security_attributes; SECURITY_ATTRIBUTES security_attributes;
...@@ -179,15 +180,15 @@ bool CreatePipeForIpcChannel(void* instance, ...@@ -179,15 +180,15 @@ bool CreatePipeForIpcChannel(void* instance,
} }
// Generate a random channel name. // Generate a random channel name.
std::wstring channel_name(GenerateRandomChannelId(instance)); std::string channel_name(GenerateRandomChannelId(instance));
// Convert it to the pipe name. // Convert it to the pipe name.
std::wstring pipe_name(kChromePipeNamePrefix); std::string pipe_name(kChromePipeNamePrefix);
pipe_name.append(channel_name); pipe_name.append(channel_name);
// Create the server end of the pipe. This code should match the code in // Create the server end of the pipe. This code should match the code in
// IPC::Channel with exception of passing a non-default security descriptor. // IPC::Channel with exception of passing a non-default security descriptor.
HANDLE pipe = CreateNamedPipeW(pipe_name.c_str(), HANDLE pipe = CreateNamedPipeW(UTF8ToUTF16(pipe_name).c_str(),
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED |
FILE_FLAG_FIRST_PIPE_INSTANCE, FILE_FLAG_FIRST_PIPE_INSTANCE,
PIPE_TYPE_BYTE | PIPE_READMODE_BYTE, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE,
...@@ -259,7 +260,7 @@ void WtsSessionProcessLauncher::LaunchProcess() { ...@@ -259,7 +260,7 @@ void WtsSessionProcessLauncher::LaunchProcess() {
} }
FilePath host_binary = dir_path.Append(kMe2meHostBinaryName); FilePath host_binary = dir_path.Append(kMe2meHostBinaryName);
std::wstring channel_name; std::string channel_name;
ScopedHandle pipe; ScopedHandle pipe;
if (CreatePipeForIpcChannel(this, &channel_name, &pipe)) { if (CreatePipeForIpcChannel(this, &channel_name, &pipe)) {
// Wrap the pipe into an IPC channel. // Wrap the pipe into an IPC channel.
...@@ -272,7 +273,7 @@ void WtsSessionProcessLauncher::LaunchProcess() { ...@@ -272,7 +273,7 @@ void WtsSessionProcessLauncher::LaunchProcess() {
// Create the host process command line passing the name of the IPC channel // Create the host process command line passing the name of the IPC channel
// to use and copying known switches from the service's command line. // to use and copying known switches from the service's command line.
CommandLine command_line(host_binary); CommandLine command_line(host_binary);
command_line.AppendSwitchNative(kChromotingIpcSwitchName, channel_name); command_line.AppendSwitchASCII(kChromotingIpcSwitchName, channel_name);
command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(), command_line.CopySwitchesFrom(*CommandLine::ForCurrentProcess(),
kCopiedSwitchNames, kCopiedSwitchNames,
_countof(kCopiedSwitchNames)); _countof(kCopiedSwitchNames));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment