| OLD | NEW |
| 1 // Copyright (c) 2011 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> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // We couldn't get the lock in a reasonable amount of time, so fall | 144 // We couldn't get the lock in a reasonable amount of time, so fall |
| 145 // back to loading our current version. We return true to indicate that the | 145 // back to loading our current version. We return true to indicate that the |
| 146 // caller should not attempt to delegate to an already loaded version. | 146 // caller should not attempt to delegate to an already loaded version. |
| 147 dll_version_.swap(our_version); | 147 dll_version_.swap(our_version); |
| 148 return true; | 148 return true; |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool created_beacon = true; | 151 bool created_beacon = true; |
| 152 bool result = shared_memory_->CreateNamed(shared_memory_name_.c_str(), | 152 bool result = shared_memory_->CreateNamed(shared_memory_name_.c_str(), |
| 153 false, // open_existing | 153 false, // open_existing |
| 154 kSharedMemorySize); | 154 kSharedMemorySize, |
| 155 false); // executable |
| 155 | 156 |
| 156 if (result) { | 157 if (result) { |
| 157 // We created the beacon, now we need to mutate the security attributes | 158 // We created the beacon, now we need to mutate the security attributes |
| 158 // on the shared memory to allow read-only access and let low-integrity | 159 // on the shared memory to allow read-only access and let low-integrity |
| 159 // processes open it. This will fail on FAT32 file systems. | 160 // processes open it. This will fail on FAT32 file systems. |
| 160 if (!SetFileMappingToReadOnly(shared_memory_->handle())) { | 161 if (!SetFileMappingToReadOnly(shared_memory_->handle())) { |
| 161 DLOG(ERROR) << "Failed to set file mapping permissions."; | 162 DLOG(ERROR) << "Failed to set file mapping permissions."; |
| 162 } | 163 } |
| 163 } else { | 164 } else { |
| 164 created_beacon = false; | 165 created_beacon = false; |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 .Append(module_name); | 286 .Append(module_name); |
| 286 | 287 |
| 287 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); | 288 HMODULE hmodule = LoadLibrary(module_path.value().c_str()); |
| 288 if (hmodule == NULL) { | 289 if (hmodule == NULL) { |
| 289 DPLOG(ERROR) << "Could not load reported module version " | 290 DPLOG(ERROR) << "Could not load reported module version " |
| 290 << version->GetString(); | 291 << version->GetString(); |
| 291 } | 292 } |
| 292 | 293 |
| 293 return hmodule; | 294 return hmodule; |
| 294 } | 295 } |
| OLD | NEW |