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

Unified Diff: remoting/host/elevated_controller_win.cc

Issue 10073028: Avoiding unnecessary conversion to UTF16 in runtime. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/branding.cc ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/elevated_controller_win.cc
diff --git a/remoting/host/elevated_controller_win.cc b/remoting/host/elevated_controller_win.cc
index 86c0aa4d310072628583e3493a83ac9327078269..160ddaa1b8739a8736efb4b74bb396cc4e14d60b 100644
--- a/remoting/host/elevated_controller_win.cc
+++ b/remoting/host/elevated_controller_win.cc
@@ -12,6 +12,7 @@
#include "base/json/json_writer.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/stringize_macros.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/win/scoped_handle.h"
@@ -27,8 +28,8 @@ const FilePath::CharType kTempFileExtension[] = FILE_PATH_LITERAL("json~");
// The host configuration file security descriptor that enables full access to
// Local System and built-in administrators only.
-const char kConfigFileSecurityDescriptor[] =
- "O:BA" "G:BA" "D:(A;;GA;;;SY)(A;;GA;;;BA)";
+const char16 kConfigFileSecurityDescriptor[] =
+ TO_L_STRING("O:BAG:BAD:(A;;GA;;;SY)(A;;GA;;;BA)");
// The maximum size of the configuration file. "1MB ought to be enough" for any
// reasonable configuration we will ever need. 1MB is low enough to make
@@ -102,7 +103,7 @@ HRESULT WriteConfig(const FilePath& filename,
security_attributes.bInheritHandle = FALSE;
ULONG security_descriptor_length = 0;
- if (!ConvertStringSecurityDescriptorToSecurityDescriptorA(
+ if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(
kConfigFileSecurityDescriptor,
SDDL_REVISION_1,
reinterpret_cast<PSECURITY_DESCRIPTOR*>(
@@ -322,8 +323,7 @@ HRESULT ElevatedControllerWin::OpenService(ScopedScHandle* service_out) {
DWORD desired_access = SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS |
SERVICE_START | SERVICE_STOP;
ScopedScHandle service(
- ::OpenServiceW(scmanager, UTF8ToUTF16(kWindowsServiceName).c_str(),
- desired_access));
+ ::OpenServiceW(scmanager, kWindowsServiceName, desired_access));
if (!service.IsValid()) {
error = GetLastError();
LOG_GETLASTERROR(ERROR)
« no previous file with comments | « remoting/host/branding.cc ('k') | remoting/host/host_service_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698