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 // For information about interceptions as a whole see | 5 // For information about interceptions as a whole see |
6 // http://dev.chromium.org/developers/design-documents/sandbox . | 6 // http://dev.chromium.org/developers/design-documents/sandbox . |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "sandbox/win/src/interception.h" | 10 #include "sandbox/win/src/interception.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 interceptions_.push_back(module_to_unload); | 114 interceptions_.push_back(module_to_unload); |
115 return true; | 115 return true; |
116 } | 116 } |
117 | 117 |
118 bool InterceptionManager::InitializeInterceptions() { | 118 bool InterceptionManager::InitializeInterceptions() { |
119 if (interceptions_.empty()) | 119 if (interceptions_.empty()) |
120 return true; // Nothing to do here | 120 return true; // Nothing to do here |
121 | 121 |
122 size_t buffer_bytes = GetBufferSize(); | 122 size_t buffer_bytes = GetBufferSize(); |
123 scoped_array<char> local_buffer(new char[buffer_bytes]); | 123 scoped_ptr<char[]> local_buffer(new char[buffer_bytes]); |
124 | 124 |
125 if (!SetupConfigBuffer(local_buffer.get(), buffer_bytes)) | 125 if (!SetupConfigBuffer(local_buffer.get(), buffer_bytes)) |
126 return false; | 126 return false; |
127 | 127 |
128 void* remote_buffer; | 128 void* remote_buffer; |
129 if (!CopyDataToChild(local_buffer.get(), buffer_bytes, &remote_buffer)) | 129 if (!CopyDataToChild(local_buffer.get(), buffer_bytes, &remote_buffer)) |
130 return false; | 130 return false; |
131 | 131 |
132 bool hot_patch_needed = (0 != buffer_bytes); | 132 bool hot_patch_needed = (0 != buffer_bytes); |
133 if (!PatchNtdll(hot_patch_needed)) | 133 if (!PatchNtdll(hot_patch_needed)) |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 ::FreeLibrary(local_interceptor); | 541 ::FreeLibrary(local_interceptor); |
542 #endif | 542 #endif |
543 | 543 |
544 if (it != interceptions_.end()) | 544 if (it != interceptions_.end()) |
545 return false; | 545 return false; |
546 | 546 |
547 return true; | 547 return true; |
548 } | 548 } |
549 | 549 |
550 } // namespace sandbox | 550 } // namespace sandbox |
OLD | NEW |