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

Side by Side Diff: remoting/host/daemon_process_win.cc

Issue 281223002: Removed LOG_GETLASTERROR and LOG_ERRNO macros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wed 05/14/2014 11:20:03.21 Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/curtain_mode_win.cc ('k') | remoting/host/desktop_session_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/daemon_process.h" 5 #include "remoting/host/daemon_process.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 IPC::PlatformFileForTransit desktop_pipe) { 160 IPC::PlatformFileForTransit desktop_pipe) {
161 // Prepare |desktop_process| handle for sending over to the network process. 161 // Prepare |desktop_process| handle for sending over to the network process.
162 base::ProcessHandle desktop_process_for_transit; 162 base::ProcessHandle desktop_process_for_transit;
163 if (!DuplicateHandle(GetCurrentProcess(), 163 if (!DuplicateHandle(GetCurrentProcess(),
164 desktop_process, 164 desktop_process,
165 network_process_, 165 network_process_,
166 &desktop_process_for_transit, 166 &desktop_process_for_transit,
167 0, 167 0,
168 FALSE, 168 FALSE,
169 DUPLICATE_SAME_ACCESS)) { 169 DUPLICATE_SAME_ACCESS)) {
170 LOG_GETLASTERROR(ERROR) << "Failed to duplicate the desktop process handle"; 170 PLOG(ERROR) << "Failed to duplicate the desktop process handle";
171 return false; 171 return false;
172 } 172 }
173 173
174 // |desktop_pipe| is a handle in the desktop process. It will be duplicated 174 // |desktop_pipe| is a handle in the desktop process. It will be duplicated
175 // by the network process directly from the desktop process. 175 // by the network process directly from the desktop process.
176 SendToNetwork(new ChromotingDaemonNetworkMsg_DesktopAttached( 176 SendToNetwork(new ChromotingDaemonNetworkMsg_DesktopAttached(
177 terminal_id, desktop_process_for_transit, desktop_pipe)); 177 terminal_id, desktop_process_for_transit, desktop_pipe));
178 return true; 178 return true;
179 } 179 }
180 180
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 stopped_callback)); 231 stopped_callback));
232 daemon_process->Initialize(); 232 daemon_process->Initialize();
233 return daemon_process.PassAs<DaemonProcess>(); 233 return daemon_process.PassAs<DaemonProcess>();
234 } 234 }
235 235
236 void DaemonProcessWin::DisableAutoStart() { 236 void DaemonProcessWin::DisableAutoStart() {
237 ScopedScHandle scmanager( 237 ScopedScHandle scmanager(
238 OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE, 238 OpenSCManager(NULL, SERVICES_ACTIVE_DATABASE,
239 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE)); 239 SC_MANAGER_CONNECT | SC_MANAGER_ENUMERATE_SERVICE));
240 if (!scmanager.IsValid()) { 240 if (!scmanager.IsValid()) {
241 LOG_GETLASTERROR(INFO) 241 PLOG(INFO) << "Failed to connect to the service control manager";
242 << "Failed to connect to the service control manager";
243 return; 242 return;
244 } 243 }
245 244
246 DWORD desired_access = SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS; 245 DWORD desired_access = SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS;
247 ScopedScHandle service( 246 ScopedScHandle service(
248 OpenService(scmanager, kWindowsServiceName, desired_access)); 247 OpenService(scmanager, kWindowsServiceName, desired_access));
249 if (!service.IsValid()) { 248 if (!service.IsValid()) {
250 LOG_GETLASTERROR(INFO) 249 PLOG(INFO) << "Failed to open to the '" << kWindowsServiceName
251 << "Failed to open to the '" << kWindowsServiceName << "' service"; 250 << "' service";
252 return; 251 return;
253 } 252 }
254 253
255 // Change the service start type to 'manual'. All |NULL| parameters below mean 254 // Change the service start type to 'manual'. All |NULL| parameters below mean
256 // that there is no change to the corresponding service parameter. 255 // that there is no change to the corresponding service parameter.
257 if (!ChangeServiceConfig(service, 256 if (!ChangeServiceConfig(service,
258 SERVICE_NO_CHANGE, 257 SERVICE_NO_CHANGE,
259 SERVICE_DEMAND_START, 258 SERVICE_DEMAND_START,
260 SERVICE_NO_CHANGE, 259 SERVICE_NO_CHANGE,
261 NULL, 260 NULL,
262 NULL, 261 NULL,
263 NULL, 262 NULL,
264 NULL, 263 NULL,
265 NULL, 264 NULL,
266 NULL, 265 NULL,
267 NULL)) { 266 NULL)) {
268 LOG_GETLASTERROR(INFO) 267 PLOG(INFO) << "Failed to change the '" << kWindowsServiceName
269 << "Failed to change the '" << kWindowsServiceName 268 << "'service start type to 'manual'";
270 << "'service start type to 'manual'";
271 } 269 }
272 } 270 }
273 271
274 bool DaemonProcessWin::InitializePairingRegistry() { 272 bool DaemonProcessWin::InitializePairingRegistry() {
275 if (!pairing_registry_privileged_key_.Valid()) { 273 if (!pairing_registry_privileged_key_.Valid()) {
276 if (!OpenPairingRegistry()) 274 if (!OpenPairingRegistry())
277 return false; 275 return false;
278 } 276 }
279 277
280 // Duplicate handles to the network process. 278 // Duplicate handles to the network process.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 << "\\" << kPairingRegistrySecretsKeyName; 324 << "\\" << kPairingRegistrySecretsKeyName;
327 return false; 325 return false;
328 } 326 }
329 327
330 pairing_registry_privileged_key_.Set(privileged.Take()); 328 pairing_registry_privileged_key_.Set(privileged.Take());
331 pairing_registry_unprivileged_key_.Set(unprivileged.Take()); 329 pairing_registry_unprivileged_key_.Set(unprivileged.Take());
332 return true; 330 return true;
333 } 331 }
334 332
335 } // namespace remoting 333 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/curtain_mode_win.cc ('k') | remoting/host/desktop_session_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698