| OLD | NEW |
| 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/sas_injector.h" | 5 #include "remoting/host/sas_injector.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/native_library.h" | 12 #include "base/native_library.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/stringize_macros.h" | |
| 15 #include "base/win/registry.h" | 14 #include "base/win/registry.h" |
| 16 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
| 17 | 16 |
| 18 namespace remoting { | 17 namespace remoting { |
| 19 | 18 |
| 20 namespace { | 19 namespace { |
| 21 | 20 |
| 22 // Names of the API and library implementing software SAS generation. | 21 // Names of the API and library implementing software SAS generation. |
| 23 const FilePath::CharType kSasDllFileName[] = | 22 const FilePath::CharType kSasDllFileName[] = |
| 24 FILE_PATH_LITERAL("sas.dll"); | 23 FILE_PATH_LITERAL("sas.dll"); |
| 25 const char kSendSasName[] = "SendSAS"; | 24 const char kSendSasName[] = "SendSAS"; |
| 26 | 25 |
| 27 // The prototype of SendSAS(). | 26 // The prototype of SendSAS(). |
| 28 typedef VOID (WINAPI *SendSasFunc)(BOOL); | 27 typedef VOID (WINAPI *SendSasFunc)(BOOL); |
| 29 | 28 |
| 30 // The registry key and value holding the policy controlling software SAS | 29 // The registry key and value holding the policy controlling software SAS |
| 31 // generation. | 30 // generation. |
| 32 const char16 kSystemPolicyKeyName[] = | 31 const wchar_t kSystemPolicyKeyName[] = |
| 33 TO_L_STRING("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\") | 32 L"Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; |
| 34 TO_L_STRING("System"); | 33 const wchar_t kSoftwareSasValueName[] = L"SoftwareSASGeneration"; |
| 35 const char16 kSoftwareSasValueName[] = TO_L_STRING("SoftwareSASGeneration"); | |
| 36 | 34 |
| 37 const DWORD kEnableSoftwareSasByServices = 1; | 35 const DWORD kEnableSoftwareSasByServices = 1; |
| 38 | 36 |
| 39 // Toggles the default software SAS generation policy to enable SAS generation | 37 // Toggles the default software SAS generation policy to enable SAS generation |
| 40 // by services. Non-default policy is not changed. | 38 // by services. Non-default policy is not changed. |
| 41 class ScopedSoftwareSasPolicy { | 39 class ScopedSoftwareSasPolicy { |
| 42 public: | 40 public: |
| 43 ScopedSoftwareSasPolicy(); | 41 ScopedSoftwareSasPolicy(); |
| 44 ~ScopedSoftwareSasPolicy(); | 42 ~ScopedSoftwareSasPolicy(); |
| 45 | 43 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 172 |
| 175 scoped_ptr<SasInjector> SasInjector::Create() { | 173 scoped_ptr<SasInjector> SasInjector::Create() { |
| 176 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { | 174 if (base::win::GetVersion() >= base::win::VERSION_VISTA) { |
| 177 return scoped_ptr<SasInjector>(new SasInjectorWin()); | 175 return scoped_ptr<SasInjector>(new SasInjectorWin()); |
| 178 } | 176 } |
| 179 | 177 |
| 180 return scoped_ptr<SasInjector>(); | 178 return scoped_ptr<SasInjector>(); |
| 181 } | 179 } |
| 182 | 180 |
| 183 } // namespace remoting | 181 } // namespace remoting |
| OLD | NEW |