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

Side by Side Diff: chrome_frame/dll_redirector.cc

Issue 7150018: Use GetVersion for Windows run-time version checks in preference to OperatingSystemVersionNumbers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | « chrome/renderer/localized_error.cc ('k') | chrome_frame/test/dll_redirector_test.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome_frame/dll_redirector.h" 5 #include "chrome_frame/dll_redirector.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlsecurity.h> 9 #include <atlsecurity.h>
10 #include <sddl.h> 10 #include <sddl.h>
11 11
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/file_version_info.h" 13 #include "base/file_version_info.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/path_service.h" 15 #include "base/path_service.h"
16 #include "base/shared_memory.h" 16 #include "base/shared_memory.h"
17 #include "base/string_util.h" 17 #include "base/string_util.h"
18 #include "base/sys_info.h"
19 #include "base/utf_string_conversions.h" 18 #include "base/utf_string_conversions.h"
20 #include "base/version.h" 19 #include "base/version.h"
21 #include "base/win/windows_version.h" 20 #include "base/win/windows_version.h"
22 #include "chrome_frame/utils.h" 21 #include "chrome_frame/utils.h"
23 22
24 const wchar_t kSharedMemoryName[] = L"ChromeFrameVersionBeacon_"; 23 const wchar_t kSharedMemoryName[] = L"ChromeFrameVersionBeacon_";
25 const uint32 kSharedMemorySize = 128; 24 const uint32 kSharedMemorySize = 128;
26 const uint32 kSharedMemoryLockTimeoutMs = 1000; 25 const uint32 kSharedMemoryLockTimeoutMs = 1000;
27 26
28 // static 27 // static
(...skipping 21 matching lines...) Expand all
50 } 49 }
51 50
52 // static 51 // static
53 DllRedirector* DllRedirector::GetInstance() { 52 DllRedirector* DllRedirector::GetInstance() {
54 return Singleton<DllRedirector>::get(); 53 return Singleton<DllRedirector>::get();
55 } 54 }
56 55
57 bool DllRedirector::BuildSecurityAttributesForLock( 56 bool DllRedirector::BuildSecurityAttributesForLock(
58 CSecurityAttributes* sec_attr) { 57 CSecurityAttributes* sec_attr) {
59 DCHECK(sec_attr); 58 DCHECK(sec_attr);
60 int32 major_version, minor_version, fix_version; 59 if (base::win::GetVersion() < base::win::VERSION_VISTA) {
61 base::SysInfo::OperatingSystemVersionNumbers(&major_version,
62 &minor_version,
63 &fix_version);
64 if (major_version < 6) {
65 // Don't bother with changing ACLs on pre-vista. 60 // Don't bother with changing ACLs on pre-vista.
66 return false; 61 return false;
67 } 62 }
68 63
69 bool success = false; 64 bool success = false;
70 65
71 // Fill out the rest of the security descriptor from the process token. 66 // Fill out the rest of the security descriptor from the process token.
72 CAccessToken token; 67 CAccessToken token;
73 if (token.GetProcessToken(TOKEN_QUERY)) { 68 if (token.GetProcessToken(TOKEN_QUERY)) {
74 CSecurityDesc security_desc; 69 CSecurityDesc security_desc;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 .Append(module_name); 286 .Append(module_name);
292 287
293 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); 288 HMODULE hmodule = LoadLibrary(module_path.value().c_str());
294 if (hmodule == NULL) { 289 if (hmodule == NULL) {
295 DPLOG(ERROR) << "Could not load reported module version " 290 DPLOG(ERROR) << "Could not load reported module version "
296 << version->GetString(); 291 << version->GetString();
297 } 292 }
298 293
299 return hmodule; 294 return hmodule;
300 } 295 }
OLDNEW
« no previous file with comments | « chrome/renderer/localized_error.cc ('k') | chrome_frame/test/dll_redirector_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698