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

Unified Diff: remoting/host/win/elevated_controller.cc

Issue 602763003: Remove implicit HANDLE conversions from remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/win/chromoting_module.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/win/elevated_controller.cc
diff --git a/remoting/host/win/elevated_controller.cc b/remoting/host/win/elevated_controller.cc
index fc5aebe8da24e692fed790f00e59ad0ea8aded90..07b620e1160c57c63a8e6180297ee9028fc43626 100644
--- a/remoting/host/win/elevated_controller.cc
+++ b/remoting/host/win/elevated_controller.cc
@@ -114,7 +114,7 @@ HRESULT ReadConfig(const base::FilePath& filename,
scoped_ptr<char[]> buffer(new char[kMaxConfigFileSize]);
DWORD size = kMaxConfigFileSize;
- if (!::ReadFile(file, &buffer[0], size, &size, NULL)) {
+ if (!::ReadFile(file.Get(), &buffer[0], size, &size, NULL)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to read '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
@@ -177,7 +177,8 @@ HRESULT WriteConfigFileToTemp(const base::FilePath& filename,
}
DWORD written;
- if (!WriteFile(file, content, static_cast<DWORD>(length), &written, NULL)) {
+ if (!WriteFile(file.Get(), content, static_cast<DWORD>(length), &written,
+ NULL)) {
DWORD error = GetLastError();
PLOG(ERROR) << "Failed to write to '" << filename.value() << "'";
return HRESULT_FROM_WIN32(error);
@@ -372,7 +373,7 @@ STDMETHODIMP ElevatedController::StartDaemon() {
}
// Change the service start type to 'auto'.
- if (!::ChangeServiceConfigW(service,
+ if (!::ChangeServiceConfigW(service.Get(),
SERVICE_NO_CHANGE,
SERVICE_AUTO_START,
SERVICE_NO_CHANGE,
@@ -390,7 +391,7 @@ STDMETHODIMP ElevatedController::StartDaemon() {
}
// Start the service.
- if (!StartService(service, 0, NULL)) {
+ if (!StartService(service.Get(), 0, NULL)) {
DWORD error = GetLastError();
if (error != ERROR_SERVICE_ALREADY_RUNNING) {
PLOG(ERROR) << "Failed to start the '" << kWindowsServiceName
@@ -411,7 +412,7 @@ STDMETHODIMP ElevatedController::StopDaemon() {
}
// Change the service start type to 'manual'.
- if (!::ChangeServiceConfigW(service,
+ if (!::ChangeServiceConfigW(service.Get(),
SERVICE_NO_CHANGE,
SERVICE_DEMAND_START,
SERVICE_NO_CHANGE,
@@ -430,7 +431,7 @@ STDMETHODIMP ElevatedController::StopDaemon() {
// Stop the service.
SERVICE_STATUS status;
- if (!ControlService(service, SERVICE_CONTROL_STOP, &status)) {
+ if (!ControlService(service.Get(), SERVICE_CONTROL_STOP, &status)) {
DWORD error = GetLastError();
if (error != ERROR_SERVICE_NOT_ACTIVE) {
PLOG(ERROR) << "Failed to stop the '" << kWindowsServiceName
@@ -513,7 +514,7 @@ HRESULT ElevatedController::OpenService(ScopedScHandle* service_out) {
DWORD desired_access = SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS |
SERVICE_START | SERVICE_STOP;
ScopedScHandle service(
- ::OpenServiceW(scmanager, kWindowsServiceName, desired_access));
+ ::OpenServiceW(scmanager.Get(), kWindowsServiceName, desired_access));
if (!service.IsValid()) {
error = GetLastError();
PLOG(ERROR) << "Failed to open to the '" << kWindowsServiceName
« no previous file with comments | « remoting/host/win/chromoting_module.cc ('k') | remoting/host/win/launch_process_with_token.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698