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

Side by Side Diff: cloud_print/virtual_driver/win/install/setup.cc

Issue 71013004: Base: Remove Receive() from ScopedHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScopedProcessInfo Created 7 years, 1 month 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
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 <comdef.h> 5 #include <comdef.h>
6 #include <iomanip> 6 #include <iomanip>
7 #include <windows.h> 7 #include <windows.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 #include <setupapi.h> // Must be included after windows.h 9 #include <setupapi.h> // Must be included after windows.h
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 command_line.AppendArg("/u"); 133 command_line.AppendArg("/u");
134 } 134 }
135 135
136 // Use system32 path here because otherwise ::AddMonitor would fail. 136 // Use system32 path here because otherwise ::AddMonitor would fail.
137 command_line.AppendArgPath(GetSystemPath(GetPortMonitorDllName())); 137 command_line.AppendArgPath(GetSystemPath(GetPortMonitorDllName()));
138 138
139 base::LaunchOptions options; 139 base::LaunchOptions options;
140 options.wait = true; 140 options.wait = true;
141 141
142 base::win::ScopedHandle regsvr32_handle; 142 base::win::ScopedHandle regsvr32_handle;
143 if (!base::LaunchProcess(command_line, options, regsvr32_handle.Receive())) { 143 if (!base::LaunchProcess(command_line.GetCommandLineString(), options,
144 &regsvr32_handle)) {
144 LOG(ERROR) << "Unable to launch regsvr32.exe."; 145 LOG(ERROR) << "Unable to launch regsvr32.exe.";
145 return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); 146 return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
146 } 147 }
147 148
148 DWORD exit_code = S_OK; 149 DWORD exit_code = S_OK;
149 if (install) { 150 if (install) {
150 if (!GetExitCodeProcess(regsvr32_handle, &exit_code)) { 151 if (!GetExitCodeProcess(regsvr32_handle, &exit_code)) {
151 LOG(ERROR) << "Unable to get regsvr32.exe exit code."; 152 LOG(ERROR) << "Unable to get regsvr32.exe exit code.";
152 return GetLastHResult(); 153 return GetLastHResult();
153 } 154 }
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 LOG(INFO) << _com_error(retval).ErrorMessage() << " HRESULT=0x" << 544 LOG(INFO) << _com_error(retval).ErrorMessage() << " HRESULT=0x" <<
544 std::setbase(16) << retval; 545 std::setbase(16) << retval;
545 546
546 // Installer is silent by default as required by Google Update. 547 // Installer is silent by default as required by Google Update.
547 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { 548 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) {
548 cloud_print::DisplayWindowsMessage(NULL, retval, 549 cloud_print::DisplayWindowsMessage(NULL, retval,
549 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); 550 cloud_print::LoadLocalString(IDS_DRIVER_NAME));
550 } 551 }
551 return retval; 552 return retval;
552 } 553 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698