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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 namespace sandbox { | 54 namespace sandbox { |
55 | 55 |
56 SANDBOX_INTERCEPT SharedMemory* g_interceptions; | 56 SANDBOX_INTERCEPT SharedMemory* g_interceptions; |
57 | 57 |
58 // Table of the unpatched functions that we intercept. Mapped from the parent. | 58 // Table of the unpatched functions that we intercept. Mapped from the parent. |
59 SANDBOX_INTERCEPT OriginalFunctions g_originals = { NULL }; | 59 SANDBOX_INTERCEPT OriginalFunctions g_originals = { NULL }; |
60 | 60 |
61 // Magic constant that identifies that this function is not to be patched. | 61 // Magic constant that identifies that this function is not to be patched. |
62 const char kUnloadDLLDummyFunction[] = "@"; | 62 const char kUnloadDLLDummyFunction[] = "@"; |
63 | 63 |
| 64 InterceptionManager::InterceptionData::InterceptionData() { |
| 65 } |
| 66 |
| 67 InterceptionManager::InterceptionData::~InterceptionData() { |
| 68 } |
| 69 |
64 InterceptionManager::InterceptionManager(TargetProcess* child_process, | 70 InterceptionManager::InterceptionManager(TargetProcess* child_process, |
65 bool relaxed) | 71 bool relaxed) |
66 : child_(child_process), names_used_(false), relaxed_(relaxed) { | 72 : child_(child_process), names_used_(false), relaxed_(relaxed) { |
67 child_->AddRef(); | 73 child_->AddRef(); |
68 } | 74 } |
69 InterceptionManager::~InterceptionManager() { | 75 InterceptionManager::~InterceptionManager() { |
70 child_->Release(); | 76 child_->Release(); |
71 } | 77 } |
72 | 78 |
73 bool InterceptionManager::AddToPatchedFunctions( | 79 bool InterceptionManager::AddToPatchedFunctions( |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 ::FreeLibrary(local_interceptor); | 545 ::FreeLibrary(local_interceptor); |
540 #endif | 546 #endif |
541 | 547 |
542 if (it != interceptions_.end()) | 548 if (it != interceptions_.end()) |
543 return false; | 549 return false; |
544 | 550 |
545 return true; | 551 return true; |
546 } | 552 } |
547 | 553 |
548 } // namespace sandbox | 554 } // namespace sandbox |
OLD | NEW |